LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices



Reply
 
Search this Thread
Old 02-06-2009, 01:32 PM   #1
3vra
Member
 
Registered: Dec 2008
Distribution: ubuntu
Posts: 51
Blog Entries: 1

Rep: Reputation: 16
How do you assign an html element as a php variable?


Can someone please tell me if it is possible to assign an html element as a php variable for doing form validation?
 
Old 02-06-2009, 06:51 PM   #2
jlinkels
Senior Member
 
Registered: Oct 2003
Location: Bonaire
Distribution: Debian Wheezy/Jessie/Sid, Linux Mint DE
Posts: 4,247

Rep: Reputation: 558Reputation: 558Reputation: 558Reputation: 558Reputation: 558Reputation: 558
Every HTML component is copied to the $_POST array. When you set the 'action=blabla.php' in the form, in blabla.php you analyze the $_POST array, and perform the validation.

As easy as that. For client side validation this doesn't work, php is strictly server side.

jlinkels
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
php global variable appears in every html form with firefox 3.0.3 baikonur Programming 1 11-02-2008 06:16 AM
assign converted string to variable bmaheni Linux - Newbie 2 12-28-2007 09:41 AM
How to assign a string to a structure variable in C? daYz Programming 7 06-13-2007 03:38 PM
How do I set a PHP variable = to a HTML textbox's value? nickiv Programming 4 06-06-2005 02:41 PM
HTML setting focus on a form element on load patpawlowski Programming 3 02-24-2004 11:01 AM


All times are GMT -5. The time now is 03:52 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration