Getting result from URL

Started by Mr. Jinx, March 12, 2004, 11:07:29 AM

Previous topic - Next topic

Mr. Jinx

I have a small script that opens an URL. The result of this URL can be "-1" or "-2" and should be checked.
This is working fine, but if for some reason the URL can't be opened, the complete error+URL will be visible.
Is there a way to prevent this? The user should never see this URL 'cause it contains a password.


$sitelink = "http://www.site.com?login=admin;password=123456";
$check = @file($sitelink);

if( $check[0] == "-1")
{
  ..code..
}
elseif($check[0] == "-2")
{
  ..code..
}


Thanks!!

Mr. Jinx

Anyone?
This only happens when I use this in SMF.
Outside SMF (separate script) it doesn't show the warning.
Is there a way to disable the notice/warning?

whiterabbit

First you can try changing the error_reporting in index.php to E_ALL^E_NOTICE,
but if it is warning you can go to Subs.php and comment out these lines
in function error_handler


// !!! Debugging!
echo '<br />
<b>', $errno % 255 == E_ERROR ? 'Error' : ($errno % 255 == E_WARNING ? 'Warning' : 'Notice'), '</b>: ', $errstr, ' in <b>', $errfile, '</b> on line <b>', $errline, '</b>';


I think that should do  ;)
One pill makes you larger, and one pill makes you small
And the ones that mother gives you, don't do anything at all

Mr. Jinx

I tried changing error reporting to "E_ALL^E_NOTICE" (and "0") but it still shows the error.
In fact, it's a WARNING.

I couldn't find the error_handler function in subs.php

ps: I'm using this function in "Register.php"

Chris Cromer

You couldn't find it in Subs.php because it's in Errors.php. :P
Chris Cromer

"I was here, here I was, was I here, sure I was" - The little voice in my head.

Mr. Jinx

Great! thanks alot, it's working 8)

whiterabbit

Quote from: René on April 19, 2004, 04:57:00 AM
I tried changing error reporting to "E_ALL^E_NOTICE" (and "0") but it still shows the error.
In fact, it's a WARNING.

I couldn't find the error_handler function in subs.php

ps: I'm using this function in "Register.php"

Oopsie!  :-[ :-[ my bad!! openned so many files at a time  :P

I'm glad that help.
One pill makes you larger, and one pill makes you small
And the ones that mother gives you, don't do anything at all

Advertisement: