Jump to content

Archived

This topic is now archived and is closed to further replies.

just me and php

need end of URL http://bla/SLO RIDE

Recommended Posts



Basically This Is What Im Doing To Generate The Address From The Database track.
-----------------------------------------------------------------------
Page1
-----------------------------------------------------------------------
$page_name="bla/bla/bla.php";

$f2 = $noticia[track];  // DataBase Colum

print "<center><td><a href='$page_name?track=$f2'>$f2</td>";


So Then It Generates A List Of Tracks Like This

Adios Amigos
First Time
Slo Ride
-----------------------------------------------------------------------
Then You Click On One Of The Track Names To Go To The Track Page. Heres The Link It Generates From Above Code.

http://bla/bla/bla/bla.php?track=Slo%20Ride  <-----In Address Bar

And This Send You To The Genearated Track Page From Database. And If It Work Right You Would See This.
-----------------------------------------------------------------------
Page2
-----------------------------------------------------------------------
2:00.55 500 bla Slo Ride
2:01.33 500 bla Slo Ride
2:00.55 250 bla Slo Ride
2:01.33 400 bla Slo Ride

But Im Getting All Tracks

1:02.46 600 bla Adios Amigos
1:02.46 400 bla Adios Amigos
2:00.55 250 bla Slo Ride
2:00.55 500 bla Slo Ride
2:01.33 500 bla Slo Ride
2:01.33 400 bla Slo Ride
2:30.12 250 bla First Time

So Heres My Problem I Need To Get The Very End Of URL ADDRESS Slo%20Ride WithOut The %20 And Post It In Code Below On The Track Page./Page2


$srch = 'track'; //<----This Is Good

$track = $_GET["track"]; //<---- This Is The Code That I Need Fixed So I Can Get The End URL To Post In Next Code Slo Ride as $track

$sqlSelect=("SELECT * FROM NatHotLap where ".$srch." LIKE '%".$track."%'");

I Need To Figure Out How Remove The %20 On Track Name Slo%20Ride So I Wont Get T String Error

And I Need To Figure Out How To Put ASC At The End Of Last Code Without Getting T String Error

Hope This Make Sence , Im Not That Good At PHP

Share this post


Link to post
Share on other sites
Use [url=http://www.php.net/manual/en/function.urldecode.php]urldecode()[/url] :)

Orio.

Share this post


Link to post
Share on other sites
The "%20" is the space character converted with urlencode, just use the [url=http://www.php.net/urldecode]urldecode()[/url] function to convert it back to a space character.

Ken

Share this post


Link to post
Share on other sites
Thank For The Quick Replys
I Look At urldecode() And The Diff Ways Of Using It But Cant Figutr It Out.
Can You Give Me A Few Sample Codes To Mess With.
What I Need Is


http://bla/bla/bla/bla.php?track=[color=red]Slo%20Ride[/color]  <-----In Address Bar

[color=red]Slo%20Ride[/color] As [color=red]Slo Ride[/color] and then put it in

$sqlSelect=("SELECT * FROM NatHotLap where ".$srch." LIKE '%".[color=red]Slo Ride[/color]."%'");

By Using Something Like

$track = $_GET["track"];

Thanks In Advance :)


Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.