BlameThePixel!

BTForum » Other Stuff » BlameTheHelp » Simple PHP Problem

[B]C1
Looking For Status
Send PM
Posts: 0
Threads: 0
Money: £0.18 (D)
(+ Friend)
Not online within the last half an hour
Gr..I have a really simple problem. I have a form that has different pages, and one of the form spaces, can sometimes call for data such as "Billy Bobs Data". As you can see there are spaces. When I first submit the data that would come out as http://siteaddress.com/form.php?data=billy+bobs+data
But when I click the next page, only the data before the space gets sent. Example: http://siteaddress.com/form.php?data=billy
What can I do to make it display http://siteaddress.com/form.php?ppage=2&data=billy+bobs+data,
instead of http://siteaddress.com/form.php?ppage=2&data=billy

For the pages, I use a php function that splits the pages, and then I use a normal link to display each page, with the variables at the end.

For the form at the beginning, I use a GET function.



In conclusion, I need to use REGEXP, and I still don't have a clue how to use that.
Either that, or I need to somehow, use the form over and over, but change the page #. And I can't see how I can do that either.
21.07.04 01:21
Post #1
Last edited: 21.07.04 03:07 (C1 - 3 times) [Hide Sig (2)] [Profile] [Quote]
[]joetheeskimo5
Statusless
Send PM
Posts: 791
Threads: 37
Money: £2.56 (D)
(+ Friend)
Not online within the last half an hour
When the data was sent to the next page, was it in the same format as the first page?
21.07.04 14:21
Post #2
Last edited: 21.07.04 14:21 (joetheeskimo5 - 1 times) [Hide Sig (2)] [Profile] [Quote]
[S]Zogger!
Looking For Status
Send PM
Posts: 3954
Threads: 62
Money: £93.82 (D)
(+ Friend)
Not online within the last half an hour
I don't think this is a regexp issue. I don't quite understand what you're doing... It sounds like you're splitting the url as a string, or something... Anyway, you have all the variables you need, you could do something a little like this (I recommend a function, saves repeating code)... urlencode is the key.

\n
<?PHP\n
if (!isset($_GET["ppage"])) {
    
$currpage = 1;
} else {
    
$currpage $_GET["ppage"];
}
$nextpage $currpage+1;<br />

echo 
"<a href='".$PHP_SELF."?ppage=".$nextpage;
foreach(
$_GET as $key=>$val) {<br />
    if (
$key != "ppage") {
        echo 
"&".$key."=".urlencode($val);
    }
}<
br />

echo 
"'>Next</a>";
\
n?>
\n

________________
You know I'm a dancing machine
21.07.04 16:38
Post #3
[Hide Sig (8)] [Profile] [Quote]
[B]C1
Looking For Status
Send PM
Posts: 0
Threads: 0
Money: £0.18 (D)
(+ Friend)
Not online within the last half an hour
Thanks, I finished off the rest of my code myself. Thanks for that extra push in the right direction zog.
21.07.04 17:46
Post #4
[Hide Sig (2)] [Profile] [Quote]

Post Reply

Jump To:


Your Comments:

Donate to BlameThePixel:
Donate to BTP Via PayPal


[22 Queries, Page Loaded in 0.431669 Seconds]

ShoutMeUp

Xmas Greetings from waka waka waka waka []Unvalidated EmailChristmasRiddle MERRY CHRISTMAS EVERYONE! []Spleet Except for Spleet. []TheAbdBoy Always bummin' a brother out. []Spleet Happy New Year everyone! But Spleet. []TheAbdBoy

Word Association

All

-10 Ago-

MiddleEastern []AlphaWolf camel [S]Bloopy toe []TheAbdBoy moose knuckle [S]Bloopy MeatLoaf []Spleet IdDoAnything4Lo ve []AlphaWolf rub n tug []TheAbdBoy tugboat []The Pope rope [S]Bloopy race []TheAbdBoy

-Latest-


Must be logged in to add new words

FictoLeague

You have to be logged in to vote...

Member Stats

Date: 30.05.24.
Members: 4731.
Latest: []Unvalidated Emailsdsakldsaldklasdsdsa
Active:
0 user(s)
1 guest(s)

On chat:
Lots of people

Files: 3330

Bloopy's Site
Get Firefox Get Opera Donate to BTP Via PayPal