CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2006
    Location
    India
    Posts
    72

    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

  2. #2
    Join Date
    May 2002
    Posts
    10,943

    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.

  3. #3
    Join Date
    Nov 2005
    Posts
    49

    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
  •  





Click Here to Expand Forum to Full Width

Featured