| | |
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 |
apache api array beginner binary broken cache cakephp checkbox class cms code confirm cron curl customizableitems database date display dynamic echo email error external fcc file files folder form forms forum freelancing function functions google header headmethod howtowriteathesis href htaccess html iframe image include insert ip javascript joomla limit link login mail malfunction menu method mlm mod_rewrite multiple mysql neutrality oop pageing pagerank paypal pdf php phpmysql play problem query question radio random recursion remote root script search select server sessions sms soap source space sql support! syntax system table template tutorial update upload url validator variable video web youtube






