467,077 Members | 952 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,077 developers. It's quick & easy.

PHP script error

Whenever I run the PHP script on the browser, a script error : "Object not found"
is generated. The script I'm working on is syntactically correct.
How can I detect this error in the code?
Mar 27 '08 #1
  • viewed: 1139
Share:
8 Replies
Markus
Expert 4TB
You've either mistyped the URL, havent saved the file in the folder you thought you had.. you might've saved the file with the wrong extension.

This isn't a PHP 'syntax' error, it's a browser error.

Regards.
Mar 27 '08 #2
TheServant
Expert 1GB
Whenever I run the PHP script on the browser, a script error : "Object not found"
is generated. The script I'm working on is syntactically correct.
How can I detect this error in the code?
Which browser? And can you post some of your code where it might be occuring? (USING CORRECT CODE TAGS)
Mar 27 '08 #3
Which browser? And can you post some of your code where it might be occuring? (USING CORRECT CODE TAGS)
Hi,
The following is the IE7 browser error, after the form is submitted :

Line: 45
Char: 3
Error: Object expected
URL: http:// (on the local intranet)

These are a few lines of code (lines 36-56) in the php script:
Expand|Select|Wrap|Line Numbers
  1. $value_businessunit = "";
  2.         if(isset($_POST['BusinessUnit']))
  3.                 $value_businessunit = $_POST['BusinessUnit'];
  4.         $value_sponsor  = "";
  5.         if(isset($_POST['Sponsor']))
  6.                 $value_sponsor  = $_POST['Sponsor'];
  7.         $value_proposaldescription = "";
  8.         if(isset($_POST['ProposalDescription']))
  9.                 $value_proposaldescription = $_POST['ProposalDescription'];
  10.         $value_projectid = "";
  11.         if(isset($_POST['ProjectId']))
  12.                 $value_projectid = $_POST['ProjectId'];
  13.         $value_closedon = "";
  14.         if(isset($_POST['ClosedOn']))
  15.                 $value_closedon = $_POST['ClosedOn'];
  16.         $value_serviced = "";
  17.         if(isset($_POST['Serviced']))
  18.                 $value_serviced = $_POST['Serviced'];
  19.         $value_entrydate = "";
  20.         if(isset($_POST['EntryDate']))
  21.                 $value_entrydate = $_POST['EntryDate'];
  22.         $value_entryby="";
  23.         if(isset($_POST['EntryBy']))
  24.                 $value_entryby = $_POST['EntryBy'];
  25.  
The above code is executed each time the form is refreshed.
However, no errors are seen when the form is refreshed. The error arises only when the form is submitted.
Mar 28 '08 #4
You've either mistyped the URL, havent saved the file in the folder you thought you had.. you might've saved the file with the wrong extension.

This isn't a PHP 'syntax' error, it's a browser error.

Regards.
Hi, thank you for letting me know the correct terminology. I'm still working on detecting the browser error. Even the URL is properly typed and the file is also saved in the required folder.

The browser error is generated, everytime the form is submitted.
Mar 28 '08 #5
Markus
Expert 4TB
Hi, thank you for letting me know the correct terminology. I'm still working on detecting the browser error. Even the URL is properly typed and the file is also saved in the required folder.

The browser error is generated, everytime the form is submitted.
The problem may lay in the form.
So can we see that?
(correct code tags = code=html)

Cheers.
Mar 28 '08 #6
ronverdonk
Expert 4TB
Are you using JavaScript either to check the validity of the submitted form fields, to handle a form event or to submit the form? Becaue this is not a PHP error: php does not run in the browser.

Ronald
Mar 28 '08 #7
Are you using JavaScript either to check the validity of the submitted form fields, to handle a form event or to submit the form? Becaue this is not a PHP error: php does not run in the browser.

Ronald
Hi,

Thank you for guiding me on this concept. After reading your reply, I've just begun to understand that if there are any errors in PHP, the parse errors are generated and are displayed.

After reviewing the code, I've been able to avoid the browser error. I'm using JavaScript to check the validity of date fields in the form.
All the functions for checking the validity are defined in the file CheckDate.js
I had used the script tags to include the functions in the current file as
follows:
Expand|Select|Wrap|Line Numbers
  1. <script language="JavaScript" src="CheckDate.js">
  2. </script>
  3.  
The path of the JS source file is also proper.
But later I modified the code by copying all the functions' code from CheckDate.js to the current file and changed the enclosing script tags as follows:
Expand|Select|Wrap|Line Numbers
  1. <script language="JavaScript" type="text/javascript">
  2.  # All functions defined in CheckDate.js copied here
  3. </script>
  4.  
Both the methods are equivalent and should work fine. But the first method generated browser errors, while the second method worked fine.
What could be the probable reason for this?
Mar 31 '08 #8
If you view the html source what is on line 45? It sounds like this is a javascript error.
Mar 31 '08 #9

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

12 posts views Thread by tshad | last post: by
15 posts views Thread by Lawrence Krubner | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.