PHP Web Host - Quality Web Hosting For All PHP Applications $35/month $250/year (Unlimited) - $25/month - 200,000 impressions - Your Ad Could be Here - Click For Details
  Login or Register
 • Home • Downloads • Your Account • Forums • 

View next topic
View previous topic


Google
 
Web RavenPHPScripts (This Site)
Post new topic   Reply to topic
Author Message
Othic
New Member
New Member


Joined: Oct 25, 2003
Posts: 19

PostPosted: Thu Nov 06, 2003 5:35 pm Reply with quote Back to top

Whats the code for iframes in php? Also is it possible to set where the iframe covers? So like it only shows one part, and you can't scroll. Thanks
View user's profile Send private message
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 16987
Location: Kansas

PostPosted: Thu Nov 06, 2003 6:21 pm Reply with quote Back to top

PHP is a server side scripting language. It performs various functions, connecting to servers, databases, networkings, and a whole lot more. But, to send any output to the browser, it must send HTML, JavaScript, CSS, etc., all browser stuff, if you will.

So, there is no "code" for iframes in PHP. iframes are just HTML tags. If you wanted to send a statement to the browser from PHP, you would do something like this
Code:
echo "Hello World";
If you wanted to create a table you would do something like this
Code:
echo "<table><tr><td>Hello World</td></tr></table>";
So, to send an iframe from PHP to your browser, you would code it first in HTML and then "wrap" it in an echo tag as in
Code:
echo "<iframe frameborder=\"0\" src=\"modules/some_module/index.php?is_admin=$is_admin&adminName=$adminName\" width=\"100%\" height=\"200\"><ilayer  src=\"modules/some_module/index.php?is_admin=$is_admin&adminName=$adminName\" width=\"100%\" height=\"200\"></ilayer></iframe>";
I am passing PHP variables in that statement. But, PHP wil translate their values BEFORE sending it to the browser. The olayer is for Netscape and is ignored by IE as Netscape ignores the iframe tag. For the syntax of the iframe tag, there are many good references on the 'net.

As to positioning, if you add the code to a block then it will appear wherever the block appears.
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
Othic
New Member
New Member


Joined: Oct 25, 2003
Posts: 19

PostPosted: Thu Nov 06, 2003 9:23 pm Reply with quote Back to top

Cool thanks for the help, but i think you mis understood the second part of my question, how you postition the area that the iframe covers, in the block.
View user's profile Send private message
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 16987
Location: Kansas

PostPosted: Thu Nov 06, 2003 9:28 pm Reply with quote Back to top

Still not sure if I understand. A block is a table. If you were designing this in a standard HTML table, however you would position it will be the same way you position it in the block. Does that answer your question?
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
Othic
New Member
New Member


Joined: Oct 25, 2003
Posts: 19

PostPosted: Thu Nov 06, 2003 9:32 pm Reply with quote Back to top

Still not there. I think I can explain this a bit better. How would you position the iframe so it only shows a certain part of the site? Like if I only wanted a bit of info in the block, and I used an iframe is there a way to position the iframe so it only shows the parts of the site I want it to?
View user's profile Send private message
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 16987
Location: Kansas

PostPosted: Thu Nov 06, 2003 9:35 pm Reply with quote Back to top

Not really. If you are trying to harvest another site then you will need to do something like a $site = file_get_contents(SITE_URL) and then parse $site for the pieces you want.


Last edited by Raven on Thu Nov 06, 2003 9:39 pm; edited 1 time in total
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
Othic
New Member
New Member


Joined: Oct 25, 2003
Posts: 19

PostPosted: Thu Nov 06, 2003 9:38 pm Reply with quote Back to top

Ok, well this isn't exactly the kind of news I wanted to hear lol, I was hoping I could keep it simple and just use an iframe, but I will try what you said. I think I know what you are talking about, I think I could use the last_referres block as a reference to see what I need to do, is that a good thing to use to help me? I am very new to phpnuke or php for that matter.
View user's profile Send private message
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 16987
Location: Kansas

PostPosted: Thu Nov 06, 2003 9:41 pm Reply with quote Back to top

No, that doesn't do what you need. Download my Stock Quotes application for a detailed use of the method I employ. Search for file_get_contents.
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
Othic
New Member
New Member


Joined: Oct 25, 2003
Posts: 19

PostPosted: Thu Nov 06, 2003 9:43 pm Reply with quote Back to top

Ok thanks for the help
View user's profile Send private message
Othic
New Member
New Member


Joined: Oct 25, 2003
Posts: 19

PostPosted: Thu Nov 06, 2003 10:09 pm Reply with quote Back to top

So would the code look something like this?

?>

Not including the stuff here that is needed

$readf = @file("urlhere")
then put the stuff here that the block is looking for

Not sure if this is correct Confused
View user's profile Send private message
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 16987
Location: Kansas

PostPosted: Thu Nov 06, 2003 10:15 pm Reply with quote Back to top

Use the file_get_contents function if you are using php v4.3 or higher.
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
Othic
New Member
New Member


Joined: Oct 25, 2003
Posts: 19

PostPosted: Thu Nov 06, 2003 10:19 pm Reply with quote Back to top

thats it? just file_get_contents and then enter what you want in the block?
View user's profile Send private message
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 16987
Location: Kansas

PostPosted: Fri Nov 07, 2003 4:52 am Reply with quote Back to top

As I said, look at my code. file_get_contents() retrieves the page. Then you need to parse it to extract the pieces you want. In essence you then build a page from the pieces. Then, there's really no need of an iframe. Just display the page, but that's up to you.
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
Othic
New Member
New Member


Joined: Oct 25, 2003
Posts: 19

PostPosted: Fri Nov 07, 2003 4:16 pm Reply with quote Back to top

Does the url of the site go in the () in file_get_contents? Whats parse, like I said I am new to phpnuke.
View user's profile Send private message
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 16987
Location: Kansas

PostPosted: Fri Nov 07, 2003 4:27 pm Reply with quote Back to top

Only registered users can see links on this board!
Get registered or login to the forums!


Please understand that while I would like to help everyone here with their questions, time and space does not allow me to do that. I would recommend that you get a good book on PHP and MySQL as those will be used together more than anything else. Use the on-line php manual at
Only registered users can see links on this board!
Get registered or login to the forums!
. You might also want to pick up a book on programming in general to become used to the terms. When you 'parse' something, you break it into components or pieces. So, if you had a line of text like
$text = 'Now is the time for all good men to come to the aid of their country.";
and you needed to find the position of the word 'good', you would parse the string $text using various string handling functions of PHP
Only registered users can see links on this board!
Get registered or login to the forums!
possibly using stripos().
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
Othic
New Member
New Member


Joined: Oct 25, 2003
Posts: 19

PostPosted: Fri Nov 07, 2003 4:31 pm Reply with quote Back to top

Yeah, I understand, and would like to thank you for all the help you have given me already.
View user's profile Send private message
Display posts from previous:       
Post new topic   Reply to topic

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Forums ©
 

All logos and trademarks in this site are property of their respective owner.
The comments are property of their posters, all the rest © 2002-2011 by Raven

You can syndicate our news using the file xml

CSE HTML Validator Helped Clean up This Page! [Valid RSS] valid RSS 2.0 Valid robots.txt Stop Spam Harvesters, Join Project Honey Pot

Website engines core code is © copyright by PHP-Nuke but has been heavily patched and modified by myself and others.
PHP-Nuke is a free software released under the GNU/GPL.


:: fisubice phpbb2 style by Daz :: PHP-Nuke theme by www.nukemods.com ::
:: fisubice Theme Modified by the RavenNuke™ Team ::

:: W3C CSS Compliance Validation :: W3C HTML 4.01 Transitional Compliance Validation ::

zerosum