Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    PHP




Error Message


On my Apache host, localhost:8080, no error message are being displayed. If
I have an error in my PHP code, all I get is a blank screen. Do I need to
configure something in Apache or PHP.ini to turn on error messages?




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Message Was Not SentMailer Error: SMTP Error: Data Not Accepted
I am getting a problem with phpmailer, when Iam trying to send mail with phpmailer on Linux Iam getting the folowing Error:

Message was not sentMailer Error: SMTP Error: Data not accepted
This is the Code Iam using in PHP/Linux: Code:

Error Message
after upgrading to php 5.2.1, when I try to load a php file I get the folowing error message :

Server Application Error

The server has encountered an error while loading an application during the processing of your request. Please refer to the event log for more detail information. Please contact the server administrator for assistance.

Decrypting An Error Message
I'm getting the following error message on a web page:

Warning: mysql_connect(): Access denied for user:
'tgsstaff@...' (Using password: YES) in
/web/tgs.gargoyles-fans.org/htdocs/experiment.php on line 9

Here's what lines 9-11 look like:

mysql_connect($host,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
echo "Has connected to database $database
";

Above it, I have variable declarations for $host, $username, and
$password.

Any help would be appreciated so I can determine the cause of the error.

Displaying Error Message
I've got a problem. I need to display an error message when unable to find a record. Below is one section of the code I'm working on. Code:

Getimagesize ( ) Error Message Please Help!
What is with this error message?????? First part validates, second part
fails...

getimagesize (filename...) failed to open stream: No such file or directory

} elseif ($photo) {

$ext = strtolower(substr($photo, -3));

if ($ext == "peg") { $ext = "jpg"; }

if ($ext != "gif" && $ext != "jpg" && $ext != "jpeg" && $ext != "bmp" )
{

$focus = "photo";
$msg2 = "Please provide a valid gif, jpeg, or bmp photo or do not
attach one.";

} else {

$size = getimagesize($photo);

if ($size > 25000) {

$msg2 = "Photo must be smaller than 25k.";

}}}

Mysql Error Message:
If I enter this query at the sql prompt, I'll get results, but the code at the end of this yields the following error:

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in...on line 104 PHP Code:

[FAQ] Why Am I Getting The Error Message 'Headers Already Sent'?
here's my 2p worth:
===

Q. Why am I getting the error message 'Headers already sent'?

A. PHP produces this error message when you try to set a header for a web
page after you have already started sending out the content of the page.

Web content is always delivered with a few headers at the top, ending with a
blank line. For example, a web page might start like this:
HTTP/1.1 200 OK
Date: Tue, 01 Mar 2005 12:00:00 GMT
Content-Type: text/html

<html>
<body> ... etc..

Once you have started sending the content of a document, you can't add any
more headers because they won't appear at the top.

To get round this problem, use PHP's output control functions to buffer the
output before it is sent. For example, you can generate a "Content-Length"
header as follows:

<?php

ob_start(); // Turn on output buffering

// Create your web page/jpeg file/whatever here
echo "<html><body> ... ";

// Generate a "Content-Length" header
$clen = ob_get_length();
header("Content-Length: $clen");

// Now send the buffered content
ob_flush();

?>

Error Message 'Resource Id #2'
is this code correct? but i got this error message 'Resource id #2'

<?
$Connect = mysql_connect("localhost","root","");
mysql_select_db("mw");
$result=mysql_query("select count(StaffID) from LeaveApplication1 where StaffID = 'fui'") ;
echo "$result";
mysql_close();?>

Error Message Levels
My message levels are turned up too high and the one that installed php for
me is new to it. I need to have them turned down some. I get the following
message from a simple query:

Warning: mssql_pconnect() [function.mssql-pconnect]: message: Cannot open
user default database '<ID>'. Using master database instead. (severity 11)

and then it does everything correctly.

What do I tell him about how to turn the levels down so that this doesn't
show (as well as the one that there already is a session_start() ).

PHP Error Message Page
I want to ask something about error message from PHP.

