Page 1 of 1

help w/ php

Posted: Tue Apr 22, 2003 11:48 pm
by Robpol86
i got php4, and im trying to make use of it. this may sound like a stupid question cuz i am a n00b @ php, but can sum1 point me in the right dir?

im trying to send a person to a certain section on my site.
if they type sumthing like:
http://www.site.com/file.php?rav=13
i want it 2 load my top, bottom, and left frame like normal, but the right frame i want it 2 load a certain page depending on the number after the = sign.
(yes i have frames within frames, my middle frame is a file that has the left and right frame)

Posted: Wed Apr 23, 2003 1:04 am
by Big-O Mark
http://www.php.net/ is a great resource for all things php. It's not the best site for a beginner, but if you have a good handle on php it's a very powerful tool.

Posted: Wed Apr 23, 2003 3:07 am
by Plasma2002b
last year when i was learning stuff like that, the best place i found for a n00b to look around are on sites that offer free tutorials.......


the best thing to do would to go to www.google.com and type in something like 'php tutorial'

that will get ya prettty much all ya need to know on the php language. Sites that have the 'tutorials' usually offer much more as in terms of resources and code snippets, etc...... all ya ned to get started, and often stuff to go beyond that

Posted: Wed Apr 23, 2003 9:25 am
by RansomedCaptive
just in case you havent found anything...

Code: Select all

<?
  $ravNum = $_GET["rav"];
  
  if ($ravNum == 13)
  	$frameToGet = "frame13.htm";
	
  ...
  
  //use a switch if you want
?>

<html>

<frameset rows="80,*,80" frameborder="NO" border="0" framespacing="0">
  <frame src="topFrame.htm" name="topFrame" scrolling="NO" noresize >
  <frameset rows="*" cols="414,*" framespacing="0" frameborder="NO" border="0">
    <frame src="leftFrame.htm" name="leftFrame" scrolling="NO" noresize>
    <frame src="<? echo $frameToGet; ?>" name="rightFrame">
  </frameset>
  <frame src="bottomFrame.htm" name="bottomFrame" scrolling="NO" noresize>
</frameset>
<noframes>
<body>
frames not supported
</body>
</noframes>
</html>

Posted: Wed Apr 23, 2003 12:28 pm
by insomica
wountnt this be better if he had a lot of frames so he would not have to make an if stament for every frame number

Code: Select all

<? 

  if ($rav != "") {
     $frameToGet = "$rav"; 
  } else {
	  $frameToGet = "0"; // if frame0.htm would be your base page
  }
    
?> 

<html> 

<frameset rows="80,*,80" frameborder="NO" border="0" framespacing="0"> 
  <frame src="topFrame.htm" name="topFrame" scrolling="NO" noresize > 
  <frameset rows="*" cols="414,*" framespacing="0" frameborder="NO" border="0"> 
    <frame src="leftFrame.htm" name="leftFrame" scrolling="NO" noresize> 
    <frame src="frame<? echo $frameToGet; ?>.htm" name="rightFrame"> 
  </frameset> 
  <frame src="bottomFrame.htm" name="bottomFrame" scrolling="NO" noresize> 
</frameset> 


<noframes> 
<body> 
frames not supported 
</body> 
</noframes> 
</html>

Posted: Wed Apr 23, 2003 12:53 pm
by RansomedCaptive
it all depends on how many options he has... i interpretted it as different values would be acceptted, each associated with a unique page--allows infinite options; versus your interpretation of if there is a value of any sorts, display the different content--allows only 2 options.

but you do indirectly bring up a good point with your else statement--a default should be established given the situation no value is provided or for if the value submitted is not recognized.

----

edit: i did want to mention that i absolutely love php

Posted: Wed Apr 23, 2003 5:30 pm
by Robpol86
woah thnx. i cant belive how stupid i am! i know alot bout html but didnt know i can have a top, bottom and a left/right frame all in one html document (or php). this makes it alot simplet to comprehend for me. im going to merge wat ransomed and insomiac told me w/ that else statement

Posted: Wed Apr 23, 2003 6:17 pm
by Robpol86
is there any way in php that i can use the xhtml doctype thing? i want 2 use php on a xhtml frameset and would like to have a doctype header

Posted: Fri Jul 18, 2003 9:44 pm
by Robpol86
ok i have another question.
my provider is running PHP 4.0.0
getenv("HTTP_REFERER"); isnt working for some reason. is there any alternates that will work with this version of php?

Posted: Fri Jul 18, 2003 11:17 pm
by insomica
try this

Code: Select all

$REFERER = getenv ("HTTP_REFERER");

Posted: Fri Jul 18, 2003 11:38 pm
by Robpol86
thats basically what i tried but i tried it anyways
it didnt echo out anything

this is confusing to me, this should b able to work, it worked w/ 4.3.x, i dont think it was added after 4.0.0?
if it helps out

http://www.robpol86.com/php_nfo.php

Posted: Sat Jul 19, 2003 12:02 am
by insomica
try putting it in the <head> tags.


There is a REFERER becuase if you click on the link it has REFERER as this site.