Jump to content


Photo

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


  • Please log in to reply
3 replies to this topic

#1 just me and php

just me and php
  • Members
  • PipPipPip
  • Advanced Member
  • 59 posts

Posted 19 October 2006 - 05:31 PM



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/b...track=Slo RideĀ  <-----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



#2 Orio

Orio
  • Staff Alumni
  • Advanced Member
  • 2,491 posts

Posted 19 October 2006 - 05:36 PM

Use urldecode() :)

Orio.
Think you're smarty?

(Gone until 20 to November)

#3 kenrbnsn

kenrbnsn
  • Staff Alumni
  • Advanced Member
  • 8,235 posts
  • LocationHillsborough, NJ, USA

Posted 19 October 2006 - 05:37 PM

The "%20" is the space character converted with urlencode, just use the urldecode() function to convert it back to a space character.

Ken

#4 just me and php

just me and php
  • Members
  • PipPipPip
  • Advanced Member
  • 59 posts

Posted 19 October 2006 - 06:52 PM

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=Slo%20Ride  <-----In Address Bar

Slo%20Ride As Slo Ride and then put it in

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

By Using Something Like

$track = $_GET["track"];

Thanks In Advance :)







0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users