Sometimes the php web page return error messages when the web page has
bugs and they sometimes show file names and locations. This make the
web site dangerous as I put the price information of my product in a
xml file.

PHP Error Message Libraries
I have a large website with alot of php and myql commands scattered through it. What I would like to be able to do is have standard messages for any of the possible given errors messages. I was wondering whether anyone out there has seen or come accross a class or library file of error codes and messages, that could be built into a global error function. So if i get a nasty PHP error or Mysql error rather than the linesof text in the website everywhere I can spit out a nidcely formatted error page.

Switch Error Message Help
I am trying to create a switch but I do not know why I am geting an
error message, can someone tell me what is wrong,

Error Message;

Warning: Unexpected character in input: '' (ASCII=92) state=1 in
/home/natuk/public_html/php/order-server.php on line 2

Parse error: parse error in
/home/natuk/public_html/php/order-server.php on line 2

my script is as follows;

<?php

switch ( $server )
{
case "celeron_special_5":
case "celeron_special_6":

$monthly_price = 89.99 AND $setup =19.99 ;
break;

case "p4_special_1":
case "p4_special_2":

$monthly_price = 99.99 AND $setup = 19.99;
break;

}
$total = $server + $monthly;
echo "your monthly cost is $monthly_price and your setup cost is
$setup. Your total cost for first month is $total ";

?>

Email Error Message
I'm getting this message trying to send mail from a form I'm
sending over the browser using the mail() function:

WARNING: RunAsUser for MSP ignored, check group ids (egid=0, want=51)

Does anyone know what this is telling me?

Misleading Error Message
Try the following to see it

<?php
class A {
}
function foo(A $a = 1) {
;
}
foo();
?>
...

Require Error Message
I am developing a site in Dreamweaver MX on a Mac running OS X 10.2.
I have a .php file, the first line of which is a require statement.
When the file loads in the browser, I get the following error
messages:

Warning: main(Connections/Connect.php): failed to open stream: No such
file or directory in /home/myHost/www/www/brochure_request.php on line
1

Fatal error: main(): Failed opening required 'Connections/Connect.php'
(include_path='.:/usr/local/lib/php') in
/home/myHost/www/www/brochure_request.php on line 1

The indicated path to the file is correct, so I don't understand why
the interpreter can't find the file.



Not Getting Proper Error Message
I have the following query/code thing.

