HTML Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb DesignHTML Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old March 24th, 2000, 11:05 AM
DLGilbert DLGilbert is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2000
Posts: 1 DLGilbert User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I want to be able to process parameters passed along with the url. Something like:
http://www.thispage.com/help?topic=browsing

The only ways I currently know how to process the parameters are using a custom CGI script or some server application like ColdFusion. Is there a way to access this via Javascript? Or even something simpler?

Thanks!

------------------
Dan Gilbert
dan@26thavenue.com
http://www.26thavenue.com

Reply With Quote
  #2  
Old March 27th, 2000, 01:17 PM
rycamor rycamor is offline
Gödelian monster
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Jul 1999
Location: Pembroke Pines, Florida, USA
Posts: 2,300 rycamor User rank is Sergeant Major (2000 - 5000 Reputation Level)rycamor User rank is Sergeant Major (2000 - 5000 Reputation Level)rycamor User rank is Sergeant Major (2000 - 5000 Reputation Level)rycamor User rank is Sergeant Major (2000 - 5000 Reputation Level)rycamor User rank is Sergeant Major (2000 - 5000 Reputation Level)rycamor User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 3 Days 3 h 2 m 4 sec
Reputation Power: 43
Sure, all you are doing is setting a variable and giving it a value, which can be accessed in Javascript, or in server-side scripting.

So when the browser calls this URL:
http://www.thispage.com/help?topic=browsing

The variable "topic" now has the value "browsing", which you can now proceed to use in any way you want. In Javascript inside that page you could do

document.write(topic)

and the browser would print out

browsing

Reply With Quote
  #3  
Old April 2nd, 2000, 09:45 PM
yoshi yoshi is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2000
Posts: 108 yoshi User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 9
Send a message via ICQ to yoshi
Hello..

An alternate means to process URL parameters is with XSSI - which is very browser-independent.

For more information on XSSI, WebMonkey holds a great tutorial on it at http://hotwired.lycos.com/webmonkey...html?tw=backend

Good Luck!
Josh http://www.datera.com

Reply With Quote
  #4  
Old May 31st, 2000, 08:40 PM
mfkoo mfkoo is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2000
Posts: 65 mfkoo User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 9
Hi, i am new in javascript

How about passing a javascript variable to the url??

something like...

mypage.html?name=username&id=userdi

can any one help??

Reply With Quote
  #5  
Old June 4th, 2000, 10:52 AM
fantom
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
Does anyone know if this can be done in PHP3 too?
It would help me a lot...

Reply With Quote
  #6  
Old June 4th, 2000, 11:35 PM
rycamor rycamor is offline
Gödelian monster
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Jul 1999
Location: Pembroke Pines, Florida, USA
Posts: 2,300 rycamor User rank is Sergeant Major (2000 - 5000 Reputation Level)rycamor User rank is Sergeant Major (2000 - 5000 Reputation Level)rycamor User rank is Sergeant Major (2000 - 5000 Reputation Level)rycamor User rank is Sergeant Major (2000 - 5000 Reputation Level)rycamor User rank is Sergeant Major (2000 - 5000 Reputation Level)rycamor User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 3 Days 3 h 2 m 4 sec
Reputation Power: 43
Of course it can be done in PHP. Just try it and see.

test.php3:

<?php
echo $testvariable;
?>

open http://yourserver/test.php3?testvariable=Hello+World!


Reply With Quote
  #7  
Old June 14th, 2000, 06:51 PM
Argrajoca Argrajoca is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2000
Location: SPAIN
Posts: 47 Argrajoca User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 9
mfkoo:

You can pass variables between pages using location.search

An example:

if you call a page with a javascript generated link like:

<a href="Profile.htm?Name='Peric Ofpalots';Gender='male';Age=15">View your profile</a>

Profile.htm must have this code inside the <SCRIPT> tag:

eval(location.search.substring(1));


this creates the variables Name,Gender & Age (if they were'nt defined) and puts the specified information inside them.



Reply With Quote
  #8  
Old June 14th, 2000, 09:21 PM
Spookster Spookster is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 1999
Posts: 84 Spookster User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 9
You can find a tutorial on sending objects from page to page via Javascript here:
http://www.wsabstract.com/javatutors/send1.shtml

Spookster

------------------
Visit the WSAbstract Help Forum for your Javascript, DHTML, or General Web Design Questions

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignHTML Programming > Reading URL parameters...


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway