Login
Search   Moderators Wanted: If you're interested please send your portfolio to info[at]itechforums.com
Welcome to the iTechForums.
If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.
To register now click here.
Latest Threads
Advertisements
Forum Statistics
Threads:
Posts: 4
Members:
Number of Users Online:
Welcome to our newest member,
Reply
 
Thread Tools Display Modes
  #1  
Old 07-11-2009, 10:03 PM
Noobtaculus Noobtaculus is offline
Junior Member
 
Join Date: Jul 2008
Posts: 8
Default

What is the PHP code to open a web page?


What is the PHP code to open a web page?

How can I get my PHP script to open a web page from a URL? In the browser obviously
Basically I want to pass an html file into a URL which goes to an engine and converts this html to a pdf. It's a bit of a backwards way for doing it but in essence I just need a new window/tab to open with a specified URL.
@StupidShep the $html is already processed into an .htm file; I just need a new window or something to open this file.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

  #2  
Old 07-11-2009, 10:03 PM
StupidShep StupidShep is offline
Junior Member
 
Join Date: Jul 2009
Posts: 4
Default

$html = file_get_contents('/path/to/html.file');

Then you can do what you want with the $html varible.

Is that what you wanted? If your server is set up correctly you can do the same with URLs:

$html = file_get_contents('http://www.google.com');
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3  
Old 07-11-2009, 10:03 PM
Zack P Zack P is offline
Junior Member
 
Join Date: Apr 2009
Posts: 2
Default

<?php

$homepage = file_get_contents('http://www.example.com/');
echo $homepage;

?>

You can also open up a new tab/window with javascript

<script type="text/javascript">

var url = 'http://www.example.com';
window.location = url;

</script>
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4  
Old 07-11-2009, 10:04 PM
John Stalvern's 2nd Life John Stalvern's 2nd Life is offline
Junior Member
 
Join Date: Jul 2009
Posts: 1
Default

PHP is server-side. No PHP code is run by the user's browser. Could you explain in more detail what you want to accomplish?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

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
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
HTML Code to open new tab in IE .. Not open new window? sirhelpabit HTML & DHTML 1 08-17-2008 03:43 AM
i cant open my router page , wanted to open a port for utorrent .. cany Mani Networking 0 06-24-2008 12:30 PM
Javascript window.open via a dynamic page URL? marky b JavaScript 0 06-20-2008 05:16 AM
i have prob to see my mail. id is open but javascript page can not open? manju r JavaScript 0 06-10-2008 03:32 AM
Cannot open Oracle database home page? coder Oracle 1 05-31-2008 03:34 AM

Your Ad Here

All times are GMT. The time now is 03:21 AM.