Welcome Guest ( Log In | Register)



 
Reply to this topicStart new topic
> Php Shows Blank Page
MacFly
post Jan 10 2005, 08:53 PM
Post #1


Newbie [Level 2]
**

Group: Members
Posts: 36
Joined: 9-November 04
Member No.: 2,202



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 ?
CODE

<?
// requesting client's information

$email = $_REQUEST['email'];
$name = $_REQUEST['name'];
$phone = $_REQUEST['phone'];
$GSM = $_REQUEST['GSM'];

// getting the product's information

$2in1name = "2 in 1 Kaarsen";
$2in1price = 4.00;
$2in1 = $_REQUEST['2in1'];
$total2in1 = $2in1* $2in1price;

$eikaarskleinname = "Eikaars Klein";
$eikaarskleinprice = 4.00;
$eikaarsklein = $_REQUEST['eikaarsklein'];
$totaleikaarsklein = $eikaarsklein * $eikaarskleinprice;

// they are all the same from here - name, price, number and total

$gpLMname = "Geurparels Limoen:Meiklokjes";
$gpLMprice = 4.00;
$gpLM = $_REQUEST['gpLM'];
$totalgpLM = $gpLM * $gpLMprice;

//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";

//this should be sending the message
 mail("spammail@gmail.com", "$name Aromax Bestelling", $message, "From: $email");
header("Location: http://aromax.bizhat.com");
?>

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!
Go to the top of the page
 
+Quote Post
alapidus
post Jan 17 2005, 12:44 AM
Post #2


Member [Level 1]
****

Group: Members
Posts: 74
Joined: 21-October 04
From: Connecticut
Member No.: 1,870



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!
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic

Collapse

> Similar Topics

Topics Topics
  1. Php Unique Hit Counter(29)
  2. Refresh Web Page(6)
  3. Open Php Page From Another Server(7)
  4. Refresh Page After Back Button Hit(11)
  5. Problem With Page Redirect(8)
  6. Google To Take On Geocities(53)
  7. Wap Source Code Viewer(4)
  8. Scrolling Images?(5)
  9. Google Page Creator Updated(4)
  10. Web Page Tree Menu: Style Sheet - Javascript(6)
  11. Error Code In Subscriptions Page(5)
  12. Create Page?(11)
  13. What Is Your Home Or Start Page?(19)
  14. How To Make An Item Scroll With You On The Page.(9)
  15. How Do I Get Rid Of The Placeholder Page? [resolved](5)
  1. Page Load Error When Accessing Cpanel(0)
  2. Watch Free Movies And Tv Shows Streaming Online!(3)
  3. Adding Flash Music Player To Home/any Page(4)
  4. Need Help To Increase The Page Rank Of Website!(2)
  5. Free Digilake's Blank Dvd+r(0)
  6. PHP Function To Add Previous and Next Page Feature(2)
  7. Hosting Account Suspended(2)
  8. Naming Web Page Files(9)
  9. Redirecting Visitors To Different Page(8)
  10. How To Implement A Date Picker On A Web Page(0)
  11. Web Page Designing(5)
  12. Php Linking(2)
  13. [v.i.q] Shows Ltd. Com Worth Million$ ?(2)


 



- Lo-Fi Version Time is now: 6th September 2008 - 05:23 AM