April 27th, 2000, 02:04 AM
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.
A designer with creative skills.
April 27th, 2000, 02:46 AM
What are you trying to do?.
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.
#call your function here.
April 27th, 2000, 03:24 AM
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.
April 28th, 2000, 12:31 AM
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:
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...
April 28th, 2000, 06:26 PM
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.
// call whatever you want for
// the name 'raaj' here
... call as many case/break's as you want