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
Build url with multiple parametres
Old 02-19-2011, 05:57 PM Build url with multiple parametres
Experienced Talker

Posts: 32
Name: Kleidi
Trades: 0
Hello!
Since i'm new on php, I was looking around to make the url with multi-parameters like domain.com/index.php?catId=1&artId=2 , the variables means the category id and article id, and when a user arrived on a link like this, to appear the article with the respective id.
Now, i can get work only one of them using :

PHP Code:
if(isset ($_GET['catId'])) {
   echo 
'Text for respective category id';

url ex: domain.com/index.php?catId=1 or

PHP Code:
if(isset ($_GET['artId'])) {
   echo 
'Text for respective aritcle id';

url ex: domain.com/index.php?artId=2

Can you help me make them working together? Please?
Thank you!
Kleidi is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 02-19-2011, 06:07 PM Re: Build url with multiple parametres
RonnieTheDodger's Avatar
Extreme Talker

Posts: 232
Location: Central USA
Trades: 0
Isn't the Article categorized in the first place? So I would ask why you would need to know the category.

But they should work together as you have written. Both will be set, so you should be able to get them both.
__________________
Ronnie T. Dodger

[
Please login or register to view this content. Registration is FREE
] [
Please login or register to view this content. Registration is FREE
]
RonnieTheDodger is offline
Reply With Quote
View Public Profile Visit RonnieTheDodger's homepage!
 
Old 02-21-2011, 02:54 PM Re: Build url with multiple parametres
Skilled Talker

Posts: 69
Name: Greg
Location: South Carolina
Trades: 0
Quote:
Originally Posted by Kleidi View Post
Hello!
Since i'm new on php, I was looking around to make the url with multi-parameters like domain.com/index.php?catId=1&artId=2 , the variables means the category id and article id, and when a user arrived on a link like this, to appear the article with the respective id.
Now, i can get work only one of them using :

PHP Code:
if(isset ($_GET['catId'])) {
   echo 
'Text for respective category id';

url ex: domain.com/index.php?catId=1 or

PHP Code:
if(isset ($_GET['artId'])) {
   echo 
'Text for respective aritcle id';

url ex: domain.com/index.php?artId=2

Can you help me make them working together? Please?
Thank you!

you would have this....

domain.com/index.php?artId=2&catId=99 (or whatever catid it was)
scuts is offline
Reply With Quote
View Public Profile
 
Old 02-21-2011, 06:24 PM Re: Build url with multiple parametres
Physicsguy's Avatar
404 - Title not found

Posts: 920
Name: Scott Kaye
Location: Ontario
Trades: 0
Although I see this same post posted on another website, I will answer it anyways.

Well, first you'd grab each value from it's respective parameter, like so:

$article_id=$_GET['artID'];
$category_id=$_GET['catID'];

Then you perform a MySQL query to take the article from the database that has both the category ID and article ID in the URL, as specified.

I hope this is what you were looking for.
__________________
Check out my
Please login or register to view this content. Registration is FREE
or my
Please login or register to view this content. Registration is FREE
!
Physicsguy is online now
Reply With Quote
View Public Profile
 
Old 02-22-2011, 02:54 AM Re: Build url with multiple parametres
RonnieTheDodger's Avatar
Extreme Talker

Posts: 232
Location: Central USA
Trades: 0
Oops ... duplicated post. Weird.
__________________
Ronnie T. Dodger

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

Last edited by RonnieTheDodger; 02-22-2011 at 02:56 AM..
RonnieTheDodger is offline
Reply With Quote
View Public Profile Visit RonnieTheDodger's homepage!
 
Old 02-22-2011, 02:56 AM Re: Build url with multiple parametres
RonnieTheDodger's Avatar
Extreme Talker

Posts: 232
Location: Central USA
Trades: 0
Quote:
Originally Posted by Physicsguy View Post
Although I see this same post posted on another website, I will answer it anyways.
And ain't that Donkey Kong game great!

All of the posts on that blog are coming from threads she has started here at TycoonTalk. All of them. And they are a constant barrage of problems, of which, people take time to figure out for her but she fails to respond to most of them.
__________________
Ronnie T. Dodger

[
Please login or register to view this content. Registration is FREE
] [
Please login or register to view this content. Registration is FREE
]
RonnieTheDodger is offline
Reply With Quote
View Public Profile Visit RonnieTheDodger's homepage!
 
Reply     « Reply to Build url with multiple parametres
 

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.24237 seconds with 12 queries