| | |
URL parsing to get variables name
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Oct 2004
Posts: 29
Reputation:
Solved Threads: 0
hi.
maybe the solution to my problem is quite obvious but I can't find it, so I'm asking here.I'm building a small movie db with the chance for users to borrow the title they want.
the movies' info is fetched from a db and displayed in a html table.
this table has a column containing a checkbox named as the numeric ID of the movie:
[PHP]<input name="'.$id.'" type="checkbox">[/PHP]
now, I want to create a confirmation page before the user sends in the form with what he/she wants to borrow, but I can't figure out how to parse the URL.
when I submit the form with GET method, I get something like this:order_preview.php?name=Andrea&205=on&206=on&Submit=Send
I can see that the numbers represent the checkboxes selected but how do I parse the URL to get those numbers and not the "on" value?
thanks
Andrea
maybe the solution to my problem is quite obvious but I can't find it, so I'm asking here.I'm building a small movie db with the chance for users to borrow the title they want.
the movies' info is fetched from a db and displayed in a html table.
this table has a column containing a checkbox named as the numeric ID of the movie:
[PHP]<input name="'.$id.'" type="checkbox">[/PHP]
now, I want to create a confirmation page before the user sends in the form with what he/she wants to borrow, but I can't figure out how to parse the URL.
when I submit the form with GET method, I get something like this:order_preview.php?name=Andrea&205=on&206=on&Submit=Send
I can see that the numbers represent the checkboxes selected but how do I parse the URL to get those numbers and not the "on" value?
thanks
Andrea
Last edited by trashed; Jan 23rd, 2007 at 3:37 pm.
php Syntax (Toggle Plain Text)
foreach ($_GET as $key => value) { echo $key . "<br />"; }
John Conde
Brainyminds | Merchant Account Services | I Love Code
IT'S HERE: Merchant Accounts 101 Everything you need to know about merchant accounts!
Brainyminds | Merchant Account Services | I Love Code
IT'S HERE: Merchant Accounts 101 Everything you need to know about merchant accounts!
![]() |
Similar Threads
- multiple variables in a mod_rewrite URL string (Linux Servers and Apache)
- Viewing simple HTML tags (PHP)
- uploading a picture (PHP)
- another newbie with alot of redhat and apache server Q'S (Linux Servers and Apache)
- Please Help!!! MOD function (ASP)
- Passing variables into form fields (PHP)
- Using Search Engine Friendly PHP URLs (PHP)
Other Threads in the PHP Forum
- Previous Thread: PHP mail function issue
- Next Thread: View HTML source in php page?
| Thread Tools | Search this Thread |
# .htaccess 5.2.10 ajax apache api array beginner binary broken cakephp checkbox class clients cms code cron curl database date directory display dissertation download dynamic echo email error file files folder form forms function functions google href htaccess html image images include insert integration ip java javascript joomla ldap legislation limit link login loop mail memberships menu mlm mod_rewrite multiple mysql mysqlquery oop open paypal pdf persist php problem query radio random recursion regex remote rss script search server sessions sms soap sockets source space sql syntax system table tutorial update upload url validation validator variable video web xml youtube






