[PHP] Alternative to cURL

2003-10-14 Thread Paul van Schayck
Hello everyone,

I want to send a form to a different server without user input. Auto fill a  
form ($_POST or $_GET). People will still click a link. So it could be a 
client-side sollution. cURL is the logical sollution but is there an 
alternative, client or server side.
I was thinking about FSockOpen and putting a header() inside so the 
location in the browser looks like the other domain. Would this be 
possible.

Regards,
Paul van Schayck

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: ftp_connect() issues

2003-10-10 Thread Paul van Schayck
[EMAIL PROTECTED] (Phil Ewington - 43 Plc) wrote
> A script that has been running successfully for over 18 months has
> suddenly stopped working due to ftp_connect() failing. I have been
> assured that nothing has changed on the ftp server so now need to try
> and find out why this is happening. ftp_connect seems to only return
> true or false, no specific RFC error codes :o( Can anyone suggest
> where I can start looking for a resolution to this matter?

Looking at what you have done in the past few days ;) 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: Echo $PHP_SELF not working

2003-10-10 Thread Paul van Schayck
Hello,
Here we go again ;)

[EMAIL PROTECTED] (Jeff McKeon) wrote
> I've just published a new website and something is wrong.  I suspect the
> PHP.ini on the server but I can't seem to find anything.

register_globals is on off. Which is a good idea, keep it there!


> On the dev server "ECHO $PHP_SELF" seems to work but not on the
> production one.  Any ideas what I've missed?

http://nl2.php.net/manual/en/reserved.variables.php#reserved.variables.serv
er

echo $_SERVER['PHP_SELF'];

Paul

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: Check for page change efficiently [was Re: Creating a blogrolling/link management system]

2003-10-08 Thread Paul van Schayck
[EMAIL PROTECTED] (Kevin Stone) wrote
Hello Kevin.

> This is just a thought.. I have never employed this method
> personally.. but I suppose you could read the page into a string and
> use the md5() function to generate a hexidecimal value based on that
> string.  Store the hex value in a database and compare it against the
> new value generated the next day.  If anything on the page has been
> modified the values should not match.  Even the most minute change
> should trigger a new value.  Obviously you won't know *what* has been
> modified only that the page *has* been modified 
>
> There are some pitfalls to keep in mind such as if the page contains
> dynamic content, if there is a server error, or if the page has been
> removed.  Thanks to Network Solutions evil Sitefinder you may find it
> difficult if not impossible to predict what will be read by your
> script if the page goes missing.  But this will all show up in the hex
> value and you won't know if the page is still relevant until you
> personally visit the links. 

Too much pittfals and too slow! Really the socket connection only 
retreiving the headers is really the best way. 

This function is what you need:

function fileStamp($domain, $file)
{
$file = "/" . $file;
$fp = fsockopen ($domain, 80, $errno, $errstr, 30);
$header = "HEAD $file HTTP/1.0\r\nHost: $domain\r\n\r\n";
if (!$fp){
   echo "$errstr ($errno)";
   return false;
}
fputs ($fp, $header);
while (!feof($fp)) {
   $output .= fgets ($fp,128);
}
fclose ($fp);
$begin = strpos($output, "Last-Modified: ") + 15;
if($begin==15) //no last-modified (like yahoo.com)
   return false;
$end = strpos($output, "\n", $begin);
$time = substr($output, $begin, $end-$begin-1);
return strtotime($time);
} 

Polleke

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: configuration class - skeleton code for first OOP adventure

2003-10-08 Thread Paul van Schayck
[EMAIL PROTECTED] (Anders Thoresson) wrote
>You mean that I don't need a separate function for
>setConfigurationFile, 
>but could rather include the controlling code in my constructor?

Yup.

Polleke

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: Check for page change efficiently [was Re: Creating a blogrolling/link management system]

2003-10-08 Thread Paul van Schayck
Hello,

[EMAIL PROTECTED] (Chris) wrote
> I'm not sure I understand-- I want to check to see if their page has 
> changed once each day and, if so, I will highlight that link in my
> list... I doubt most web sites would have a problem with one hit per
> day :)

Don't know much about blogs ;). I though those things were on one page 
with hunders of blogs.

> I am not scraping and redisplaying content...

Not but people don't have to view their page anymore and see their adds. 
Instead of cheking with their page, they check with your page.

> My question boils down to the most efficient method to detect whether
> a page has been modified recently...

Socket connection, look at the second comment of the filemtime() 
function:
http://php.net/manual/en/function.filemtime.php

Polleke

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: Creating a blogrolling/link management system

2003-10-08 Thread Paul van Schayck
Hello,

[EMAIL PROTECTED] (Chris) wrote
> What I am wondering is what is the best approach for detecting
> "recently changed" links? I could use various files put out by
> blogger.com or blo.gs, etc. to check sites that use those services,
> but while being much more efficient than actually checking myself,
> that would exclude many non blog sites.

First of all you need to check with the website you are going to check if 
they really enjoy all bandwith required. And people will not see their 
banners anymore.

Polleke

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: configuration class - skeleton code for first OOP adventure

2003-10-08 Thread Paul van Schayck
Hello,

[EMAIL PROTECTED] (Anders Thoresson) wrote
> Is this a good start, or should I change anything?

I'm not a OO expert but I think you could include the SetConfigurationFile
() function in your contructor. And if it fails inside the constructor exit 
to your other class controlling errors.

Polleke

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Verry strange GET behaviour

2003-10-07 Thread Paul van Schayck
Hello,

[EMAIL PROTECTED] (Brad Pauly) wrote
> Probably because you have register_globals turned off. You can use 
> $_GET['_section']. You can also turn it on.
> 
> http://us3.php.net/register_globals

Don't tell them about that option! People are forced to script safe that 
way. 

Ben, with register globals off hackers can change variables you don't want 
to be changed theirself.

Polleke

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: allowing access to php page by IP

2003-10-07 Thread Paul van Schayck
Hello,

[EMAIL PROTECTED] (Adam Williams) wrote
> I want to allow access to a php page but am not sure how I should
> verify the IP once I get it.  I want to allow 10.8.4.* and 10.8.5.* to
> access a certain webpage and keep everyone else out.  I have written
> code to figure out what someone's IP is, but am not sure about how I
> should verify whether the IP is in the range of 10.8.4.* or 10.8.5.*. 
> Any suggestions?  I was thinking of either using a regex (but I dunno
> regex so I'd have to learn it) to stip off the .* octect and then
> compare the rest of the IP and see if its either 10.8.4 or 10.8.5, or
> create a for loop and loop through 1-254 and cat it to the end of
> 10.8.4. and 10.8.5. and compare it to the IP they are coming from. 
> Any suggestions on how I should do it? 

Yes, bit basic but it should work. substr().
www.php.net/substr

$FirstPartIp = substr($ip,0,5);
if($FirstPartIp=='10.8.4' || $FirstPartIp=='10.8.5'){
echo 'We have a local IP, continue!';
}else{
echo 'Get out stupid hacker';}

Should work. An other way is exploding the IP by .
www.php.net/explode
$IpParts = explode('.',$ip);

$IpParts is now an array and you can check for the correct address.

Good luck,
Polleke

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: Sessions

2003-10-07 Thread Paul van Schayck
Hello,

[EMAIL PROTECTED] (Webmaster) wrote
> Now I am getting such lines in the address bar:
> 
> /pages/news.php?option=1015&PHPSESSID=PHPSESSID=d117dba208d4b205cd4e521
> f606b b44e#result

Do you set them manual, does the server auto start a session?

What are the settings for session in your ino file?

Polleke

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: Name server question (was:[PHP] -OT- Software Fashion)

2003-10-07 Thread Paul van Schayck
Hello,

[EMAIL PROTECTED] wrote
> helo guys , where i get a private names server , for my domain name ,
> in internet , where i registered and how much ??

What do you mean with private name servers? Most of the time everything is 
just fine if you are hosted by a companny. They will set the DNS server and 
the proper linking.

Polleke

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: Any idea how to do this?

2003-10-06 Thread Paul van Schayck
Hello,

[EMAIL PROTECTED] (Ryan A) wrote in
> So I have decided that I am going to try to make the same thing on our
> site but offer it free to the public...only problem is...I dont know
> where to start and was hopeing someone here can give me tips/urls or
> links to boost me on my way...

You know PHP? Take a look at the image functions:
http://www.php.net/manual/en/ref.image.php

You can do all sort of things with images.

Polleke

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php