$check = @mysql_query("SELECT id, username FROM users WHERE rank='$rank'");
if (!$result)  {
$mysql_error = mysql_error();
   exit('<p>Error performing query: ' . $mysql_error . '</p>');
When i run it it tells me theres an "error performing query:" but then does print out the mysql_error

I dont understans this cos I use this sam bit of code on other pages (except with different querys)  and if theres a problem with me query it tells me what it is.

Default Error Message
How to prevent the default error message from being  displayed ?

Http 403 Error Message
I recently downloaded a program called Dolphin.  Now I have to install the program.  When I enter "www.mysitesname.com/install/index.php", I get this error message. 

"The website declined to show this webpage
 HTTP 403 
   Most likely causes:
This website requires you to log in.
 
   What you can try:
     Go back to the previous page.
 
     More information

This error (HTTP 403 Forbidden) means that Internet Explorer was able to connect to the website, but it does not have permission to view the webpage.

For more information about HTTP errors, see Help"

NO ONE SEEMS TO E ABLE TO GIVE ME DIRECTION AS TO WHAT THE PROBLEM IS.  NOT MY HOST, OR DOLPHIN.

Passing Error Message To Template
Hi,

if (!eregi("^([-a-zA-Z0-9._]+@[-a-zA-Z0-9.]+(.[-a-zA-Z0-9]+)+)*$", $email)) {
include ("templates/header.php");
include ("templates/error.php");
include ("templates/footer.php");
exit;
}

I wanted to use the error.php over multiple errors check on a form. When the form submit to signup.php it check the email if it was invalid. If it is invalid, it will pass a error msg to the template (error.php). May I know how to I include it? And also what variable should I place on error.php template. Thanks in advance...with great appreciate.

Error Message Shows Up In HTML
I'm trying to trap failed connection attempts to my MySQL database. Here's my code:

if (mysql_connect(host, user, password)) {
// Run a query
} else {
$errmsg = "Database unavailable.";
}

Everything works fine, but what happens is that when the code fails (eg, if the mysql service is not running) I get the failed connection message on my webpage, which I DON'T want. Any ideas?

Need An Asterisk In Error Message To Be In Bold
Hi all, Just trying to make the asterisk appear
bold, but it's not happening ;-( Could anyone
please have a quick look at the code below and let
me know if it should please?

Any help appreciated.

Creating An Error Message Page?
The code below creates an error message and then displays it if needed. When the messge is displayed though, its diplayed along with all the other stuff on the screen at the time. Is there a way to blank the page first, before displaying the message. PHP Code:

No Error Message But No Data Added?
This is my script for uploading binary files and store them in mysql. It runs without error, but no file is added to the db? Anyone with a hint?

Here it goes:

Php User Error Message System
I was wondering if anyone has come across a tutorial or can give me some ideas on how to set up an effective error handling system.  I currently pass the error message through the url and get the message to display on the page.

Error Message Is Not Showing Up On Server?
i have transfered my codes into the new web server that has php ver 5.2.1

and when there is an error, there is no error message showing up.
Has anybody here knows how to enable the error message console in php.

Show Error Message On Same Page
I have Index.php which contains the HTML form with a username and password field + submit button, action: is my check.php.

Say for example the user only input's a username and miss out the password field; when he clicks the submit button. I want the same page to be refreshed with a error message appearing below the submit button saying "error, please fill all in". I can get this to display on another page. but want this to be on refereshed on the log-in page.

Session Side Error Message
My datacenter updated their php version and I am getting this error. (Its on a login page)

QuoteWarning: Unknown: Your script possibly relies on a session side-effect which existed until PHP 4.2.3. Please be advised that the session extension does not consider global variables as a source of data, unless register_globals is enabled.

You can disable this functionality and this warning by setting session.bug_compat_42 or session.bug_compat_warn to off, respectively. in Unknown on line 0 Code:

Can Mail() Return Error Message?
Hi, I have a question about the php mail() function. For example:

$to = "ajdkfasff1256853@lalala.com";
$subject = "Hello";
$message = "Hi";
$from = "yumish@yahoo.com";
$headers = 'MIME-Version: 1.0' . "";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "";
$headers .= 'From: ' . $from . "";
mail($to, $subject, $message, $headers);

In this case, the email address of the recipient is invalid. Will the sender get an error message about that invalid recipient email address?

If yes, how?

Return Error Message With Mail()?
Is there a way to get the mail() function to return an error if it fails? I'm not talking about an "if" statement where you make up a message, I mean have mail() tell you what was wrong.

I have a hard time getting a mail script to work. I have a system where I can select a bunch of users, write an email, and the program sends the emails and tells me which ones were sent (mail() returned true) and which ones failed (mail() returned false). Right now, they all return false.

Error Message - 0 Is Not A MySQL Result Index
Could anyone explain what this might mean?

Warning: 0 is not a MySQL result index

I have a simple form set up where a user types in a keyword and then a page is displayed based on the keyword. See below:

HTML page:
<html>
<head>
<title></title>
</head>
<body>
<form action="submitform.php3" method="GET">
<p><strong><font face="verdana, arial, ms sans serif" size="1">id#</font>:</strong> <input
type="text" name="keyword" size="15" maxlength="25"> <input type="submit" value="Go!"> </p>
</form>
</body>
</html>

submitform.php3 page:
<?php
mysql_connect ("localhost", "username", "password");
mysql_select_db (dbname);
$result=mysql_query("SELECT $url FROM table
WHERE keyword LIKE '%$keyword%'");
list($url)=mysql_fetch_row($result);
?>

The concept is really simple. A user types in an keyword and that page is displayed. There is a database set up with a table that has two columns. One is "keyword" and the other is "url" For example row 1 the keyword is abc, and the url is http://www.abc.com.

Problem With DOMXML Get_attribute() Error Message
Please forgive the length of this post and bear with me. I am having
trouble between two different servers and the same DOMXML code.

Basically I am trying to run a script that will:

1) load an XML file as a variable object ($xml_doc):

$xml_doc = domxml_open_file("menu.xml", DOMXML_LOAD_DONT_KEEP_BLANKS);

2) locate the first node as a variable object ($node):

