Re: Help with IF ELSE

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The solution is addslashes(). This function adds a backslash before special characters in a string.

http://php.net/manual/en/function.addslashes.php

SanTa

----- Original Message ----- From: "David Stoltz" <Dstoltz@xxxxxxx>
To: <php-general@xxxxxxxxxxxxx>
Sent: Friday, December 05, 2008 1:19 PM
Subject: RE:  Help with IF ELSE


The problem turned out to be, since I'm using the MCRYPT function to encrypt the password, once in a while the encrypted password will have a bad character:

ßt¦?rDþž’Q…ß±–

For example, the above has ’

This stops the PHP processing cold when executing the query to insert that string - no errors at all - just stops processing - and I do have display_errors turned on.

So then, how does one store this type of string? I can't do a string replace....but there must be a way...

If anyone has come across this, please let me know...

Thanks!

-----Original Message-----
From: Sándor Tamás (HostWare Kft.) [mailto:sandortamas@xxxxxxxxxxx]
Sent: Friday, December 05, 2008 6:59 AM
To: php-general@xxxxxxxxxxxxx
Subject: Re:  Help with IF ELSE

You should check if php.ini has display_error off. This can prevent all
error message to be shown.

SanTa

----- Original Message ----- From: "David Stoltz" <Dstoltz@xxxxxxx>
To: "Richard Heyes" <richard@xxxxxxx>
Cc: <php-general@xxxxxxxxxxxxx>
Sent: Friday, December 05, 2008 12:42 PM
Subject: RE:  Help with IF ELSE


I turned on error reporting (ALL) as you suggested. Nothing is being
sent to the browser....still doesn't work if the recordset isn't empty.

I'm wondering, is there any other way to do a redirect in PHP?

Thanks


-----Original Message-----
From: richard.heyes@xxxxxxxxx [mailto:richard.heyes@xxxxxxxxx] On Behalf
Of Richard Heyes
Sent: Thursday, December 04, 2008 3:17 PM
To: David Stoltz
Cc: php-general@xxxxxxxxxxxxx
Subject: Re:  Help with IF ELSE

I'm new to PHP - I'm trying to figure out what is wrong with a simple
IF
ELSE block I have...if the recordset $rs is empty (login fails), the
1st
part of the block works, and redirects the user to default.php - but
if
the login works, and $rs is not empty, the 2nd "else" part does not
work, and does not redirect to menu.php - I just get  a blank white
screen on the login.php page (where this code is)....

You could try setting error_reporting() to full before you do
anything, it may help, and it's always prudent to use it that way:

<?php
   error_reporting(E_ALL);
?>

Additionally, redirects fail when you've sent output to the browser,
even if its just whitespace. Your code looks OK, but check for it. The
error reporting thang may help you with that.

--
Richard Heyes

HTML5 Graphing for FF, Chrome, Opera and Safari:
http://www.rgraph.org (Updated November 29th)

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


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




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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux