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

No PHP Error. Just "Page Cannot be displayed"

I was wondering if someone could explain why I'm receiving this error. It's
like a 404 error but I think it might be something else.

Basically, I have a page where a user inputs his email address. The system
is supposed to look up the email address and send the associated password to
that email address. It worked up until a few months ago. Note that the
validation works. So, if the user tries to submit a blank text box, it
returns an error. If the email address is not found, it returns an error
"Email not found." But if the email is valid, it just dies. This code
worked a few months ago when I initially wrote it.

Thanks for any help.

<html>
<head>
<title>Rateagame.net: Forgot Password</title>
<link rel=stylesheet type=text/css href=/rateagame.css>
</head>
<body bgcolor="#000000" topmargin="0" leftmargin="0" marginheight="0"
marginwidth="0">
<p align="center">
<?

virtual("includes/header.inc");

$email=$_POST['strEmail'];

if ($email != "") {

$dbh = mysql_pconnect("*","*","*");

mysql_select_db("mja674s",$dbh);

$query="SELECT UserName, UserPassword, UserEmail FROM Users Where UserEmail
= '$email'";

$result=mysql_query($query);

$returned=mysql_num_rows($result);

if ($returned>0) {

while($row=mysql_fetch_array($result)) {
$data=$row["UserPassword"];
$td = mcrypt_module_open (MCRYPT_TripleDES, "",
MCRYPT_MODE_ECB,"");
$iv = mcrypt_create_iv (mcrypt_enc_get_iv_size ($td), MCRYPT_RAND);
$dectext = trim(mcrypt_ecb
(MCRYPT_TripleDES,(Keysize),hex2bin($data), MCRYPT_DECRYPT,$iv));

$user_name = $row["UserName"];

$message = "Hello $user_name!\n\nYour password is:
$dectext\n\nRegards,\n\nThe Rateagame.net Team\nw********@rateagame.net";
mail($row["UserEmail"], "Your Rateagame.net Password", $message, "From:
we*******@rateagame.net");

$output_message = FormatText("Your password was sent to $email");
echo $output_message;
}

} else {

$output_message = FormatText("Email Not Found");
echo $output_message;

}
} else {

$output_message = FormatText("Email is Blank");
echo $output_message;

}

function hex2bin($data) {
$len = strlen($data);
return pack("H" . $len, $data);
}

function FormatText($text) {
$output_text = "<p align='center'><b><font face='Trebuchet MS' size='2'
color='#6A6AFF'>$text</font></b></p>";
return $output_text;
}

?>
</body>
</html>
Jul 17 '05 #1
6 2501
Matt <aw***********@aol.com> wrote:
I was wondering if someone could explain why I'm receiving this error. It's
like a 404 error but I think it might be something else.


[without taking a look at the provided PHP code]
Are you using IE? The IE might be showing it's own "friendly" error
page. Turn this feature of or use any other browser to find out what is
really being sent to the client...

--

Daniel Tryba

Jul 17 '05 #2
I had that turned off, yes, but still received the "page cannot be
displayed" error.

Matt
"Daniel Tryba" <ne****************@canopus.nl> wrote in message
news:c6**********@news.tue.nl...
Matt <aw***********@aol.com> wrote:
I was wondering if someone could explain why I'm receiving this error. It's like a 404 error but I think it might be something else.


[without taking a look at the provided PHP code]
Are you using IE? The IE might be showing it's own "friendly" error
page. Turn this feature of or use any other browser to find out what is
really being sent to the client...

--

Daniel Tryba

Jul 17 '05 #3
"Matt" <aw***********@aol.com> wrote in message news:<1uvkc.3954$I%1.352887@attbi_s51>...
I was wondering if someone could explain why I'm receiving this error. It's
like a 404 error but I think it might be something else.

Basically, I have a page where a user inputs his email address. The system
is supposed to look up the email address and send the associated password to
that email address. It worked up until a few months ago. Note that the
validation works. So, if the user tries to submit a blank text box, it
returns an error. If the email address is not found, it returns an error
"Email not found." But if the email is valid, it just dies. This code
worked a few months ago when I initially wrote it.

Thanks for any help.

<html>
<head>
<title>Rateagame.net: Forgot Password</title>
<link rel=stylesheet type=text/css href=/rateagame.css>
</head>
<body bgcolor="#000000" topmargin="0" leftmargin="0" marginheight="0"
marginwidth="0">
<p align="center">
<?

virtual("includes/header.inc");
[snip]

Your problems might be here, since the virtual() command does an
Apache-level inclusion of a file that might itself be configured. Try
doing this and see if you still get the error:

@virtual("includes/header.inc"); // Use "@" to suppress the warning

see http://www.php.net/manual/en/function.virtual.php

Otherwise I am not sure what could be causing your problem as the rest
of your code seems valid. Shutting off "friendly errors" in your
browser will give you a clearer idea from the server end what might
actually be going on.

Phil


$email=$_POST['strEmail'];

if ($email != "") {

$dbh = mysql_pconnect("*","*","*");

mysql_select_db("mja674s",$dbh);

$query="SELECT UserName, UserPassword, UserEmail FROM Users Where UserEmail
= '$email'";

$result=mysql_query($query);

$returned=mysql_num_rows($result);

if ($returned>0) {

while($row=mysql_fetch_array($result)) {
$data=$row["UserPassword"];
$td = mcrypt_module_open (MCRYPT_TripleDES, "",
MCRYPT_MODE_ECB,"");
$iv = mcrypt_create_iv (mcrypt_enc_get_iv_size ($td), MCRYPT_RAND);
$dectext = trim(mcrypt_ecb
(MCRYPT_TripleDES,(Keysize),hex2bin($data), MCRYPT_DECRYPT,$iv));

$user_name = $row["UserName"];

$message = "Hello $user_name!\n\nYour password is:
$dectext\n\nRegards,\n\nThe Rateagame.net Team\nw********@rateagame.net";
mail($row["UserEmail"], "Your Rateagame.net Password", $message, "From:
we*******@rateagame.net");

$output_message = FormatText("Your password was sent to $email");
echo $output_message;
}

} else {

$output_message = FormatText("Email Not Found");
echo $output_message;

}
} else {

$output_message = FormatText("Email is Blank");
echo $output_message;

}

function hex2bin($data) {
$len = strlen($data);
return pack("H" . $len, $data);
}

function FormatText($text) {
$output_text = "<p align='center'><b><font face='Trebuchet MS' size='2'
color='#6A6AFF'>$text</font></b></p>";
return $output_text;
}

?>
</body>
</html>

Jul 17 '05 #4
hmm... That didn't see to help, unfortunately.

I did notice that if I type in the page manually, without any post data
being sent, it says "email is blank," which it is supposed to do.

However, it also gives me this error:

Notice: Undefined index: strEmail in /home/mja674s/www/sendpassword.php4 on
line 0

Matt
"Phil Powell" <so*****@erols.com> wrote in message
news:1c**************************@posting.google.c om...
"Matt" <aw***********@aol.com> wrote in message

news:<1uvkc.3954$I%1.352887@attbi_s51>...
I was wondering if someone could explain why I'm receiving this error. It's like a 404 error but I think it might be something else.

Basically, I have a page where a user inputs his email address. The system is supposed to look up the email address and send the associated password to that email address. It worked up until a few months ago. Note that the
validation works. So, if the user tries to submit a blank text box, it
returns an error. If the email address is not found, it returns an error "Email not found." But if the email is valid, it just dies. This code
worked a few months ago when I initially wrote it.

Thanks for any help.

<html>
<head>
<title>Rateagame.net: Forgot Password</title>
<link rel=stylesheet type=text/css href=/rateagame.css>
</head>
<body bgcolor="#000000" topmargin="0" leftmargin="0" marginheight="0"
marginwidth="0">
<p align="center">
<?

virtual("includes/header.inc");


[snip]

Your problems might be here, since the virtual() command does an
Apache-level inclusion of a file that might itself be configured. Try
doing this and see if you still get the error:

@virtual("includes/header.inc"); // Use "@" to suppress the warning

see http://www.php.net/manual/en/function.virtual.php

Otherwise I am not sure what could be causing your problem as the rest
of your code seems valid. Shutting off "friendly errors" in your
browser will give you a clearer idea from the server end what might
actually be going on.

Phil


$email=$_POST['strEmail'];

if ($email != "") {

$dbh = mysql_pconnect("*","*","*");

mysql_select_db("mja674s",$dbh);

$query="SELECT UserName, UserPassword, UserEmail FROM Users Where UserEmail = '$email'";

$result=mysql_query($query);

$returned=mysql_num_rows($result);

if ($returned>0) {

while($row=mysql_fetch_array($result)) {
$data=$row["UserPassword"];
$td = mcrypt_module_open (MCRYPT_TripleDES, "",
MCRYPT_MODE_ECB,"");
$iv = mcrypt_create_iv (mcrypt_enc_get_iv_size ($td), MCRYPT_RAND); $dectext = trim(mcrypt_ecb
(MCRYPT_TripleDES,(Keysize),hex2bin($data), MCRYPT_DECRYPT,$iv));

$user_name = $row["UserName"];

$message = "Hello $user_name!\n\nYour password is:
$dectext\n\nRegards,\n\nThe Rateagame.net Team\nw********@rateagame.net"; mail($row["UserEmail"], "Your Rateagame.net Password", $message, "From: we*******@rateagame.net");

$output_message = FormatText("Your password was sent to $email");
echo $output_message;
}

} else {

$output_message = FormatText("Email Not Found");
echo $output_message;

}
} else {

$output_message = FormatText("Email is Blank");
echo $output_message;

}

function hex2bin($data) {
$len = strlen($data);
return pack("H" . $len, $data);
}

function FormatText($text) {
$output_text = "<p align='center'><b><font face='Trebuchet MS' size='2' color='#6A6AFF'>$text</font></b></p>";
return $output_text;
}

?>
</body>
</html>

Jul 17 '05 #5

"Matt" <aw***********@aol.com> wrote in message
news:1uvkc.3954$I%1.352887@attbi_s51...
I was wondering if someone could explain why I'm receiving this error. It's like a 404 error but I think it might be something else.

Basically, I have a page where a user inputs his email address. The system is supposed to look up the email address and send the associated password to that email address. It worked up until a few months ago. Note that the
validation works. So, if the user tries to submit a blank text box, it
returns an error. If the email address is not found, it returns an error
"Email not found." But if the email is valid, it just dies. This code
worked a few months ago when I initially wrote it.

Thanks for any help.

<snip>

1) Your page might be getting redirected in the virtual() to somewhere that
doesn't exist - do you have to use it? Is require() or include() appropriate
for you?

2) Replace the page with a simple "print 'Hi.';" to see if the page is being
reached at all (negates code as a problem). If it is, have you tried
error_reporting(E_ALL) and seeing if you get anything else?

