problems with php 5.3 appear to me with wamp2.0i
Posted by: astm (---.238.107.219.tedata.net)
Date: July 22, 2009 01:18PM

hello guys

I'm php developer
today i decided to install wamp2.0i in my pc and i have windows xp sp3
when i install wamp2.0i in my pc and try to open my old work
it give me errors because my old wamp version was wamp5 1.2
but the php statement that give me the error was

<?php if($login=="false" ){?><span style="color:#FF0000">Error login</span><?php }?>

it give me this error

Notice: Undefined variable: login in C:\wamp\www\test\index.php

it made my crazy because its very very very simple statement

Options: ReplyQuote
Re: problems with php 5.3 appear to me with wamp2.0i
Posted by: yfastud (Moderator)
Date: July 22, 2009 01:27PM

you just need to disable notice report since they're not error, so through wamp tray icon, open file php.ini

Find

error_reporting = E_ALL

Replace w/

error_reporting = E_ALL & ~E_NOTICE

Then save file and restart wamp

Have fun,

FREE One A Day
FREE Photo
FREE Games
FREE Websites
FREE Portable GPS
FREE WAMP Guides

Options: ReplyQuote
Re: problems with php 5.3 appear to me with wamp2.0i
Posted by: toumimi (---.adslgp.cegetel.net)
Date: July 22, 2009 01:57PM

Are you sure that it is [$login=="false"] and not [$login==false] or better [!$login] ?
This notice appears because the variable does not exist before you do this test.
So you can test if this variable exists using isset() function...

Or, you can ignore it and disable those notices by doing what yfastud wrote.

Florian

WampServer Patch (Screenshots)
Topic EN : www.wampserver.com
Topic FR : www.wampserver.com

Options: ReplyQuote
Re: problems with php 5.3 appear to me with wamp2.0i
Posted by: astm (---.238.107.219.tedata.net)
Date: July 22, 2009 02:08PM

no mr toumimi because the variable $login in my script can have many values so i must type $login=="false"

and when i updated my php.ini file such as mr ( yfastud ) say by replace

the statement error_reporting = E_ALL

to

error_reporting = E_ALL & ~E_NOTICE

my script work good but i have other error in this code

$permission=split(",",$_SESSION[admin_session]);

it give me this error

Deprecated: Function split() is deprecated in

so i want to know if there's any updates in the file php.ini ??

Options: ReplyQuote
Re: problems with php 5.3 appear to me with wamp2.0i
Posted by: roms (Moderator)
Date: July 22, 2009 02:11PM

This message comes because you do a test on a Variable that doesn't exist (yet). Three ways to get rid of this :

1 - turn of the notices as said by yfastud. This is not the best solution to have clean code. Notices often help you avoid security problems.

2 - test that the variable exists before testing its value. For this use the isset() function as said by toumimi (if (isset($login) AND $login == FALSE).

3 - intitalise your variable by adding a $login = ''; at the beginning of your script. For this solution, it depends on how your code is built, it might change the behaviour of your code.

Romain

Options: ReplyQuote
Re: problems with php 5.3 appear to me with wamp2.0i
Posted by: roms (Moderator)
Date: July 22, 2009 02:22PM

use preg_split() instead :

[www.php.net]

Romain

Options: ReplyQuote
Re: problems with php 5.3 appear to me with wamp2.0i
Posted by: toumimi (---.adslgp.cegetel.net)
Date: July 22, 2009 02:24PM

Use explode instead preg_split..
Quote

preg_split(), which uses a Perl-compatible regular expression syntax, is often a faster alternative to split(). If you don't require the power of regular expressions, it is faster to use explode(), which doesn't incur the overhead of the regular expression engine.

Florian

WampServer Patch (Screenshots)
Topic EN : www.wampserver.com
Topic FR : www.wampserver.com

Options: ReplyQuote
Re: problems with php 5.3 appear to me with wamp2.0i
Posted by: astm (---.238.107.219.tedata.net)
Date: July 22, 2009 03:40PM

thanks mr roms and thanks mr toumimi

it's okk now
buy i have error in


<?php if($LogOut=="yes" ){session_unregister("admin_session" ); ?>

the error is
Function session_unregister() is deprecated


and i think it must be used unset() function ??

Options: ReplyQuote
Re: problems with php 5.3 appear to me with wamp2.0i
Posted by: toumimi (---.adslgp.cegetel.net)
Date: July 22, 2009 10:25PM

You're right..

<?php
if($LogOut=="yes" ) unset($_SESSION['admin_session']);
?>

Florian

WampServer Patch (Screenshots)
Topic EN : www.wampserver.com
Topic FR : www.wampserver.com

Options: ReplyQuote
Re: problems with php 5.3 appear to me with wamp2.0i
Posted by: astm (---.238.104.6.tedata.net)
Date: July 27, 2009 09:00AM

hello guys

i want to ask about the functions imagegrabscreen & imagegrabwindow

when i try to used these functions with wamp2.0i it gave me black screen

my code is

$im = imagegrabscreen();
$browser = new COM("InternetExplorer.Application" );
$handle = $browser->HWND;
$browser->Visible = true;
$browser->Navigate("[www.google.com"]; );
while ($browser->Busy) {
com_message_pump(4000);
}
$im = imagegrabwindow($handle, 0);
$browser->Quit();
imagepng($im, "iesnap.png" );


the code result was black image iesnap.png

so i want to know if there is some steps i can do in wamp2.0i to open the GD library

Options: ReplyQuote
Re: problems with php 5.3 appear to me with wamp2.0i
Posted by: Lamonte (---.dsl.stlsmo.sbcglobal.net)
Date: July 27, 2009 09:04AM

astm Wrote:
-------------------------------------------------------
> hello guys
>
> i want to ask about the functions imagegrabscreen
> & imagegrabwindow
>
> when i try to used these functions with wamp2.0i
> it gave me black screen
>
> my code is
>
> $im = imagegrabscreen();
> $browser = new COM("InternetExplorer.Application"
> );
> $handle = $browser->HWND;
> $browser->Visible = true;
> $browser->Navigate("[www.google.com"]; );
> while ($browser->Busy) {
> com_message_pump(4000);
> }
> $im = imagegrabwindow($handle, 0);
> $browser->Quit();
> imagepng($im, "iesnap.png" );
>
>
> the code result was black image iesnap.png
>
> so i want to know if there is some steps i can do
> in wamp2.0i to open the GD library

[php.oregonstate.edu]

User Contributed Notes
imagegrabscreen
andrew at local dot co dot nz
18-Apr-2008 11:02
For this to work your Apache service must be set to 'Allow service to interact with desktop' otherwise you will just get a blank image. To fix this right-click My Computer, select Manage/Services and Applications/Services - find the apache service (like Apache2) and right-click, select Properties - choose the Log on tab and check the 'Allow service to interact with desktop' checkbox. Restart Apache.

Options: ReplyQuote


Sorry, only registered users may post in this forum.