hosted by liquidweb


Go Back   Web Hosting Talk : Web Hosting Main Forums : Programming Discussion : PHP scripts
Reply

Programming Discussion Discussions related to web programming languages and other related issues. Topics may include configuration, optimization, practical usage and database connectivity.
Forum Jump

PHP scripts

Reply Post New Thread In Programming Discussion Subscription
 
Send news tip View All Posts Thread Tools Search this Thread Display Modes
  #1  
Old 11-06-2000, 03:13 PM
Totalise-Matt Totalise-Matt is offline
New Member
 
Join Date: Nov 2000
Posts: 4
Apologies for what may be a fairly basic question, I'm quite new to all this!

I am trying to capture web content from other sites onto mine using PHP script. When I upload the page to my host, the grab doesn't seem to work. Does your host specifically need to support these kind of scripts in order to work or should it work with any host that is able to upload HTML sucessfully.

Also, does PHP script sit in the HTML code of the page you are trying to design.

Many thanks for any comments,

Matt

Reply With Quote


Sponsored Links
  #2  
Old 11-06-2000, 03:39 PM
KDAWebServices KDAWebServices is offline
Web Hosting Master
 
Join Date: Aug 2000
Location: Sheffield, South Yorks
Posts: 3,286
If you would like to post your script I'm sure I can help you out. Your host shouldn't need to enable such scripts although I do believe it is possible to stop fopen() (I assume you are using fopen()? ) from opening URLs, but you can get round it by using fsockopen().

__________________
Karl Austin :: KDA Web Services Ltd.
UK Business Hosting and Managed Servers - Hosting for Business Users :: 0800 5429 764
UK Budget Web Hosting and Servers - Hosting for Home Users :: 0800 8620 349
Call us today and ask about our hosting solutions.

Reply With Quote
  #3  
Old 11-06-2000, 03:45 PM
Greg Greg is offline
Web Hosting Guru
 
Join Date: Jul 2000
Posts: 260
Quote:
Originally posted by Matt
Does your host specifically need to support these kind of scripts in order to work or should it work with any host that is able to upload HTML sucessfully.

Yes, your host must have PHP installed on their server before it will work.

Reply With Quote
Sponsored Links
  #4  
Old 11-06-2000, 04:18 PM
Totalise-Matt Totalise-Matt is offline
New Member
 
Join Date: Nov 2000
Posts: 4
Thanks for your replies, the script I am using is the following which indeed has fopen() in it:

$file=fopen("url","r");
$rf=fread($file,20000);
$grab=eregi("start(.*)end",$rf,$printing);

Thanks in advance for any help you can give. I have tried using fsockopen() but that hasn't worked.

Matt

Reply With Quote
  #5  
Old 11-06-2000, 04:23 PM
alchiba alchiba is offline
Web Hosting Master
 
Join Date: Aug 2000
Posts: 1,167
Quote:
Originally posted by Matt
Also, does PHP script sit in the HTML code of the page you are trying to design.
PHP code is embedded within your page's HTML code, but the page must have a .php or .php3 extension. (.php for PHP version 4 and .php3 for version 3 is the convention.)

Dreamweaver, FrontPage, and simliar tools tend to screw up everything when you save pages with PHP code in them. There are workarounds by surrounding the PHP code with special tags. I think there was a discussion of that here, which you could search for.

Try dropping this code into a page and see if it works:

<?
$fp = fsockopen ("www.yahoo.com", 80, &$errno, &$errstr, 30);
if (!$fp) {
echo "$errstr ($errno)<br>\n";
} else {
fputs ($fp, "GET / HTTP/1.0\r\n\r\n");
while (!feof($fp)) {
echo fgets ($fp,128);
}
fclose ($fp);
}
?>


[Edited by alchiba on 11-06-2000 at 03:35 PM]

Reply With Quote
  #6  
Old 11-06-2000, 05:12 PM
Totalise-Matt Totalise-Matt is offline
New Member
 
Join Date: Nov 2000
Posts: 4
Thanks Ed,
I tried the code but again with no success.
I think it must be my host as mentioned above which doesn't support PHP.
Matt

Reply With Quote
  #7  
Old 11-06-2000, 05:39 PM
Greg Greg is offline
Web Hosting Guru
 
Join Date: Jul 2000
Posts: 260
Who is your host? Most hosts have a list somewhere on their site of what is installed on their servers, have you checked out their site?

