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
Setting a PHP value in my URL
Old 09-15-2008, 04:55 PM Setting a PHP value in my URL
Novice Talker

Posts: 10
Trades: 0
Heya.

I run a PHP-driven template website. The pages get a variable from the URL and load the page according to value of that variable. For example, it will get the value "company" from the variable in the URL and will therefore display the "company.php" webpage within my index.php page.

Now, when I first go on to the website, and it loads the index.php file, how do i set that variable to "company" so that the "company.php" webpage is loaded straight away when the user first enters index.php? To begin with their is no variable in the URL.

Thanks.
ill_phil is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 09-15-2008, 07:30 PM Re: Setting a PHP value in my URL
JeremyMiller's Avatar
WT Moderator

Posts: 1,712
Name: Jeremy Miller
Location: Las Vegas, NV
Trades: 0
PHP Code:
if (!isset($_GET['current_variable_name'])) {
  
$_GET['current_variable_name'] = 'company';

__________________
Jeremy Miller

Please login or register to view this content. Registration is FREE
JeremyMiller is offline
Reply With Quote
View Public Profile Visit JeremyMiller's homepage!
 
Old 09-15-2008, 07:42 PM
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,385
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
if (!$_GET['variable']) {
// select the company template
}

[added]

moral is:

Don't get distracted in the middle of a post !
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?

Last edited by chrishirst; 09-15-2008 at 07:45 PM.. Reason: added to
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 09-16-2008, 09:24 AM Re: Setting a PHP value in my URL
Novice Talker

Posts: 10
Trades: 0
Thanks a lot. It works.
ill_phil is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Setting a PHP value in my URL
 

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