HELP!! What permissions do I use for this?

Discussion in 'PHP' started by stevestuff, Feb 25, 2009.

  1. #1
    Seems like this file controls the database access: dbase.php. It's used for PHPchat.

    <?
    $linkID = mysql_connect("localhost","user", "pass")
    or exit("Could not connect");

    mysql_select_db ("dbname");

    ?>


    "localhost","user", "pass" & "dbname" are configured for the database.

    I just need to know what permissions this file should have. IE: 777, 644, or 000
     
    stevestuff, Feb 25, 2009 IP
  2. ActiveFrost

    ActiveFrost Notable Member

    Messages:
    2,072
    Likes Received:
    63
    Best Answers:
    3
    Trophy Points:
    245
    #2
    There's nothing to do with file permissions ( chmod ). Maybe you could tell us, what's the problem ?
     
    ActiveFrost, Feb 25, 2009 IP
  3. stevestuff

    stevestuff Well-Known Member

    Messages:
    631
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    185
    #3
    (be aware - this is an adult website in construction)

    URL: http://myasiangirlcam.com/registration/model.php
    Where it says, "What does offer you?" there,s a blank space where <? echo "$sitename"?> should enter the website's name, and the country list doesn't display.

    Currently this file (dbase.php) is set to 000.

    Here's the PHP/HTML code for the country list form:

    <select name="Country" id="Country">

    <?

    include ("../dbase.php");

    include ("../settings.php");

    $result = mysql_query('SELECT * FROM countries ORDER BY name');

    while($row = mysql_fetch_array($result)) {

    echo"<option value='$row[id]'";

    if (isset($_POST[Country]) && $_POST[Country]==$row[id]){

    echo "selected";

    }



    echo ">$row[name]</option>";

    }





    ?>



    </select>
     
    stevestuff, Feb 25, 2009 IP
  4. ActiveFrost

    ActiveFrost Notable Member

    Messages:
    2,072
    Likes Received:
    63
    Best Answers:
    3
    Trophy Points:
    245
    #4
    Replace :
    echo ">$row[name]</option>";
    PHP:
    With :
    echo ">".$row['name']."</option>";
    PHP:
    ** You should reformat your code .. hard to read and probably some other small mistakes can show up !
     
    ActiveFrost, Feb 25, 2009 IP
  5. unlimitedmoviez

    unlimitedmoviez Peon

    Messages:
    46
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    First change setting for db file make it 644
    then put this code

    include ("../dbase.php");
    include ("../settings.php");
    $result = mysql_query('SELECT * FROM countries ORDER BY name');
    ?>
    <select name="Country" id="Country">
    <?
    while($row = mysql_fetch_array($result)) {
    ?>
    <option value="<?=$row['id']?>"><?=$row['name']?></option>
    <? }?>
    </select>
    PHP:
    if you have problem pm me i will solve that
     
    unlimitedmoviez, Feb 25, 2009 IP