PHP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming LanguagesPHP Development

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 April 27th, 2000, 01:04 AM
b_raajkumar b_raajkumar is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2000
Posts: 70 b_raajkumar User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 14
HI Guys,

Straight to the problem.

I have a page which has links to over 40 pages. I would have seen sites using this kind of php programming, ie www.test.com/test.php3?name=raaj I want to know what are the functions to be used and how i use the variable $name in the test.php3 file.

Raaj

------------------
A designer with creative skills.

Reply With Quote
  #2  
Old April 27th, 2000, 01:46 AM
Shiju Rajan's Avatar
Shiju Rajan Shiju Rajan is offline
.Net Developer
Dev Shed Novice (500 - 999 posts)
 
Join Date: Feb 2000
Location: London
Posts: 987 Shiju Rajan User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 26 m 22 sec
Reputation Power: 14
Send a message via MSN to Shiju Rajan Send a message via Yahoo to Shiju Rajan
Raj,

What are you trying to do?.

<<www.test.com/test.php3?name=raaj >>

Through above link you can pass value to $name varaible and depend upon value you are passing to the test.php3,you can call some functions.

eg: test.php3

<?php3
if ($name=="raj"){
#call your function here.

}
?>




------------------
SR -
shiju.dreamcenter.net

Reply With Quote
  #3  
Old April 27th, 2000, 02:24 AM
b_raajkumar b_raajkumar is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2000
Posts: 70 b_raajkumar User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 14
OK, Let me put it straight.

I have a menu file which links to around 40 files. I have used the normal way, ie i have 40 files with the header and footer called in as include files.

But I wanted to use more of php, where i pass a value with the link in the menu file which gets the appropriate file in my template. How do i do it.

Raaj

Reply With Quote
  #4  
Old April 27th, 2000, 11:31 PM
Spyder Spyder is offline
Web Weaver
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 1999
Location: Australia
Posts: 64 Spyder User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 14
Send a message via ICQ to Spyder Send a message via AIM to Spyder
If I understand you correctly, here is what I would do to achieve what you want.

First make a the template page (I will pretend it is called template.php)

Next, make all your links point to something like this: /template.php?name=pagename

Now in your actual template.php file work out where you want the pagename file to be included and put this in:

<?
include ("$name.txt");
?>

And thats it! Just make sure that any files you want included have the same name as you put in the "?name=pagename" query string. All files should have a .txt extension (you can change that easily though)

I hope that is not too confusing...

Good Luck

Stephen.
www.nfsworld.net

Reply With Quote
  #5  
Old April 28th, 2000, 05:26 PM
cka cka is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2000
Location: Ontario, Canada
Posts: 498 cka User rank is Corporal (100 - 500 Reputation Level)cka User rank is Corporal (100 - 500 Reputation Level)cka User rank is Corporal (100 - 500 Reputation Level)cka User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 17
Well, for starts you can add
<?php_track_vars?> to the top line of your test.php3 document. This automatically sets variables based on the Query string (eg; test.php3?name=raaj sets $name to 'raaj').
Also, you might put a switch() inside the file to call different includes/functions.
eg;
<?php_track_vars?>
<?php
switch($name) {
case "raaj":
// call whatever you want for
// the name 'raaj' here
break;
... call as many case/break's as you want
}
?>

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPHP Development > Linking Porblem

Developer Shed Advertisers and Affiliates



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 | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap