Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Old 04-25-2009, 07:48 PM Parse URL for ref #
Jasonpv's Avatar
Super Talker

Posts: 102
Trades: 0
Hello again, I am wondering how to get a ref number from a url into a php variable. Is there a php function for this by chance?
Jasonpv is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 04-26-2009, 10:32 AM Re: Parse URL for ref #
moatist's Avatar
Skilled Talker

Posts: 64
Trades: 0
Could you post an example?
__________________
Think in code; Dream in digital.

<?php if($helpfull == true){ $talkupation++; } ?>
moatist is offline
Reply With Quote
View Public Profile
 
Old 04-26-2009, 03:04 PM Re: Parse URL for ref #
rogem002's Avatar
PHP Chap

Posts: 843
Name: Mike
Location: United Kingdom
Trades: 0
If your URL looks like:
file.php?ref=090865

Just use:
PHP Code:
echo $_GET['ref']; 
this will echo the variable in the URL called 'ref'
__________________
My Blog/Site:
Please login or register to view this content. Registration is FREE
rogem002 is offline
Reply With Quote
View Public Profile Visit rogem002's homepage!
 
Old 04-26-2009, 05:43 PM Re: Parse URL for ref #
Jasonpv's Avatar
Super Talker

Posts: 102
Trades: 0
nice!!!!! Thank you!
Jasonpv is offline
Reply With Quote
View Public Profile
 
Old 04-26-2009, 05:45 PM Re: Parse URL for ref #
Jasonpv's Avatar
Super Talker

Posts: 102
Trades: 0
P.S. How popular is it to use PHP these days? It seems as though everybody is using Java, Javascript, etc. Does PHP still play a dominant role in server side code?
Jasonpv is offline
Reply With Quote
View Public Profile
 
Old 04-26-2009, 06:56 PM Re: Parse URL for ref #
NullPointer's Avatar
Will Code for Food

Posts: 2,815
Name: Matt
Location: Irvine, CA
Trades: 0
Javascript is not server side code, and the web manifestation of java is jsp, which is less popular than php. PHP is still very popular.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
NullPointer is online now
Reply With Quote
View Public Profile Visit NullPointer's homepage!
 
Old 04-26-2009, 09:11 PM Re: Parse URL for ref #
Jasonpv's Avatar
Super Talker

Posts: 102
Trades: 0
Well, glad to hear all of this learning will be of use in the future then!

BTW, is there a way to parse a string that is black space delimited in php?
Jasonpv is offline
Reply With Quote
View Public Profile
 
Old 04-26-2009, 09:12 PM Re: Parse URL for ref #
nayes84's Avatar
Extreme Talker

Latest Blog Post:
Difference between ASP And JSP
Posts: 232
Name: John
Location: Tokyo
Trades: 0
Quote:
Originally Posted by NullPointer View Post
Javascript is not server side code, and the web manifestation of java is jsp, which is less popular than php. PHP is still very popular.
completely agree. actually i believe php is going better and use area is going wider over time

Quote:
BTW, is there a way to parse a string that is black space delimited in php?
you can do that using explode function
ex:
PHP Code:
$arr=explode(" ",$str);
//where $str is the string you need to parse
//$arr is a result array contain list of the extracted elements 
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE

if(I'm("Helpful")) Add_Talkupation("nayes84");

Last edited by nayes84; 04-26-2009 at 09:15 PM..
nayes84 is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Parse URL for ref #
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.26218 seconds with 12 queries