$root = $xml_doc->document_element ();
$node = $root->first_child ();

3) output all node and siblings in sequence:

while ($node)
{
echo "<p>" . $node->get_attribute ("htext") . "</p>";

$node->next_sibling ();
}

Below is the XML file (very basic):

<?xml version="1.0" encoding="iso-8859-1"?>
<menu>
<opt htext="Home" />
<opt htext="News" />
<opt htext="Products &amp; Services" />
<opt htext="Find us" />
<opt htext="Faq" />
<opt htext="Contact us" />
</menu>

Now, on my test server it works without any problems and all the nodes
are output in sequence. However, when I run it on the actual server
that I will be running the site from, it give me the following results:

Home

Fatal error: Call to undefined function: get_attribute() in
/data/httpd/VirtualHosts/csp/_testing/test_menu07.php on line 51

Notice how the first node (Home) is output so I can maybe assume the
following:

- that $xml_doc and $node are instantiated ok
- $node is able on the first (while) loop to call the get_attribute
function so $node as an object has been instatiated correctly
- It enters the while loop again so $node is present but for some
reason it doesnt have the get_attribute function.

Is there anyway that I can get a little more information about $node
everytime it is put through the while loop again that might tell me why
it has lost refererence to its functions (in this instance, the
get_attribute function)?
I dont have a great deal of knowledge about servers and the IT guys at
my work dont fully understand the syntax / programming methods of
DOMXML, is there anything that we can look into (versions,
configurations etc.) that may be causing this?
Is there anything that I should be aware about with traversing an XML
tree in this manner (using the state of $node to control a while loop
while outputing an attribute)?
Is there, well, anything other that I could be looking into (problems
with whitespacing, server configurations etc)?

I understand that there may be many factors that could be at play but

PHP Installation And @sbindir@/httpd Error Message
Installing PHP 4.3.6 on a i386 platform w/ FreeBSD 4.9 O/S installed and
running apache_1.3.31

make
with ./configure --with-mysql --with-apxs=/usr/local/apache/bin/apxs
--enable-versioning ===>
.........
Configuring SAPI modules
checking for AOLserver support... no
checking for Apache 1.x module support via DSO through APXS...

Sorry, I was not able to successfully run APXS. Possible reasons:

1. Perl is not installed;
2. Apache was not compiled with DSO support (--enable-module=so);
3. 'apxs' is not in your path. Try to use --with-apxs=/path/to/apxs
The output of /usr/local/apache/bin/apxs follows
apxs:Error: @sbindir@/httpd not found or not executable
configure: error: Aborting
.........

Perl is installed
perl -v
This is perl, v5.8.2

httpd -l
Compiled-in modules:
http_core.c
........
........
mod_so.c
mod_setenvif.c
mod_ssl.cmodule

apxs is installed version ( not from source tarball)
ls -l /usr/local/apache/bin/apxs
-rwxr-xr-x 1 root wheel 24624 Jun 21 01:23 /usr/local/apache/bin/apxs*

and is executible

could not interpret the error message : @sbindir@/httpd not found or not
executable

Parse Error Message When Logging In To Site
I receive an erreo message that says the following:

Parse error: parse error, unexpected T_STRING in /www_ah/barbisluttyadventures.com/index.html on line 1

the code that I have on my index is as follows: Code:

Php Created Popup Error Message Page
I have created a system using PHP & Javascript that works OK except that I want a neat display of error messages. Error messages caught at the client are displayed in a Javascript alert, which is fine. But errors caught at the server are not as well displayed and therefore I thought that I would ask if anyone has produced a "popup error message page" that would look similar to a Javascript alert but would originate at the server.

