Jump to content

  • Log in with Facebook Log in with Twitter Log In with Google      Sign In   
  • Create Account

Subscribe to HRA Now!

 



Are you a Google Analytics enthusiast?

Share and download Custom Google Analytics Reports, dashboards and advanced segments--for FREE! 

 



 

 www.CustomReportSharing.com 

From the folks who brought you High Rankings!


Sponsored Content

 

 
 

Photo
- - - - -

Simple Php Question


  • Please log in to reply
3 replies to this topic

#1 heyman

heyman

    HR 3

  • Active Members
  • PipPipPip
  • 53 posts

Posted 21 December 2004 - 11:00 AM

Simple php question

regarding emailing forms

I am trying to put this
CODE
$City=$_POST['city'];
$State=$_POST['state'];
$Zip=$_POST['zip1'];


on 1 line of the email

like this:
CODE
.'City,State,Zip: '.$city. '.$state. '.$zip1."\n"


city and zip come out fine but state always never fills in
state always comes out like this: .$state. on the email

whats the reason why? Also if you could give me the syntax to include a comma between city , state, and zip that would be helpful.

thanks

#2 lcobb

lcobb

    HR 3

  • Active Members
  • PipPipPip
  • 86 posts

Posted 21 December 2004 - 11:14 AM

I'm not a php programmer, but it looks like you need to remove the single quotes around state which will designate it as a the text value . $state .

If you want to add the comma, I am guessing that would be:

.'City,State,Zip: '.$city.', '.$state.' '.$zip1."\n"

Larry

#3 heyman

heyman

    HR 3

  • Active Members
  • PipPipPip
  • 53 posts

Posted 21 December 2004 - 11:28 AM

Perfect,

thanks for the help

#4 linux_lover

linux_lover

    LiLo

  • Active Members
  • PipPipPipPipPipPip
  • 831 posts
  • Location:York, UK

Posted 21 December 2004 - 12:44 PM

I would personally remove all that single quote crap - its unnecesserally confusing - and just use double quotes - as php can parse variables in double quotes:

print ("City,State,Zip: $city $state $zip \n");

Also from your code above it looks like you need to watch the capitalisation of your var names, and Zip1 should be Zip.

smile.gif




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users