Php script not working
-
- Registered User
- Posts: 10628
- Joined: 26 Mar 2007, 02:00
- Location: In the river of thoughts
- Contact:
Php script not working
I made a php script and tried modifying one made for me for someone overseas but neither works. After I press send I get a blank page. I am not sure what is causing the problem. Can anyone help?
- Ron2K
- Forum Technical Administrator
- Posts: 9050
- Joined: 04 Jul 2006, 16:45
- Location: Upper Hutt, New Zealand
- Contact:
Re: Php script not working
Kia kaha, Kia māia, Kia manawanui.
-
- Registered User
- Posts: 20576
- Joined: 19 Sep 2003, 02:00
- Location: Bloodbank
-
- Registered User
- Posts: 10628
- Joined: 26 Mar 2007, 02:00
- Location: In the river of thoughts
- Contact:
Re: Php script not working
Hi. I checked everything so that is working but my confirmation page does not come up.
-
- Registered User
- Posts: 20576
- Joined: 19 Sep 2003, 02:00
- Location: Bloodbank
Re: Php script not working
Dude if you don't give more info we can't help. Do you use forms. If so just post some psudo code with the form tags in it. It would at least be a start.
- Spoiler (show)
Re: Php script not working
Function of the script?
PHP version on the server?
PHP version on the server?
-
- Registered User
- Posts: 10628
- Joined: 26 Mar 2007, 02:00
- Location: In the river of thoughts
- Contact:
Re: Php script not working
Here is the code:RuadRauFlessa wrote:More info would be welcome.
<?php
$httpagent = $_POST['httpagent'];
$httpref = $_POST['$httpref'];
$recipient = "wwwnddk@xy.com";
$fullname = $_POST['fullname'];
$idnumber = $_POST['idnumber'];
$Physicaladdress = $_POST['physicaladdress'];
$Postaladdress = $_POST['postaladdress'];
$Telephonehome = $_POST['telephonehome'];
$Telephonework = $_POST['telephonework'];
$Cell = $_POST['Cell'];
$Join = $_POST['Join'];
$From = "www.website.net";
$comments = $_POST['comments'];
$todayis = date("l, F j, Y, g:i a") ;
$subject = "Bill of Animal Rights";
// Page Notification
$notificationPage = "http://www.website.net/Confirmation.htm";
$message = "Today's date is: $todayis";
$message = "\r\n";
$message = "Name: $fullname";
$message = "\r\n";
$message .= "ID Number: $idnumber";
$message = "\r\n";
$message .= "Physical Address: $Physicaladdress";
$message = "\r\n";
$message .= "Postal Address: $Postaladdress";
$message = "\r\n";
$message .= "Telephone (home): $Telephonehome";
$message = "\r\n";
$message .= "Telephone (work): $Telephonework";
$message = "\r\n";
$message .= "Cell Number: $Cell";
$message = "\r\n";
$message .= "Join ABVP Law?: $Join";
$message = "\r\n";
$message .= "Comments: $comments ";
mail($recipient,$subject,$message,$From);
// Notification
$exit_location = "Location: ".$notificationPage;
header($exit_location);
?>
I need the confirmation page to come up and from the website address
-
- Registered User
- Posts: 10628
- Joined: 26 Mar 2007, 02:00
- Location: In the river of thoughts
- Contact:
Re: Php script not working
maxxis wrote:Function of the script?
PHP version on the server?
Hi. It has to send information regarding a persons details to the web company about a bill. I used a earlier script and that worked perfectly but this one does not. Once it is working I can then add validation code to it.
For what the page sends: here is the site page: contact page that does not to function correctly
Re: Php script not working
Link doesn't work
-
- Registered User
- Posts: 10628
- Joined: 26 Mar 2007, 02:00
- Location: In the river of thoughts
- Contact:
Re: Php script not working
Ok. Here is the link: www.legalworx.net/contact2.htm
I now getting the confirmation page but all the text is on one line and I getting am not getting the from that I defined
I now getting the confirmation page but all the text is on one line and I getting am not getting the from that I defined
Re: Php script not working
post the actual code of bvp2.php please
use [c o d e] tags
use [c o d e] tags
-
- Registered User
- Posts: 10628
- Joined: 26 Mar 2007, 02:00
- Location: In the river of thoughts
- Contact:
Re: Php script not working
Ok.maxxis wrote:post the actual code of bvp2.php please
use [c o d e] tags
Code: Select all
<?php
$httpagent = $_POST['httpagent'];
$httpref = $_POST['$httpref'];
$recipient = "xyz@zy.com";
$fullname = $_POST['fullname'];
$idnumber = $_POST['idnumber'];
$Physicaladdress = $_POST['physicaladdress'];
$Postaladdress = $_POST['postaladdress'];
$Telephonehome = $_POST['telephonehome'];
$Telephonework = $_POST['telephonework'];
$Cell = $_POST['Cell'];
$Join = $_POST['Join'];
$From = "www.website.net";
$comments = $_POST['comments'];
$todayis = date("l, F j, Y, g:i a") ;
$subject = "Bill of Animal Rights";
$message = "Today's date is: $todayis";
$message = "Name: $fullname";
$message .= "ID Number: $idnumber";
$message .= "Physical Address: $Physicaladdress";
$message .= "Postal Address: $Postaladdress";
$message .= "Telephone (home): $Telephonehome";
$message .= "Telephone (work): $Telephonework";
$message .= "Cell Number: $Cell";
$message .= "Join ABVP Law?: $Join";
$message .= "Comments: $comments";
mail($recipient,$subject,$message,$From);
// Page Notification
$notificationPage = "http://www.website.htm";
// Notification
$exit_location = "Location: ".$notificationPage;
header($exit_location);
?>
-
- Registered User
- Posts: 10628
- Joined: 26 Mar 2007, 02:00
- Location: In the river of thoughts
- Contact:
Re: Php script not working
The big problem now is I can't get the lines to appear one under the other and the from is wrong.
Re: Php script not working
Your $notificationPage = "http://www.website.htm"; is completely wrong.
That should be the final destination URL.
That should be the final destination URL.
-
- Registered User
- Posts: 20576
- Joined: 19 Sep 2003, 02:00
- Location: Bloodbank
Re: Php script not working
should propably be
Code: Select all
$notificationPage = "http://www.website.net/Confirmation.htm";
- Spoiler (show)
-
- Registered User
- Posts: 10628
- Joined: 26 Mar 2007, 02:00
- Location: In the river of thoughts
- Contact:
Re: Php script not working
RuadRauFlessa wrote:should propably beCode: Select all
$notificationPage = "http://www.website.net/Confirmation.htm";
I got it like that. I just edited out wrong.
How do I get my information to under neatly and easy to read because it is all appearing on one line.
-
- Registered User
- Posts: 10628
- Joined: 26 Mar 2007, 02:00
- Location: In the river of thoughts
- Contact:
Re: Php script not working
maxxis wrote:Your $notificationPage = "http://www.website.htm"; is completely wrong.
That should be the final destination URL.
Sorry about that. I edited it wrong. I got it correct on ythe online script. Can you help with the display of the information? It is all on one line now.
Re: Php script not working
Looks like the whole processor page is wrong.
CP. Did you even edit the page to make sure all the form fields are linking correctly and that the recipients etc are correct?
CP. Did you even edit the page to make sure all the form fields are linking correctly and that the recipients etc are correct?
-
- Registered User
- Posts: 10628
- Joined: 26 Mar 2007, 02:00
- Location: In the river of thoughts
- Contact:
Re: Php script not working
Yes. They are. It is working now except the display part. I getting the info on one line.maxxis wrote:Looks like the whole processor page is wrong.
CP. Did you even edit the page to make sure all the form fields are linking correctly and that the recipients etc are correct?
Re: Php script not working
Code: Select all
$message = "Today's date is: $todayis";
$message = "\r\n";
$message .= "Name: $fullname";
$message .= "\r\n";
$message .= "ID Number: $idnumber";
$message .= "\r\n";
$message .= "Physical Address: $Physicaladdress";
$message .= "\r\n";
$message .= "Postal Address: $Postaladdress";
$message .= "\r\n";
$message .= "Telephone (home): $Telephonehome";
$message .= "\r\n";
$message .= "Telephone (work): $Telephonework";
$message = "\r\n";
$message .= "Cell Number: $Cell";
$message .= "\r\n";
$message .= "Join ABVP Law?: $Join";
$message .= "\r\n";
$message .= "Comments: $comments ";
-
- Registered User
- Posts: 10628
- Joined: 26 Mar 2007, 02:00
- Location: In the river of thoughts
- Contact:
Re: Php script not working
Here is how it comes to me:CesarePlay wrote:Yes. They are. It is working now except the display part. I getting the info on one line.maxxis wrote:Looks like the whole processor page is wrong.
CP. Did you even edit the page to make sure all the form fields are linking correctly and that the recipients etc are correct?
www.legalworx.net
Name: CesareID Number: 8108275008087Physical Address: 56 Jan Smuts AvenuePostal Address: 219969866Telephone (home): Telephone (work): Cell Number: Join ABVP Law?: YesComments: test
-
- Registered User
- Posts: 10628
- Joined: 26 Mar 2007, 02:00
- Location: In the river of thoughts
- Contact:
Re: Php script not working
Thanks. I will do that. How do I fix the "From" part. It says from anonymousmaxxis wrote:Replace the existing bit with thatCode: Select all
$message = "Today's date is: $todayis"; $message = "\r\n"; $message .= "Name: $fullname"; $message .= "\r\n"; $message .= "ID Number: $idnumber"; $message .= "\r\n"; $message .= "Physical Address: $Physicaladdress"; $message .= "\r\n"; $message .= "Postal Address: $Postaladdress"; $message .= "\r\n"; $message .= "Telephone (home): $Telephonehome"; $message .= "\r\n"; $message .= "Telephone (work): $Telephonework"; $message = "\r\n"; $message .= "Cell Number: $Cell"; $message .= "\r\n"; $message .= "Join ABVP Law?: $Join"; $message .= "\r\n"; $message .= "Comments: $comments ";
Re: Php script not working
Change $From = "www.website.net"; to $From = $_POST['email'];
I would recommend you capture the email address on the form.
I would recommend you capture the email address on the form.
-
- Registered User
- Posts: 10628
- Joined: 26 Mar 2007, 02:00
- Location: In the river of thoughts
- Contact:
Re: Php script not working
Ok. I will convince the guy to do have it in the form.
-
- Registered User
- Posts: 10628
- Joined: 26 Mar 2007, 02:00
- Location: In the river of thoughts
- Contact:
Re: Php script not working
Ok. the form works but now I need to add validation to the fields. Where is the best website for this?