help w/ php

Hardware, Software, Internet, etc.

Moderators: Big-O Ryan, Big-O Mark, Matt, jester22c

Post Reply
User avatar
Robpol86
Veteran
Veteran
Posts: 475
Joined: Tue Dec 03, 2002 11:48 pm
Contact:

help w/ php

Post 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)
User avatar
Big-O Mark
Shortbus Driver
Shortbus Driver
Posts: 804
Joined: Sun Jan 20, 2002 5:20 pm
Location: Big-O Software
Contact:

Post 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.
-Mark
Big-O Software
User avatar
Plasma2002b
Extreme Groupie
Extreme Groupie
Posts: 976
Joined: Thu Jul 18, 2002 11:36 pm
Location: Riverside, Ca
Contact:

Post 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
Image

its teh infamous life of brian gaut to teh max0r!
User avatar
RansomedCaptive
Newbie
Newbie
Posts: 16
Joined: Thu Aug 08, 2002 9:02 am
Contact:

Post 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>
User avatar
insomica
Addict
Addict
Posts: 116
Joined: Sat Feb 01, 2003 6:00 am
Contact:

Post 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>
Bitwise: insomica ->Image
User avatar
RansomedCaptive
Newbie
Newbie
Posts: 16
Joined: Thu Aug 08, 2002 9:02 am
Contact:

Post 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
User avatar
Robpol86
Veteran
Veteran
Posts: 475
Joined: Tue Dec 03, 2002 11:48 pm
Contact:

Post 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
User avatar
Robpol86
Veteran
Veteran
Posts: 475
Joined: Tue Dec 03, 2002 11:48 pm
Contact:

Post 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
User avatar
Robpol86
Veteran
Veteran
Posts: 475
Joined: Tue Dec 03, 2002 11:48 pm
Contact:

Post 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?
User avatar
insomica
Addict
Addict
Posts: 116
Joined: Sat Feb 01, 2003 6:00 am
Contact:

Post by insomica »

try this

Code: Select all

$REFERER = getenv ("HTTP_REFERER");
Bitwise: insomica ->Image
User avatar
Robpol86
Veteran
Veteran
Posts: 475
Joined: Tue Dec 03, 2002 11:48 pm
Contact:

Post 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
User avatar
insomica
Addict
Addict
Posts: 116
Joined: Sat Feb 01, 2003 6:00 am
Contact:

Post 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.
Bitwise: insomica ->Image
Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 1 guest