Fatal Error: Uncaught Exception 'com_exception' With Message
I am trying to use MAPI in PHP. I have downloaded some codes from (URL address blocked: See forum rules)

I have also downloaded and registered the CDO.DLL from Microsoft website. Instead of using "$oFldr = $oNs->GetDefaultFolder(olFolderInbox);", i have changed it to "$oFldr = $oNs->GetDefaultFolder(6);" because "olFolderInbox" is not recognized outside of Outlook, 6 is the actual value of olFolderInbox.

However, when i run the script, OUTLOOK.EXE is running in the background, after that i have got the following errors:

Fatal error: Uncaught exception 'com_exception' with message '<b>Source:</b> Microsoft Office Outlook<br/><b>Description:</b> Cannot complete the operation. You are not connected.'

And my OUTLOOK.exe automatically disappeared in background (from Task Manager).

Error Message Causing Form Inputs To Clear
My problem is this: I built a simple form that connects to a sql database and inputs the information. I made it so it puts the error message at the top of the page, when the user leaves a required field blank, password is too short and so on. The problem is that it clears all the fields when it displays these error messages.

Is there a way to prevent this so it doesn't all have to be entered again. Am I just going about this the totally wrong way? I really haven't been working with php that long, about a week really, so excuse me if this is a total noob question. Code:

Script Error Message Is Referencing Wrong Line Of Code
Im developing php pages under apache and Mac OS X. When I have a
scripting error, the error page says...

....error occurred at line 139

Problem is that line 139 is blank and the bad code is really on line
142. Its usaully off by random numbers so I cant just add/subtract a
couple of numbers to guess the real line of problem code. This is a
pain and is slowing me up for trouble-shooting scripts. Any
suggestions? Is this a php.ini setting? -

Formmail.php Brings Up Error Message About Configuring "sendmail_from" Line
This may not be the best place to put this but i have set up apache as
a testing server on my local machine. Whenever i try to use a
formmail.php script i downloaded is always come sup saying that i need
to configure sendmail_from.

I have changed this (in php.ini) to be to my email address and the smtp
server is set to be my university's smtp server (which i hope should
work). But it still comes up with the error.

The actual error is:

Warning: mail() [function.mail]: "sendmail_from" not set in php.ini or
custom "From:" header missing

Mail() - Message Len
Is there a length limit to the $message parm in the mail() func ?
I am doing a customer survey, with several multiline text boxes and my php code hangs when i have a couple of long comments in there. I have tried wordwrap and chunk_split, but they didn't seem to help. Any ideas?

Message Box In Java
I want to do something like bringing up a message box in Java where after
clicking OK the box disappears and processing continues.

How do I do this in PHP?

I want the processing after the message box to be conditional upon what was
used to bring up the particular message box. (I have been handling
something like this so far by having inline messages and reposting the
page.)

Send Message
I want to send a message to a user in his yahoo messenger id and MSN Id through my php script. Actually user will provide his MSN or Yahoo Id in my web form, and after
some server operation he will receive a message in MSN or Yahoo messenger.

Mail(): $message =
unsing the mail() function, I want my message to appear somewhat like this:

Hi myFriend,
thanks for coming to my site. This is what I remember of you:
group: (a var)
os: (b var)
Regards, best wishes,
Me

How do I manage to get the line breaks, and insert the vars using
[php]
$message = "Hello myFriend.....";
[/b]

Do I remove the inverted commas whenever I put a var?(for example $group).

Warning Message
I installed MySQL4.1.11 and PHP4.3.10. When trying to connect an existing
database, it showed me the following warning message which I have no idea how to
solve it.

Warning: mysql_connect(): Client does not support authentication protocol
requested by server; consider upgrading MySQL client in
c:inetpubwwwrootprojectconnection.php on line 12
Could not connect: Client does not support authentication protocol requested by
server; consider upgrading MySQL client

Send A Message
This maybe a nice little script for some new-newbies to get amongst a bit of
php action (I am still a newish-b myself)

To follow is the PHP:

<?php

$content = '
<html>
<head>
<title>test me</title>
<script src="j/j.js" type="text/javascript"></script>
<style type="text/css"> img.iletter { display: none; } </style>
</head>'