Garp
Jul 17 '05 #6
> 1) Your page might be getting redirected in the virtual() to somewhere
that
doesn't exist - do you have to use it? Is require() or include() appropriate for you?


Well, the error was in fact due to the virtual(). The file it includes does
exist, but it was somehow tripping an error related to the decryption of my
password and causing the 'cannot be displayed' error. I checked for spaces
at ends of lines and deleted any blank lines I had as I've read that these
can mess up the header info.

Anyway, I just commented the virtual() line for now and manually copied in
the stuff it was supposed to include (it was just a simple menu bar that I
wanted displayed on all my pages).

At least it works now. But I'm still curious how the virtual() part and the
decryption interact to create an error.

~Matt
Jul 17 '05 #7

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

Similar topics

0
by: Chun | last post by:
Dear All I am now facing a problem when i try to pass a custom datatable datatype value to a remote server. In the remote server, a method with System.Data.DataTable as input parameter is...
2
by: Florian G. Pflug | last post by:
Hi Since sometime yesterday, my postgresql (7.4.5) reports "ERROR: cannot compare arrays of different element types", when I analyze a specific table in my database. Here is the tables...
0
by: mvdkwong | last post by:
I am trying to run a macro that will export a table into a fixed length file (see below). However, when I run it, I get the following error: "Cannot update. Database or object is read-only." I've...
3
by: ton | last post by:
Hi, I've developed some webcontrols in VB, I'm using these in a website project If the webcontrol is getting an error I ll get the message: Server error in '/' application, and than more...
0
by: ionpopescu | last post by:
Hello, I have a vs.net 05 c# application in which I am using an axWebBrowser control to display Visio diagrams (*.vsd). (If the free Visio Viewer provided by Microsoft is installed on a...
2
by: spam1 | last post by:
Hi all, I'm not new to ASP.NET but I'm trying to get a simple Hello World page going on IIS 6.0 on Windows 2003. I'm connecting from the local machine. It comes back with the standard "The...
7
by: DC | last post by:
Hi, there is a 500;13 page one can configure in the website properties, but ..Net Framework 1.1 also delivers the "server too busy" message sometimes and the IIS custom error page does not seem...
14
by: sarabonn | last post by:
hallo Iam trying to insert a row into a access database using visual c# and iam getting an error " cannot open the action query". here is my code private void button1_Click(object sender,...
15
denny1824
by: denny1824 | last post by:
I have a working website. I copied all the files to a new folder in inetpub/wwwroot and then set that folder as a Virtual Directory in IIS. I try going to that site from the new folder and i am...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.