|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
new to php.. please help
I'm new to php... only started today.
i have written my main page (main.php) which has a table with 2 columns. Could someone please tell me the code to put in the 2 columns so that when you type "http://www.domain.url/main.php?left=lnav.html&right=rnav.html" into the address bar of your browser it loads lnav.html into the left column and rnav.html into the right column. thanks in advance |
|
#2
|
|||
|
|||
|
RE: new to php.. please help
instead of having leftframe="left.html" or whatever the html code is (sorry not dealt with frames in years!) have:
<? if ( empty ( $left ) && empty ( $right ) ) { $left = "DEFAULT_LEFT.html"; $right = "DEFAULT_RIGHT.html"; } echo " leftframe = "$left"n // Or whatever frame html is...heh rightframe = "$right"n "; ?> |
|
#3
|
|||
|
|||
|
RE: new to php.. please help
that dosent exactly answer my question, but thanks for your time anyway it may come in useful to me one day.
I'm not using frames cuz i hate them. This is what i have (basically) <table border="0" cellpadding="0" cellspacing="0" width="95%"> <tr><td> **Some php code to go here to tell it to load the "?left=lnav.html" part from the url** </td> <td> **Some php code to go here to tell it to load the "&right=rnav.html" part from the url** </td></tr></table> If anyone could tell me the code to put in these places it would be great, thanks. |
|
#4
|
|||
|
|||
|
RE: new to php.. please help
I beleave this is somewhat like what your looking for...
-------------------------------------- <table> <tr> <td><?php $fpoint_left = fopen("./$left","r"); $filecontent_left = fread($fpoint_left,filesize("./$left")); echo $filecontent_left; fclose($fpoint_left); ?></td> <td><?php $fpoint_right = fopen("./$right","r"); $filecontent_right = fread($fpoint_right,filesize("./$right")); echo $filecontent_right; fclose($fpoint_right); ?></td> </tr> </table> -------------------------------------- Be aware that the files for each column should not be a compleate HTML document. EG dont put any tags in the files you wouldnt put in the table yourself. like <html> or the borswer may act funny. |
|
#5
|
|||
|
|||
|
RE: new to php.. please help
ok, thanks. I'll give it a go later
I'm just setting up apache, php and mysql on our server |
|
#6
|
|||
|
|||
|
RE: new to php.. please help
Just tired it and it's ecactly what i was looking for.
Thanks again. |
|
#7
|
|||
|
|||
|
RE: new to php.. please help
With the codes above you can not included php3 pages, because the server just read the code. It's only usefull if you include html-pages. The code belowe will first include the other files in index.php3 and then executud them.
Now I'm looking for a script which load index2.php3 with one variabel page, something like this. index2.php3?frame=main.php3. In others words how can I use the var $main in combination with require? I suppose that in index2.php3 the var $main can't be set in the code, like in index.php3, otherwhise the declared var $main will be overwritten. But how do I manage that? Can somebody help? Thanks in advance index.php3 ------------------------------------- <?php $top = "index/header.php3"; $inhoud = "index/inhoud.php3"; $main = "index/1.php3"; ?> <html> <head> <title>Nieuwe pagina 1</title> </head> <body> <table border="2" width="100%" bordercolor="#000000" bordercolorlight="#000000" bordercolordark="#000000"> <tr> <td width="100%" colspan="2" height="100"> <?php require ('index/header.php3'); ?> </td> </tr> <tr> <td width="100" height="*%"> <?php require ('index/inhoud.php3'); ?> </td> <td width="*%"> <?php require ('index/1.php3'); ?> </td> </tr> </table> </body> </html> |
|
#8
|
|||||
|
|||||
|
RE: new to php.. please help
Why are you using tables? You could use real frames:
Write defaultleft.php and main.php. Now, in order to load, say, navbar2.php in the left frame and contact.php in the main frame, pass strings to your url as follows: http://yourserver.com/index.php?left=navbar2&main=contact code is untested, but should work... php Code:
Easy enough? |
|
#9
|
|||
|
|||
|
RE: new to php.. please help
Quote:
|
![]() |
| Viewing: Codewalkers Forums > PHP Related > PHP Coding > new to php.. please help |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|
|