|
-
October 17th, 2007, 01:50 PM
#1
Strange Bug With Firefox, Php(mysql)
hey guys,
i have writen some php scripts for a website with transacts with mysql database..... now i have used classes, lets say i defined all basic repetitive methods like connect, select db, and stuff like that in a file called mysql.php and i have written it as a class.
Now when i define an object for it in my script like the followiing:
<?php
//form elements from previous page
$name=$_POST['name'];
$address=$_POST['address'];
$zip=$_POST['zip'];
$obj=new db();
*************************************************
$obj-> connect("root","","scp");
//the problem occurs in the above line
*************************************************
$query="insert into client_info values(null,'$name','$address','$phone','$zip','$login_name_email','$pwd',0,now())";
$result=$obj->query($query);
---------------------------------------------------------------------------------------------
this works absolutely fine in IE, but in firefox it just prints the code as it is starting from connect all the way to the end of the script and doesnot even make a connection with my DB. This to me seems very strange because the browser, acc wat i though never sees php code coz it cannot ready php.... my server is supposed to be rendering the browser only with Html code and formats which my browser can understand............
I hope i have explaiined wats rong clearly..... some pointer of assistance will be very helpful.........
thanx guys
cheers
Lucky
-
October 17th, 2007, 04:26 PM
#2
Re: Strange Bug With Firefox, Php(mysql)
Remember that PHP is a server-side scripting language. Therefore PHP will not depend on IE vs. Firefox, but the output of the PHP will. So...can you post the output rather than the PHP?
If the post was helpful...Rate it! Remember to use [code] or [php] tags.
-
October 18th, 2007, 01:58 AM
#3
Re: Strange Bug With Firefox, Php(mysql)
If u r seeing PHP code on firefox then u have not configured php.ini file. If u r putting ur code of php in <? ?> tags then try it to replace with <?php ?>
Muhammad Waqas Badar
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|