Page 1 of 1

Form Submission ERROR/PROBLEM. WHY?

Posted: Mon Jun 19, 2006 2:40 am
by fwing
twigletmac | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]


[b]Can anyone HELP?[/b]
[i]My problem: [/i]
The script below works perfectly on my localhost. It gives me problem when it is running on
host server(unix,php+mysql). In fact, it is running fine for the past months on the server 
without any problem.
When the script is executed and the 'table_browser' form is submitted, the I.E browser reported
the script 'admin_viewtable.php' is not found/available. Firefox browser does not report this 
error but the screen is blank, instead of listing the record data I expected. 
I have been checking on my PC for  and I am very sure it works fine. The Hosting techincal
staffs claiming their system is running fine without problem and offer no help to my problem.
I just can't find any bug in my script and wonder why it is only having problem when it is running 
under  the hosting server environment?!

Regards,
Allan, pkpk@tm.net.my , Malaysia

MY SCRIPT:

Code: Select all

<? 
########    Script name:   admin_viewtable.php   ################
################################################################
 if ($_GET['t']) 
    $t=$_GET['t'];
?>
.............
<form name='table_browser' action='admin_viewtable.php' method='GET' >
    <select name="t" onChange="javascript:submit();">
        <option>Select a table</option>
.......................

twigletmac | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]

Posted: Mon Jun 19, 2006 8:26 am
by neophyte
It's always the tiny things that make the difference. Check to make sure the action pointed page is on your server. Make sure it's spelled correctly. Make sure your javascript is working correctly.

Posted: Mon Jun 19, 2006 9:00 am
by GM
Have you got an extra semicolon ";" in your onChange javascript?

Looks to me like "javascript:;submit();"


EDIT: Please ignore. I'm just dumb.


EDIT 2: What happens if you change your onChange code to "document.forms['table_browser'].submit();"?

Posted: Mon Jun 19, 2006 12:52 pm
by Benjamin
Use <?php instead of <?, other than that I don't see anything that should cause anything more than a notice.

I Found the Culprit!

Posted: Tue Jun 20, 2006 11:17 am
by fwing
Thanks for suggestions to my problems.

After relentless trying, the problem stays. I decided to debug line by line(display method).
I am using dial up modem and it took me quit a bit oif time to locate the problem codes:

Code: Select all

//        $metax = mysql_fetch_field($result);
//        $nm = $metax->name;
          $nm = mysql_field_name($result,$i); // replacement code above 2 lines
The 2 lines under comments were giving me problems. I managed to looked up for substitue codes
from internet to test out and it worked!
My localhost is using php5 and I encounter no problem but facing this in my server. I think the php version supported is 4.1. I wanted to use php5 but is not supported there! May be it is good idea to move to other hosting provider who can better service and newer version of software support.
Can anyone give me idea how to perform error-trap in php4- meaning when I encounter program errors, I am still in command of the flow of my program.
The other thing I realise is, microsoft I.E gave me 'file not found/available' message which was very misleading. Firefox did not do so, that lead me to look out for other bugs encountered by the Browser.
Thanks gain.
(new comer in php,mysql)