PHP Coding
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsPHP RelatedPHP Coding

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 Codewalkers Forums Sponsor:
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  
Old June 22nd, 2002, 11:48 PM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
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

Reply With Quote
  #2  
Old June 23rd, 2002, 12:40 AM
T_B2k T_B2k is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Manchester, England
Posts: 2 T_B2k User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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
";

?>

Reply With Quote
  #3  
Old June 23rd, 2002, 03:27 PM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
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.

Reply With Quote
  #4  
Old June 23rd, 2002, 04:33 PM
Stupidnick Stupidnick is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: "i got stoned and i missed it"
Posts: 10 Stupidnick User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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.

Reply With Quote
  #5  
Old June 23rd, 2002, 04:57 PM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
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

Reply With Quote
  #6  
Old June 24th, 2002, 12:09 AM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
RE: new to php.. please help

Just tired it and it's ecactly what i was looking for.

Thanks again.

Reply With Quote
  #7  
Old August 31st, 2002, 01:47 PM
bussiebas bussiebas is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 1 bussiebas User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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>

Reply With Quote
  #8  
Old September 1st, 2002, 04:00 PM
sethadam1 sethadam1 is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Orlando, FL
Posts: 223 sethadam1 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
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:
Original - php Code
  1.  
  2. <html>
  3. <head>
  4. <title>Page Title</title>
  5. </head>
  6. <FRAMESET COLS="145,*">
  7. <FRAME name="menu" SRC="<?php
  8. if (empty($left)) {
  9. echo "defaultleft.php"; }
  10. else {
  11. $leftname = $left . ".php";
  12. if (file_exists($leftname)) {
  13. echo $leftname; } } ?>
  14. " TARGET=MAIN FRAMEBORDER=NO FRAMESPACING=0 MARGINWIDTH=0 NORESIZE>
  15. <FRAME name="main" SRC="
  16. <?php
  17. if (empty($main)) {
  18. echo "defaultmain.php"; }
  19. else {
  20. $mainname = $main . ".php";
  21. if (file_exists($mainname)) {
  22. echo $mainname; }} ?>
  23. " NAME="main" FRAMEBORDER=NO FRAMESPACING=0 MARGINWIDTH=0 NORESIZE>
  24. </FRAMESET>
  25. </html>


Easy enough?

Reply With Quote
  #9  
Old September 2nd, 2002, 01:22 AM
zombie zombie is offline
Codewalkers Intermediate (1500 - 1999 posts)
 
Join Date: Apr 2007
Location: serbia
Posts: 1,876 zombie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 3
RE: new to php.. please help

Quote:
I'm not using frames cuz i hate them. This is what i have (basically)

Reply With Quote
Reply

Viewing: Codewalkers ForumsPHP RelatedPHP Coding > new to php.. please help


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 | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway