Visit Jeremy's Blog.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
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.


  Search this Thread
Old 02-06-2009, 12:32 PM   #1
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, 05:51 PM   #2
Senior Member
Registered: Oct 2003
Location: Bonaire
Distribution: Debian Wheezy/Jessie/Sid, Linux Mint DE
Posts: 4,487

Rep: Reputation: 627Reputation: 627Reputation: 627Reputation: 627Reputation: 627Reputation: 627
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.



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 05:16 AM
assign converted string to variable bmaheni Linux - Newbie 2 12-28-2007 08:41 AM
How to assign a string to a structure variable in C? daYz Programming 7 06-13-2007 02:38 PM
How do I set a PHP variable = to a HTML textbox's value? nickiv Programming 4 06-06-2005 01:41 PM
HTML setting focus on a form element on load patpawlowski Programming 3 02-24-2004 10:01 AM

All times are GMT -5. The time now is 11:20 PM.

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