Jump to content
xisto Community
MacFly

Php Shows Blank Page

Recommended Posts

Hey there everyone,

I'm trying to create a website using some PHP.
I created an order form for my school company to let people order products this way. Only orders are made - no payments or anything.
Now I have create the whole website. It is very simple. Every different product has a different combobox to select the number of items from.
Then on the end of the page the client's details are asked.
Now I created this PHP file that would handle everything, that is collecting all information and creating a well-formatted e-mail to send to the company's e-mail address.
I thought everything I coded was right - but I guess there must be something wrong.
When I try it out, the page get redirected to a blank page (though I tell the script to relocate to the website) and no email is sent.
I have attached the PHP code (it's quite long so I cut out a part) and I was wondering if any of you can see something wrong with the code that is causing this problem ?

[br]<? [/br]// requesting client's information [br][/br]$email = $_REQUEST['email']; [br]$name = $_REQUEST['name']; [/br]$phone = $_REQUEST['phone']; [br]$GSM = $_REQUEST['GSM']; [br][/br]// getting the product's information [br][/br]$2in1name = "2 in 1 Kaarsen"; [/br]$2in1price = 4.00; [br]$2in1 = $_REQUEST['2in1']; [/br]$total2in1 = $2in1* $2in1price; [br][/br]$eikaarskleinname = "Eikaars Klein"; [br]$eikaarskleinprice = 4.00; [/br]$eikaarsklein = $_REQUEST['eikaarsklein']; [br]$totaleikaarsklein = $eikaarsklein * $eikaarskleinprice; [br][/br]// they are all the same from here - name, price, number and total [br][/br]$gpLMname = "Geurparels Limoen:Meiklokjes"; [/br]$gpLMprice = 4.00; [br]$gpLM = $_REQUEST['gpLM']; [/br]$totalgpLM = $gpLM * $gpLMprice; [br][/br]//this should be created the email message [br]  $message = "Bestelling door $name\n Te bereiken op $phone, of op de GSM $GSM\n \n Bestelling\n \n $2in1 keer $2in1name = $total2in1"; [br][/br]//this should be sending the message [/br]  mail("spammail@gmail.com", "$name Aromax Bestelling", $message, "From: $email"); [br]header("Location: http://aromax.bizhat.com"); [/br]?> [br]
[/br]All help will be highly appreciated!
Here you can check out the script in action (with the real emailaddress - I have replaced it because I don't like spam )
As you see only the first product would be included in the e-mail for now - I would expand it in the future of course. So selecting only the first items and filling in some details should do it I suppose.

Thanks in advance to all!

Share this post


Link to post
Share on other sites

you have to separate all variables (or anything other than text) from text with periods and quotes otherwise the PHP parser doesn't know which is which. for instance:


//this should be created the email message

$message = "Bestelling door ". $name ."\n Te bereiken op ". $phone .", of op de GSM ". $GSM ."\n \n Bestelling\n \n ". $2in1 ." keer ". $2in1name ." = ". $total2in1;


also, i don't trust using $_REQUEST. its better to use either $_POST or $_GET depending on the form method (or $_COOKIE, but i'm not experienced with those).


you should check out the PHP online manual from php.net! it'll help you a lot!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.