Byte Forums
»
Computing
»
Programming
»
Web Programming
»
PHP
php mysql run script with spaces
|
|
|
php mysql run script with spaces
|
|
07-02-2009, 02:43 AM
Post: #1
|
|||
|
|||
|
can anyone tell me how to run a script that pulls from mysql where the variable has a space... the script stops at
phone_notes.php?manufacturer=test&model=m800 its suppose to be: phone_notes.php?manufacturer=test&model=m800 instinct Can someone tell me how to put something in my script that will grab the whole variable. |
|||
|
07-02-2009, 11:39 PM
Post: #2
|
|||
|
|||
|
RE: php mysql run script with spaces
well in php you should just be able to use $_GET['model']
however you may be having problems because that the url is not url encoded. really it should be like phone_notes.php?manufacturer=test&model=m800%20instinct and the %20 is converted to a space. Check out php.net/urlencode ![]() Lockerz Invites! |
|||
|
07-03-2009, 12:05 AM
Post: #3
|
|||
|
|||
|
RE: php mysql run script with spaces
that deffinately sounds like what I am looking for... so heres how my current script works:
This link retrieves model names from a database echo"<a href=phone_notes.php?manufacturer=$manufacturer&model={$model[0]}>$model[0]</a><br>"; when the user clicks on it, it retrieves the notes for that model. The problem I'm having is when a model is named something like "m800 instinct" the url will stop at phone_notes.php?manufacturer=LG&model=ax its suppose to be phone_notes.php?manufacturer=LG&model=ax 260 scooplx 260 rumor thanks for your help |
|||
|
07-04-2009, 09:24 PM
Post: #4
|
|||
|
|||
|
RE: php mysql run script with spaces
change it to this:
PHP Code: echo "<a href=phone_notes.php?manufacturer=" . urlencode($manufacturer) . "&model=" . urlencode($model[0]) . ">" . urlencode($model[0]) . "</a><br>"; ![]() Lockerz Invites! |
|||
|
« Next Oldest | Next Newest »
|
| Possibly Related Threads... | |||||
| Thread: | Author | Replies: | Views: | Last Post | |
| Mysql is stupid (and drops? data) | naftakjin | 1 | 118 |
04-26-2010 06:38 PM Last Post: goughy000 |
|
| Boonex Dolphin PHP script is SCAM!!! | robertbowie | 0 | 497 |
02-05-2010 03:33 PM Last Post: robertbowie |
|
| Php Email Script not working | lc23 | 5 | 522 |
09-06-2009 11:32 PM Last Post: goughy000 |
|
| php/mysql sort help.... | syntax24 | 4 | 515 |
03-09-2009 01:03 AM Last Post: goughy000 |
|
| PHP MYSQL help please | project_syntax | 11 | 1,173 |
01-02-2009 05:02 PM Last Post: Josh Connerty |
|
| mysql update where id=$id | slangnit | 5 | 696 |
10-21-2008 01:46 AM Last Post: slangnit |
|







