Jul 20, 2008

Php Shows Blank Page

Free Web Hosting, No Ads > CONTRIBUTE > Computers > Programming Languages > PHP Programming

free web hosting

Php Shows Blank Page

MacFly
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!

 

 

 


Reply

alapidus
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!

Reply



Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

(Maximum characters: 10,000)
You have characters left.
Confirm Code:

Similar Topics

Keywords : php shows blank

  1. Making Sure They Did Not Leave Any Required Fields Blank - (3)
    how to make sure they did not leave any required fields blank? CODE <?php
        include("config/config.inc.php");
        include("config/dbcon.php");     include("checksession.php");
                 if(isset($_POST['action'])){         $gname =
    $_POST['gname'];         $gemail = $_POST['mail'];
            $gmsg = $_POST['gmsg'];         $date =
    date("m.d.y"); $sql = "insert into tblg...
  2. Blank Cookies... - Need some help with Cookies... (4)
  3. Blank/duplicate Entries - a little help please. (5)
    Hi, I have been working with a download/link exchange script:
    http://evilddl.info/download/EViLDDL_1.0.1.rar However it has some problems when adding download
    links.. Users can submit downloads with no title, and also entries with duplicate titles. Can
    anyone show me how to fix this?? Here is the submit page: "> "> ">


    Menu ...



Looking for php, shows, blank, page

Searching Video's for php, shows, blank, page
advertisement



Php Shows Blank Page



 

 

 

 

ADD REPLY / Got an Opinion! Remove these ADs! RAPID SEARCH! Free Web Hosting [X]
Express your Opinions, Thoughts or Contribute more info. to help others.
Ask your Doubts & Queries to get answers, So that "Together We can help others!"
Register FREE for AD-FREE forum, Create your own topics, Ask Questions, track topics, setup subscriptions & notifications and Get a Free Website w/ Email and FTP.
500MB Space *No Ads*, CPanel, FTP, PHP, MySQL, EMails - 100% FREE