Old 04-04-2008, 07:06   #1 (permalink)
captain caveman
Registered User
 
Join Date: Jun 2006
Posts: 44
php form validation problem

Hi guys,

I haven't been on here for a long while as my job doesn't require me to use php very often. But as I got a lot of help from you all before I have returned here with what I think is probably a pretty simple problem...

I originally created a web site form which uses both Javascript and php to validate. It also sends out a couple of emails - one to my company and one to the person who filled out the form. This has worked fine for ages, however having updated the website today with some minor changes (none to the form itself), I noticed that the form isn't working properly.

The page is displaying the form fields filled out with what is entered as the value for that field - for example for the first name field I have

<input type="text" name="first_name" tabindex="2" value="<? echo $first_name; ?>"/>

and within the field ie displays <? echo $first_name; ?>"/

Also, after the submit button at the bottom, ie displays ">

I'm sure this is something simple (I'm probably being pretty thick here) and anyone who works with php will know what's going on, but I'm confused as to why this has started to do this without me changing anything to my knowledge?!

I suspect it may be a small error in the code but any ideas?

Thanks for any help.
  Reply With Quote
Old 04-04-2008, 07:17   #2 (permalink)
captain caveman
Registered User
 
Join Date: Jun 2006
Posts: 44
Sorry that should have read

and within the field ie displays <? echo $first_name; ?>

I can supply the script if it's any help.
  Reply With Quote
Old 04-04-2008, 08:54   #3 (permalink)
MikeMackay
Everything is fine.
 
MikeMackay's Avatar
 
Join Date: Feb 2005
Location: Farringdon, London
Posts: 640
Send a message via MSN to MikeMackay Send a message via Skype™ to MikeMackay
It looks like you're using PHP short tags. Even if you have not changed anything, your server admin could have disabled the use of short tags which will render your PHP code inoperable.

Try using <?php $echo $first_name; ?> as opposed to <? echo $first_name; ?> and see if that makes a difference.

- Mike
__________________
Mike Mackay - Developer
  Reply With Quote
Old 04-04-2008, 10:09   #4 (permalink)
captain caveman
Registered User
 
Join Date: Jun 2006
Posts: 44
Hi Mike, yep thanks I've done this now - it seems the hosting company had upgraded php without my knowledge. So mystery solved!
  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


Contact Us - Web Design Forums - Archive - Top
Search Engine Optimization by vBSEO 3.0.0 RC8