|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#16
|
|||
|
|||
|
here's a quick intro to using include()'s.
http://www.devshed.com/Server_Side/...01_1/page5.html that series of articles is a good intro to php in general, too. it's what got me started. |
|
#17
|
|||
|
|||
|
ok that makes since
so if i have 2 link boxes and lets say i have 1 link in each box box 1 link to gods page box 2 link to devshed how would i do this to have each link open in the main table???? |
|
#18
|
|||
|
|||
|
example:
directory listing: index.php god.php other_guy.php cannon_fodder.php camper.php you index.php file contains a list of links: index.php?person=god index.php?person=other_guy index.php?person=cannon_fodder index.php?person=camper then, in the middle table you have: <? if ( $person ) { include( $person . ".php" ); } else { ?> <p>Please pick a person</p> <? } ?> |
|
#19
|
|||
|
|||
|
ok but it is my links.php
that will have the links and i am including that into the index.php |
|
#20
|
|||
|
|||
|
that works. just make sure that the path in your include is from the location of your links.php file and not the location of your index.php file, assuming they're in different directories. if it's the same directory, then it's taken care of.
|
|
#21
|
|||
|
|||
|
ok well i typed this
into my middle table "<?include();?>" in my new.php and then i included my links.php in a box on the left "<a href="<?=$PHP_SELF?>?person=SRT.God">SRT.God</a> " but i get a parse error on my new.php on line 90 line 90=<?include();?> what can i do to fix? or what am i doing wrong??? |
|
#22
|
|||
|
|||
|
instead of <?include();?> you need <?include( $person . ".php" );?>
play with the format of the include so that the value you put in $person is the location of the file you want to include. |
|
#23
|
|||
|
|||
|
how can i change that
what if i want to generalise it so i can just copy/paste everywhers like instead of $person type $page or $link??? now how would my URL tags look like??? or do i keep them the same? |
|
#24
|
|||
|
|||
|
hmm i change the include to
"<?include( $link . ".php" );?> " from "<?include( $person . ".php" );?> " and my link says this "<a href="<?=$PHP_SELF?>?link=SRT.God">SRT.God</a>" but i am still getting this parse error on line 90 which is the "<?include( $person . ".php" );?> " |
|
#25
|
|||
|
|||
|
try:
<?include ( $HTTP_GET_VARS["person"] . ".php" ) ?> |
|
#26
|
|||
|
|||
|
www.decodethis.com/new.php
is the file i am going to make my index.php when i'm done and www.decodethis.com/includes/ is the dir where my links.php is maybe you can tell what i'm doing wrong |
|
#27
|
|||
|
|||
|
you pass variables through you link with http://some_page.html?variable_name...ariable_value_3
then you access those values in your php script as $variable_name_1, $variable_name_2, etc... or, since it looks like register_globals might be disabled, you get at the variables through the $HTTP_GET_VARS[] array. so: $HTTP_GET_VARS["variable_name_1"], etc. you can put anything you want in your query string, although there is a total limit to the length of the url (it's pretty big). just be sure that whatever you put in there is url encoded (+ instead of a space, stuff like that). you can use the urlencode() function to encode a string into a url, and urlunencode() to get it back. |
|
#28
|
|||
|
|||
|
you just completly lost me
well my link opens a new window now but it still gives me an error now |
|
#29
|
|||
|
|||
|
can you put your php file up as a text file? that way i could look at your code.
|
|
#30
|
|||
|
|||
|
i cant figure out how to get my links to open properly
since they are in a different dir i tried /srt/god.html but that is still giving me the error |
![]() |
| Viewing: Dev Shed Forums > Other > Beginner Programming > including pages without SSI |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|