URL rewriting

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
xiaofei
Forum Newbie
Posts: 4
Joined: Tue Jul 24, 2007 11:22 am

URL rewriting

Post by xiaofei »

hi guys, i need a some help on reWRITING my URL.

i have my <a href> linked to "http://www.abcdefg.com/abc.php?data=xyz"

but i want it to appear as "http://www.abcdefg.com/abc.php" and still be able to use $_GET['data']

any help would be great. thanks.

OH, i also have stored procedure that inserts data into a table.
and when i call it with $mysqli->query($insertQuery);
no errors come up, BUT NO data is inserted into the table.

please help.
Begby
Forum Regular
Posts: 575
Joined: Wed Dec 13, 2006 10:28 am

Post by Begby »

That is impossible. The data has to be in the URL somehow, how else is the webserver going to know what to pass your script?

I don't know the answer to question #2.
User avatar
Chalks
Forum Contributor
Posts: 447
Joined: Thu Jul 12, 2007 7:55 am
Location: Indiana

Re: URL rewriting

Post by Chalks »

Why not just use $_POST instead?

xiaofei wrote:OH, i also have stored procedure that inserts data into a table.
and when i call it with $mysqli->query($insertQuery);
no errors come up, BUT NO data is inserted into the table.

please help.
could we see the query() function and the value of $insertQuery?
xiaofei
Forum Newbie
Posts: 4
Joined: Tue Jul 24, 2007 11:22 am

Why not use POST

Post by xiaofei »

i am not using post because i am doing this through a link, and it has to be a link (a href).

the funciton is simply

create myProcedure (IN variableName varchar(100))
begin
insert into tableName (col2, col3, col4)
values (variableName, "NONE" , 0)
end

col1 is auto_increment value, and col4 is either a 0 or 1
User avatar
yacahuma
Forum Regular
Posts: 870
Joined: Sun Jul 01, 2007 7:11 am

Need more information

Post by yacahuma »

I wish I could understand what are you trying to do.

if you have a link like so
http://www.abcdefg.com/abc.php?data=xyz

just have it like that.

if not you can also have a

Code: Select all

<a href="javascript: foo(par1,par2)">link</a>

For the database problem , please post your code.
xiaofei
Forum Newbie
Posts: 4
Joined: Tue Jul 24, 2007 11:22 am

Post by xiaofei »

but i dont what the user to look at my underlying logic in the search

i will have links: A B C D .....Z
and when users click on A B or C... a list of food names will come up.

the procedure code is jsut as i've listed
User avatar
superdezign
DevNet Master
Posts: 4135
Joined: Sat Jan 20, 2007 11:06 pm

Post by superdezign »

xiaofei wrote:but i dont what the user to look at my underlying logic in the search

i will have links: A B C D .....Z
and when users click on A B or C... a list of food names will come up.

the procedure code is jsut as i've listed
That's a strange request, but your only other option is to use sessions (or cookies, but that'd be nearly useless).
Post Reply