Go Back   Novahq.net Forum > Computers > Web design and Programming

Web design and Programming Discuss website creation and other programming topics.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 01-18-2011, 05:51 PM
the þrox™ is offline the þrox™
Registered User

Join Date: Aug 2003
Posts: 3,739

Send a message via ICQ to the þrox™ Send a message via AIM to the þrox™
php HELP!!!

Whats wrong with my coding?

I keep getting this error:

Parse error: syntax error, unexpected $end....

PHP Code:
<?php 
 $to 
$_REQUEST['sendto'] ; 
 
$from $_REQUEST['Name'] ; 
 
$name $_REQUEST['Name'] ;
 
$address $_REQUEST['Address'] ;
 
$city $_REQUEST['City'] ;
 
$state $_REQUEST['State'] ;
 
$zip $_REQUEST['Zip'] ;
 
$phonenumber $_REQUEST['PhoneNumber'] ;
 
$headers "From: $from"
 
$subject "Home Delivery Service Request"
 
 
$fields = array(); 
 
$fields{"Name"} = "Name"
 
$fields{"Address"} = "Address"
 
$fields{"City"} = "City"
 
$fields{"State"} = "State"
 
$fields{"Zip"} = "Zip"
 
$fields{"PhoneNumber"} = "PhoneNumber"
 
 
$body "We have received the following information:\n\n"; foreach($fields as $a => $b){     $body .= sprintf("%20s: %s\n",$b,$_REQUEST[$a]); } 
 
 
$headers2 "From: comments@cometsatx.com"
 
$subject2 "Thank you for contacting us"
 
$autoreply "Thank you for contacting us. We will review your request for your area and will contact you as soon as it becomes avaliable!";
 
 if(
$from == '') {print "You have not entered a name, please go back and try again";} 
 else { 
 if(
$name == '') {print "You have not entered a name, please go back and try again";} 
 else {
 if(
$address == '') {print "You have not entered an address, please go back and try again";} 
 else {
 if(
$city == '') {print "You have not entered a city, please go back and try again";} 
 else {
 if(
$state == '') {print "You have not entered a state, please go back and try again";} 
 else {
 if(
$zip == '') {print "You have not entered a zip code, please go back and try again";} 
 else {
 if(
$phonenumber == '') {print "You have not entered a phone number, please go back and try again";} 
 else {
 
$send mail($to$subject$body$headers); 
 
$send2 mail($from$subject2$autoreply$headers2); 
 if(
$send
 {
header"Location: thankyou.htm" );} 
 else 
 {print 
"We encountered an error sending your mail, please notify webmaster@cometsatx.com"; } 
 
?>
Html portion of the form code:
HTML Code:
<form method="post" action="hd.php"> 
   		    <table bgcolor=#fff0c3 align=left> 
   		      <tr>
   		        <td colspan=2><strong class="style6"><i>Request Service in Your Area:</i></strong></td></tr> 
   		      <tr><td class="style6">Department:</td><td><select name="sendto"> <option value="comments@cometsatx.com">HD Service</option></select></td></tr> 
   		      <tr><td class="style6"><font color=red>*</font> Name:</td><td><input size=25 name="Name"></td></tr> 
   		      <tr><td class="style6"><font color=red>*</font> Address:</td><td><input size=25 name="Address"></td></tr> 
   		      <tr><td class="style6"><font color=red>*</font> City:</td><td><input size=25 name="City"></td></tr> 
   		      <tr><td class="style6"><font color=red>*</font> State:</td><td><input size=1 name="State"></td></tr>
   		      <tr><td class="style6"><font color=red>*</font> Zip:</td><td><input size=4 name="Zip"></td></tr>  
   		      <tr><td class="style6"><font color=red>*</font> Phone Number:</td><td><input size=25 name="PhoneNumber"></td></tr>
   		      <tr><td colspan=2 align=center><input type=submit name="send" value="Submit"></td></tr> 
   		      <tr><td colspan=2 align=center><small class="style6">A <font color=red>*</font> indicates a field is required</small></td></tr> 
	        </table>
   		  </form>
          <br>
   		  <p align="right"><img src="images/hdplaceholder.png" width="278" height="202"></p>
   		  <p align="justify">&nbsp;</p>
   		 
	  <p align="justify">&nbsp;</p>
      <br>
      <br>
      <span class="style5"><br>
	  </span>
      <p align="justify" class="style5"><em>Any further questions can be answered by calling: (210) 332-3302 and ask our Home Delivery Service.</em></p>
	  <p align="justify">&nbsp;</p></td>



<td background="images/index_08.png" width="7" height="46" alt=""></td>

		<td background="images/index_09.png" width="242" height="46" alt="" valign="top">

Website to view form:

http://kkdigitaldesigns.com/cometcle...medelivery.htm
__________________



----------------------------------------
[Presents: ++]

Sigs Made: [29]
Reply With Quote
  #2  
Old 01-18-2011, 08:06 PM
the þrox™ is offline the þrox™
Registered User

Join Date: Aug 2003
Posts: 3,739

Send a message via ICQ to the þrox™ Send a message via AIM to the þrox™
Please disregard! Steve helped me :]
__________________



----------------------------------------
[Presents: ++]

Sigs Made: [29]
Reply With Quote
  #3  
Old 01-19-2011, 03:16 PM
atholon is offline atholon
"ath-hole"

Join Date: Jan 2003
Location: Failville.
Posts: 11,357

Send a message via MSN to atholon
Steve FTW!
__________________
Reply With Quote
  #4  
Old 01-23-2011, 06:49 PM
the þrox™ is offline the þrox™
Registered User

Join Date: Aug 2003
Posts: 3,739

Send a message via ICQ to the þrox™ Send a message via AIM to the þrox™
Ok, i've run into a problem, im trying to make the php send an alert box popup when someone fails to enter the required information. Right now it sends you to a new page saying "You have not entered an address, please go back and try againYou have not entered a city, please go back and try again".

Instead of this i want it to pop up with an alert box, or something simular saying they need to enter the required field. Any help?
__________________



----------------------------------------
[Presents: ++]

Sigs Made: [29]
Reply With Quote
  #5  
Old 01-23-2011, 09:43 PM
Lakie is offline Lakie

Join Date: Mar 2002
Posts: 5,540

http://www.weberdev.com/get_example-4111.html

Something like that?
Reply With Quote
  #6  
Old 01-24-2011, 11:01 AM
atholon is offline atholon
"ath-hole"

Join Date: Jan 2003
Location: Failville.
Posts: 11,357

Send a message via MSN to atholon
If you want an alert box you'd have to do the validation with javascript and/or ajax.
__________________
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Well it's PHP but....What do u think MadMan TCO Web design and Programming 18 03-09-2005 08:25 PM
Php Help!! navysea| Web design and Programming 3 03-04-2005 06:27 PM
PHP-NUKE and PHP ~BLÃÐE~ phphq.Net Forums 9 01-19-2005 06:49 AM
PHP atholon Web design and Programming 16 07-21-2004 09:17 AM
php anyone? Surge Web design and Programming 7 07-26-2003 11:04 AM


All times are GMT -5. The time now is 04:16 AM.




Powered by vBulletin®