Formating query string

Ask about general coding issues or problems here.

Moderators: egami, macek, gesf

Post Reply
sigix
php-forum Active User
php-forum Active User
Posts: 364
Joined: Mon Jul 14, 2003 9:39 pm
Location: /Earth/Xion

Fri Sep 12, 2003 6:35 am

when i pass the variables through get and then get back like this from other page
header("Location : .....php?cause=$error&res=$res");
will show
http://www..........php?case=dberro&res=twor

how do i remove that query string from the address bar and address bar only shows
this url
http://www..........php
something strange will be ...

User avatar
swirlee
Moderator
Moderator
Posts: 2257
Joined: Sat Jul 05, 2003 1:18 pm
Location: A bunk in the back
Contact:

Fri Sep 12, 2003 9:12 am

sigix wrote:when i pass the variables through get and then get back like this from other page
header("Location : .....php?cause=$error&res=$res");
will show
http://www..........php?case=dberro&res=twor

how do i remove that query string from the address bar and address bar only shows
this url
http://www..........php


If your command is header("Location: .....php?cause=$error&res=$res");, then the browser is directed there, so that's what's going to be in the address bar. If you don't want something to show up in the address bar, don't put it in the header("Location: ...");.
Image

User avatar
ruturajv
php-forum Super User
php-forum Super User
Posts: 1279
Joined: Sat Mar 22, 2003 9:42 am
Location: Mumbai, India
Contact:

Sat Sep 13, 2003 12:19 am

it seems like you are using a third party url and then trying to fiddle around with it, and obviously automate it!!!

You have to use regex for you formatting the query string

sigix
php-forum Active User
php-forum Active User
Posts: 364
Joined: Mon Jul 14, 2003 9:39 pm
Location: /Earth/Xion

Sat Sep 13, 2003 2:45 am

don't want to show the query string in the address bar
I have to header("...?code=ad...")
no other option
something strange will be ...

User avatar
swirlee
Moderator
Moderator
Posts: 2257
Joined: Sat Jul 05, 2003 1:18 pm
Location: A bunk in the back
Contact:

Sat Sep 13, 2003 10:41 am

sigix wrote:don't want to show the query string in the address bar


Then you have to pass the values using some other method, e.g. cookies/sessions or form POST.
Image

sigix
php-forum Active User
php-forum Active User
Posts: 364
Joined: Mon Jul 14, 2003 9:39 pm
Location: /Earth/Xion

Tue Sep 16, 2003 2:23 am

ok I can pass values through get method
and receive through $_GET[''];
how do i pass values as post by clicking on link ....
something strange will be ...

Joel
New php-forum User
New php-forum User
Posts: 193
Joined: Sat Mar 29, 2003 11:57 pm
Location: Auckland, New Zealand
Contact:

Tue Sep 16, 2003 4:14 am

Why do you need to make sure they can't see the query string?

User avatar
swirlee
Moderator
Moderator
Posts: 2257
Joined: Sat Jul 05, 2003 1:18 pm
Location: A bunk in the back
Contact:

Tue Sep 16, 2003 8:52 am

sigix wrote:how do i pass values as post by clicking on link ....


You don't, not without some ugly JavaScript. If you need to hide the data from the user, just use sessions, since using POST doesn't effectively hide anything anyway.
Image

Oleg Butuzov
Last Samuray
Last Samuray
Posts: 824
Joined: Sun Jun 02, 2002 3:09 am

Tue Sep 16, 2003 12:08 pm

good question.
we are (RUSSIANS, UKRAINIANs) cold it ChPU (in English)

HumanUnerderstandlyUrls =) HUU

for doing is you can use
1) mod_rewrite
2) Error 404 and analisation of Reqested srting
3) ForseType
4) Multyviews

i dont have time to tell you now what and how use. might be better way to write a tutorial about this posibilites? and post here or in my blog?

Post Reply
  • Information
  • Who is online

    Users browsing this forum: No registered users and 1 guest