473,324 Members | 2,511 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,324 software developers and data experts.

php and .htaccess

hi,

i wanted to check if that certain url is active or not, and ive used
fopen, file_get_content()..however these functions didnt worked out
because allow_url_open to our webserver is set to off.

someone recommended that i can modify it or achieve the same goal
through .htaccess. is this possible? how?

Jun 12 '07 #1
3 1825
shotokan99 napisał(a):
hi,

i wanted to check if that certain url is active or not, and ive used
fopen, file_get_content()..however these functions didnt worked out
because allow_url_open to our webserver is set to off.

someone recommended that i can modify it or achieve the same goal
through .htaccess. is this possible? how?
You cannot set this value in .htaccess file.
(but you can try put your own php.ini file in your directory)

My advice - use curl library instead
http://pl2.php.net/manual/en/ref.curl.php

--
Wiktor Walc
http://phpfreelancer.net
Jun 12 '07 #2
actually that's the major problem..because my hosting co. wont allow
me or won't edit the php.ini file. the main reason is we are on a
shared server. regarding curl i did try it using this code:

$curl_handle=curl_init();
curl_setopt($curl_handle,CURLOPT_URL,'$xurl');
curl_setopt($curl_handle,CURLOPT_CONNECTTIMEOUT,2) ;
curl_setopt($curl_handle,CURLOPT_RETURNTRANSFER,1) ;
$buffer = curl_exec($curl_handle);
curl_close($curl_handle);
if (empty($buffer))
{
print "Sorry - no content.<p>";
}
else
{
echo "<h1>HERE IS CONTENT:</h1><hr$buffer";
}

still faild ;-)
is there something wrong with my code or simply it doesnt support curl
as well?
is there another workaround to attain my goal? some folks suggested i
try snoopy.

Jun 13 '07 #3
At Tue, 12 Jun 2007 19:43:59 -0700, shotokan99 let h(is|er) monkeys type:
actually that's the major problem..because my hosting co. wont allow
me or won't edit the php.ini file. the main reason is we are on a
shared server. regarding curl i did try it using this code:

$curl_handle=curl_init();
curl_setopt($curl_handle,CURLOPT_URL,'$xurl');
curl_setopt($curl_handle,CURLOPT_CONNECTTIMEOUT,2) ;
curl_setopt($curl_handle,CURLOPT_RETURNTRANSFER,1) ;
$buffer = curl_exec($curl_handle);
curl_close($curl_handle);
if (empty($buffer))
{
print "Sorry - no content.<p>";
}
else
{
echo "<h1>HERE IS CONTENT:</h1><hr$buffer";
}

still faild ;-)
is there something wrong with my code or simply it doesnt support curl
as well?
is there another workaround to attain my goal? some folks suggested i
try snoopy.
If they've disabled all kinds of stuff, don't offer cURL suppport (quite
commonly used I'd say) should you not consider switching hosts?
Don't know any details about snoopy, can't help you there I'm afraid.

Or is the failure of above code not caused by curl being unavailable?

--
Schraalhans Keukenmeester - sc*********@the.Spamtrapexample.nl
[Remove the lowercase part of Spamtrap to send me a message]

"strcmp('apples','oranges') < 0"

Jun 13 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: yawnmoth | last post by:
i'm trying to write a php script that will password protect some random directory by creating a .htaccess file, and a password file to accompany the .htaccess file, and it isn't working... ...
8
by: Joshua Beall | last post by:
Hi All, How do I disable magic quotes via .htaccess? I put the following file in my webroot, but it does not disable magic_quotes_gpc (according to phpinfo(), both the local and master value...
4
by: Ivo | last post by:
Greetings newsgroup, I am moving some php scripts to a new host. While getting to know the server, I ran into a strange problem. If I add a .htaccess file, or more specifically: a .htaccess with...
7
by: John | last post by:
Hello. I want to get this blasted .htaccess file sorted out, so I can have sessions without register_globals being on. I have looked everywhere for info on this and I mean everywhere...
0
by: Stoco | last post by:
I am trying to create a generic interface that will manage various ..htaccess protected directories. In the ideal world, the .htaccess would trigger a cgi script that would take login information...
4
by: Bill | last post by:
Does ASP have a file whose function is similar to .htaccess on Apache? I'm looking to protect subdirectory content.
0
by: Jack Hambabo | last post by:
Hi, I'm searching for a php script that can find out whether the current user (I know _SERVER will give me the name for non-cgi php) has the right to view a specific file. My dream is that I...
1
by: nickyeng | last post by:
I have checked this info from apache website, and i confused with it. Procteing System files it said: To run a really tight ship, you'll want to stop users from setting up .htaccess files...
0
by: asherwolf | last post by:
Hi, I'm trying to do something I think is pretty neat, but I've just about pulled my hair out by the behavior of my server. I'm hosting on GoDaddy, using a subdomain (www.mywebpage.com maps to...
2
by: jaanus | last post by:
Here we go... What I have been trying to do is to forward all http requests containing /cms/ to http://cms.mydomain.com/ example1: http://host1.mydomain.com/cms/init.php would be parsed from...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.