Reply With Quote
  #8  
Old 11-06-2000, 06:34 PM
Totalise-Matt Totalise-Matt is offline
New Member
 
Join Date: Nov 2000
Posts: 4
Greg,
The host I'm using at the moment is uk2.net which supplies lots of very cheap products and services and as such I think you do get the bare minimum when you buy (e.g. webspace). I tried to look to see if it had software that would support PHP script but because it is not specifically mentioned and there is not really a list as such and not knowing too much about the whole thing, I assume it probably hasn't.

The site does quote this however which may mean something to you...

"We are the biggest host in the world using exclusively Linux for hosting. We do no longer provide any NT hosting facilities at all."

Matt

Reply With Quote
  #9  
Old 11-06-2000, 06:59 PM
KDAWebServices KDAWebServices is offline
Web Hosting Master
 
Join Date: Aug 2000
Location: Sheffield, South Yorks
Posts: 3,286
Matt if you desperately want to use PHP to the job then drop me a line.

__________________
Karl Austin :: KDA Web Services Ltd.
UK Business Hosting and Managed Servers - Hosting for Business Users :: 0800 5429 764
UK Budget Web Hosting and Servers - Hosting for Home Users :: 0800 8620 349
Call us today and ask about our hosting solutions.

Reply With Quote
  #10  
Old 01-02-2003, 11:18 PM
Acroplex Acroplex is offline
What, me worry?
 
Join Date: Mar 2002
Location: Orlando, FL
Posts: 12,139
All this wisdom was buried for too long.

Reply With Quote
  #11  
Old 01-03-2003, 05:45 AM
Rich2k Rich2k is offline
Web Hosting Master
 
Join Date: May 2002
Location: UK
Posts: 2,994
Of course you do have permission to use the content of that web site on your own don't you

If not they may get VERY upset

Actually this is exactly the sort of thing which makes XML such a useful thing.

Just take an XML feed from moreover, for example, cache it and then transform it in PHP. I have a PHP / XML / XSLT class which can be done by including one file and then running two lines of code (of course you have to write the XSLT yourself).

Reply With Quote
  #12  
Old 01-03-2003, 05:00 PM
mistral1 mistral1 is offline
Disabled
 
Join Date: Nov 2001
Location: UK
Posts: 258
Quote:
Originally posted by Matt

The host I'm using at the moment is uk2.net which supplies lots of very cheap products and services and as such I think you do get the bare minimum when you buy (e.g. webspace).
I can't see how £50 (~$80 pa) for hosting is cheap with no frills and no PHP?

They advertise domain names for 0.01 pence then they come up with a bill for £10 for a .uk name? And if you want to transfer it elsewhere you have to pay an additional £19 transfer-out surcharge on top.

I know this isn't the right place to talk about domains and such, but I couldn't resist commenting.

Reply With Quote
  #13  
Old 01-03-2003, 06:20 PM
MDJ2000 MDJ2000 is offline
Web Hosting Master
 
Join Date: Dec 2001
Posts: 1,815
Guys, the post is over 2 years old, timechange was just being a dillweed digging it up. 2+ years ago, PHP actually wasn't as commonly installed as you may think.

Reply With Quote
Reply

Related posts from TheWhir.com
Title Type Date Posted
Softaculous Adds Reseller Control Panel with New Version of Auto-Installer Web Hosting News 2012-01-03 17:27:22
Web Host PromptSpace Launches Shared Hosting Platform Web Hosting News 2011-12-27 18:15:25
Web Host Secure Cloud Space Integrates Softaculous Auto-Installer with Control Panel Web Hosting News 2011-12-19 16:39:33
Web Host HostingZoom Adds Softaculous Auto-Installer to Hosting Plans Web Hosting News 2011-08-17 17:52:34
Web Host JaguarPC Adds Auto-Installer Softaculous to Hosting Plans Web Hosting News 2011-07-27 18:55:46


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes
Postbit Selector

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump
Login:
Log in with your username and password
Username:
Password:



Forgot Password?
Advertisement:
Web Hosting News:



 

X

Welcome to WebHostingTalk.com

Create your username to jump into the discussion!

WebHostingTalk.com is the largest, most influentual web hosting community on the Internet. Join us by filling in the form below.


(4 digit year)

Already a member?