$location = $_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'];

if(($_POST["submit"] && $_POST["txt"]) || $x) {
$content .= '<body onload="reveal('l', 1, 300);" style="margin: 0px;
padding: 50px; background-color: #000;">'
if($x) {
$letters = urldecode(base64_decode($x));
}
else {
$letters = htmlentities($_POST["txt"], ENT_QUOTES);
$code = urlencode(base64_encode($letters));
$content .= '<p style="color: white;">link is :
http://'.$location.'?x='.$code.'</p>'
}
$content .= letterer($letters).'<p style="clear: both;"><br><br><a
href="go.php" style="color: white;">try another one</a></p>'
}
else {
$content .= '
<body style="margin: 50px;">
<form method="post" action="go.php">
<textarea name="txt" cols="30" rows="10">type anything you want
here</textarea>
<br><br><input name="submit" type="submit" value="show me the money">
</form>'
}

function letterer ($letters) {
$v = '<div id="letters">'
$len = strlen($letters);
for($i = 0; $i < $len; $i++){
$let = substr($letters,$i, 1);
$let = replacer($let);
$v .= '<div class="iletter" id="divl'.($i+1).'" style="float: left";><img
src="a/'.strtolower($let).'.gif" alt="'.$let.'" class="iletter"
id="l'.($i+1).'"></div>' //
}
$v .= '</div>'
return $v;
}

$content .= '</body></html>'
echo $content;

Can't Send Message
I'm filling out forms on one page, then trying to send an
email and print out the vars on the next page.

Q1: Whenever I insert the mail script, it gives me a parse error.
Please point out my syntax errors, etc.

Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or
`T_NUM_STRING' in /mypathhere/proposalconfirm.php on line 2

--script in question
<? session_start();
$msg = "x x proposal for:
$_POST['cpname'], $_POST['cptitle']
";
$msg .= " $_POST['cpcomp']
";
$msg .= " Address: $_POST['cpaddress']
";
$msg .= " $_POST['cpcity'], $_POST['cpstate'] $_POST['cpzip']
";
$mailheaders = "From: company name here
";
$mailheaders = "CC: $_POST['cpemail']";
mail("me@my.com","x x Custom Proposal",$msg,$mailheaders);
?>
<html>
--rest of script--

The printing of all vars works fine (once I removed the double
quotes from the post var callouts)

Q2: Do I need sessions to track the form vars from page to page
or am I adding unnecessary complexity to this?

My last large PHP dev work was about 2 years ago. Since then,
quick and dirty flatfile database connections (member lists)
are all I've had to contend with. Things have really changed


Posting Message
im making a forum system and i was wondering if i could have a post delay (flood control). e.g. say if user1 posted a message and then wanted to post again straight after, and then got a custom flood control message.

can i ask how would i make it so i could select how long you had to wait before posting another message and  how would i make it so i can select a custom flood control message. i would like the flood control custom message and time limit (in seconds) to be stored in a mysql table.

Message Boards
I have written a message board and it has been test properly, the problem is it looks naff in apearance. When I see this message board I would like to model it on this. I can't work out the top section. It seems to be in 3 sections pinned to top, pinned to top and read only, and the rest with the occasioal read only. I can't work out the best query. all entries will be in the same table with a field type maybee of

1=Pinned
2=Pinned read only
3=other. 

But then there is the ocasional read only.  their is one of these now 18 recs down. Any Idea on a table structure. Would it require 3 seperate queries. Not good.

Deleting A Message
I want a button to delete each message in you inbox wen clicked. im using this that doesn't work, because i coded it Code:

Loading Message.
I was wondering if there was a way to display a message while a script loads. I have a safety deposit box script, and if people have alot of items, it takes a while to load the script. So some people are sitting at a dead page for a couple seconds. So to inform them that their page is being processed, I would like to display a message while the script loads up everything from the database.

I am not aware of a function that does this, but maybe someone else does. If someone could point me in the right direction that would be great.


Copyright © 2005-08 www.BigResource.com, All rights reserved