User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the PHP section within the Web Development category of DaniWeb, a massive community of 391,588 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,643 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our PHP advertiser: Lunarpages PHP Web Hosting
Views: 8918 | Replies: 2 | Solved
Reply
Join Date: Sep 2004
Posts: 24
Reputation: chunguy is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 0
chunguy's Avatar
chunguy chunguy is offline Offline
Newbie Poster

how to change the value of a URL argument?

  #1  
Nov 9th, 2004
hi anybody out there, i need help, how do i change the value of a URL argument?
Example:
URL: http://localhost/main.php?name='abc'&age='24'

how do i change the value of argument "name" and resend the information back to main.php without changing the age value.
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Oct 2004
Location: France / Paris
Posts: 14
Reputation: fpepito is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 1
fpepito fpepito is offline Offline
Newbie Poster

Re: how to change the value of a URL argument?

  #2  
Nov 9th, 2004
Hi chunguy,

Try this code:

http://www.fpepito.org/php/test4.php
http://www.fpepito.org/php/test4.txt

I hope that help to resolve,

fpepito

##### main.php
[PHP]
<?

if (isset($name)) {
echo "You have enter with the name: <B>$name</B><BR><BR>\n";
}

if (isset($name) && ! isset($ok)) {
$name = "new_name";
}

if (isset($name)) {
echo "welcome <B>$name</B><BR>\n";
echo "<A HREF=$PHP_SELF?name=$name&age=$age&ok=1>Reload this page</A><BR>\n";
} else {
echo "<FORM ACTION=$PHP_SELF>\n";
echo "Name : <INPUT TYPE=TEXT NAME=name><BR>\n";
echo "Age : <INPUT TYPE=TEXT NAME=age><BR>\n";
echo "<INPUT TYPE=submit value=\"Identify\">\n";
echo "</FORM>\n";
}

?>
[/PHP]
Reply With Quote  
Join Date: Sep 2004
Posts: 24
Reputation: chunguy is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 0
chunguy's Avatar
chunguy chunguy is offline Offline
Newbie Poster

Re: how to change the value of a URL argument?

  #3  
Nov 23rd, 2004
thanks. alternatively, i've found that you can actually the function ereg_replace().
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb PHP Marketplace
Thread Tools Display Modes

Similar Threads
Other Threads in the PHP Forum

All times are GMT -4. The time now is 11:01 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC