SitePoint Sponsor

User Tag List

Results 1 to 10 of 10
  1. #1
    SitePoint Addict Clete2's Avatar
    Join Date
    Mar 2002
    Location
    Columbia, South Carolina
    Posts
    304
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    MySQL and PHP 4.2.0

    Hi, I just upgraded to PHP 4.2.0... have they changed the way you connect to mysql? Cos I can get to mysql VIA command line but when I do it in a script ( @mysql_connect("localhost","myusername","mypass") or die(mysql_error()) ), I get an access denied error (see Http://clete.d2g.com/Guestbook/index.php )
    My Blog
    My Photography Website
    Linux user #339185

  2. #2
    SitePoint Addict Clete2's Avatar
    Join Date
    Mar 2002
    Location
    Columbia, South Carolina
    Posts
    304
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    also the server's behavior is odd, its the newest apache, dled today. I must start the server with the last 2 lines commented (
    AddType application/x-httpd-php .php

    LoadModule php4_module modules/libphp4.so)

    which will disable php... then i use bin/apachectl restart after i uncomment those lines. then it works, no other way, anyone know a solution? should i revert back to Apache1.3?
    My Blog
    My Photography Website
    Linux user #339185

  3. #3
    Making a better wheel silver trophy DR_LaRRY_PEpPeR's Avatar
    Join Date
    Jul 2001
    Location
    Missouri
    Posts
    3,428
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by Clete2
    should i revert back to Apache1.3?
    does this mean you are using Apache 2 now? if so, did you compile PHP with Apache 2 support? e.g. `--with-apxs2'?

    otherwise, no, you should be able to connect to MySQL just fine if you username/password is correct.
    - Matt ** Ignore old signature for now... **
    Dr.BB - Highly optimized to be 2-3x faster than the "Big 3."
    "Do not enclose numeric values in quotes -- that is very non-standard and will only work on MySQL." - MattR

  4. #4
    SitePoint Addict Clete2's Avatar
    Join Date
    Mar 2002
    Location
    Columbia, South Carolina
    Posts
    304
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    yea, it failed when i said apxs, told me to use apxs2... so I did, sorry i didn't say so but i got it fixed not the odd server startup tho, maybe its a bug...
    My Blog
    My Photography Website
    Linux user #339185

  5. #5
    SitePoint Addict Clete2's Avatar
    Join Date
    Mar 2002
    Location
    Columbia, South Carolina
    Posts
    304
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    oh sorry to ask soo much but umm what can I use besides ?Name=1 in the title bar in 4.2.0? Since it doesn't work...
    My Blog
    My Photography Website
    Linux user #339185

  6. #6
    SitePoint Addict Clete2's Avatar
    Join Date
    Mar 2002
    Location
    Columbia, South Carolina
    Posts
    304
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by Clete2
    oh sorry to ask soo much but umm what can I use besides ?Name=1 in the title bar in 4.2.0? Since it doesn't work...
    anyone? I can't think of a way besides using a form, which makes the page look ugly... I still just wanna use a link
    My Blog
    My Photography Website
    Linux user #339185

  7. #7
    Making a better wheel silver trophy DR_LaRRY_PEpPeR's Avatar
    Join Date
    Jul 2001
    Location
    Missouri
    Posts
    3,428
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    a form wouldn't work either. i don't think it's a problem with PHP, but your scripts. register_globals is probably off if you used the new php.ini. you basically have 2 choices: 1) turn register_globals on in php.ini, or 2) access your variables the preferred way, as $_GET['Name'] instead of $Name, etc.

  8. #8
    SitePoint Addict Clete2's Avatar
    Join Date
    Mar 2002
    Location
    Columbia, South Carolina
    Posts
    304
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hmm yes I got this info from another person... only thing is when I use $_POST[""] and GET to do stuff... doesn't work... here is what I got:

    PHP Code:
    <? // PHP42.php
    $name="test.html";
    $_POST['yay'] = $name;
    ?>
    <a href="Bla.php"><? echo $name?></a>
    PHP Code:
    <? .. Bla.php
    $_GET
    ['yay'] = $name;
    echo 
    $name;
    include(
    "$name"); // Yes, I know there is a big security risk with this
    ?>
    I want to:

    1) pass name to Bla.php
    2) Include $name in the page

    what am I doing wrong?
    My Blog
    My Photography Website
    Linux user #339185

  9. #9
    Making a better wheel silver trophy DR_LaRRY_PEpPeR's Avatar
    Join Date
    Jul 2001
    Location
    Missouri
    Posts
    3,428
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    your assignments are wrong in those examples. go to `file.php?name=file.html'. in file.php:

    PHP Code:
    <?php

    include($_GET['name']);

    ?>

  10. #10
    SitePoint Addict Clete2's Avatar
    Join Date
    Mar 2002
    Location
    Columbia, South Carolina
    Posts
    304
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ohh -- worked, thanks!
    My Blog
    My Photography Website
    Linux user #339185


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •