473,411 Members | 2,272 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,411 software developers and data experts.

Fopen does not work anymore, need CURL option

Hi All,


I made a little script a while ago and it worked but now my hosting provider changed some PHP settings on the server, they enabled safe mode and now i have to switch to CURL.


When I first entered "http://beurs.youfind.nl/behr/slotkoersen.php?fd=eureko.tytper" in my adressbar, the script retrieved content from "http://www.behr.nl/Beurs/Slotkoersen/slotkoersen.php?fd=eureko.tytper"

using the following code:
Expand|Select|Wrap|Line Numbers
  1. <?
  2. if($fd==""){include("/");} 
  3. else{
  4. include("http://www.behr.nl/Beurs/Slotkoersen/slotkoersen.php?fd=$fd");} 
  5. ?>
This does not work anymore and i need to use CURL

So far i have

Expand|Select|Wrap|Line Numbers
  1. $ch = curl_init();
  2.  
  3. curl_setopt ($ch, CURLOPT_URL, "http://www.behr.nl/Beurs/Slotkoersen/slotkoersen.php?fd=$fd");
  4. curl_setopt ($ch, CURLOPT_HEADER, 0);
  5.  
  6. curl_exec ($ch);
  7.  
  8. curl_close ($ch);
but this does not work, does anyone know how i can fix this problem??
I don't know much about PHP (yet)

the URL has to be dynamic


Thnx in advance
Nov 6 '07 #1
1 1756
pbmods
5,821 Expert 4TB
Heya. jochemdu. Welcome to TSDN!

You can specify the URL in curl_init():

Expand|Select|Wrap|Line Numbers
  1. $ch = curl_init("http://www.behr.nl/Beurs/Slotkoersen/slotkoersen.php?fd={$fd}");
  2.  
What do you mean by, "does not work"? Are you getting an error message?
Nov 6 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Grant | last post by:
Hi, I'm trying to use fopen to open a remote page. I found a page that doesn't work, and it's because the page requires cookies. Is there a way in PHP to pass cookies to a remote host? Here...
3
by: James | last post by:
Hi guys, I have been building a search engine here - not because I have plans of dethrowning Google but as a simple app upon which to develop a function set that I can use for other things. ...
11
by: typingcat | last post by:
Is it possible to read another web page in PHP? If is ASP.NET, the code would be ------------ WebRequest req=WebRequest.Create("http://www.microsoft.com"); WebResponse res=req.GetResponse();...
4
by: lucyachammond | last post by:
I have a 3rd party real-estate website written in php. I would like to call an asp script on a separate webserver each time a new real-estate item is added to the database on the php site. The...
14
by: Anoop | last post by:
Hi, I am new to this newsgroup and need help in the following questions. 1. I am workin' on a GUI application. Does C# provides Layout Managers the way Java does to design GUI? I know that it...
4
by: peter.hrdy | last post by:
Hi guys. i have big problem with using fopen, fsockopen or curl. if i tried to use it on remote site it doesn't works. i've readed to much posts but didn't found anything helpfulll. fopen just...
1
by: Cleverbum | last post by:
I'm trying to write a script which downloads information from a number of websites analyses it and shows some results. The problem I'm having is that some sites seem to work perfectly while others...
1
by: nothing1 | last post by:
I'm getting some warning using the code below: Error: failed to open stream: Permission denied in Code: function wwwcopy($url,$dirname){ $file = fopen($url, "r"); if (!$file) { ...
1
by: stillnight | last post by:
My web host has disabled fopen and now uses curl. I am a newbie to php so I am at a complete loss. I am trying to change the code in sendcard at sendcard.org to use curl. The beginning login will...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.