Jump to content

muffin100

New Members
  • Posts

    7
  • Joined

  • Last visited

    Never

Posts posted by muffin100

  1. I have a script like this:

    [code]
    <?php
    mysql_connect('10.0.35.4','testuser','test');
    mysql_select_db('helpdesk');

    $result="SELECT * FROM login";
    $row=mysql_fetch_array($result);

    // display the 8 columns of results in a table by
    // looping through the array of results, $result,

      print "<body bgcolor='ffeecc'>";
      echo "<table>";
      do {
          echo "<tr>";
          echo "<td>".$row[0]."</td><td>".$row[1]."</td><td>".$row[2];
          echo "</td><td>".$row[3]."</td>";
          echo "</tr>";
    } while ($row= mysql_fetch_array($result));

      print "</table></body>";
    ?>
    [/code]

    but the problem is that nothing shows on the page, it should show the all the data in the login database and now it's only showing a background colour and not even a table. I have no problem using:
    SELECT * from login;
    on the mysql prompt on the server with the testuser. Here is the Mysql info of the phpinfo page:

    mysql
    MySQL Support enabled
    Active Persistent Links 0
    Active Links 0
    Client API version 3.23.49
    MYSQL_MODULE_TYPE builtin
    MYSQL_SOCKET /tmp/mysql.sock
    MYSQL_INCLUDE no value
    MYSQL_LIBS no value

    Directive Local Value Master Value
    mysql.allow_persistent On On
    mysql.connect_timeout 60 60
    mysql.default_host   no value no value
    mysql.default_password no value no value
    mysql.default_port   no value no value
    mysql.default_socket no value no value
    mysql.default_user   no value no value
    mysql.max_links Unlimited Unlimited
    mysql.max_persistent Unlimited Unlimited
    mysql.trace_mode         Off Off
    Is there anything wrong with the installation?
    By the way is there another ways of testing for PHP connection to Mysql?
  2. Please Help!!!

    Sorry to say, I have no idea what I did wrong, but after I installed PHP 4.3.4 with apache 2.0.53, the PHP pages don't show up at all. They just show up like a text file. Just like this:

    [b]<?
    phpinfo();
    ?>[/b]

    I have installed PHP as normally using a script:

    [b]./configure --prefix=/usr/local/php \
    --mandir=/usr/local/src/man \
    --with-mysql=/usr/local/mysql \
    --with-apxs2=/usr/local/apache2/bin/apxs[/b]

    then make and make install
    and I have also configured the httpd.conf with:

    [b]LoadModule
    php4_module /usr/local/apache2/modules/libphp4.so[/b]

    &

    [b]AddType application/x-httpd-php .php .php3[/b]

    Is there something wrong with my configuration or my installation?
  3. I'm trying to write a register page and this parse error came out:

    Parse error: syntax error, unexpected '[' in /usr/local/apache2/htdocs/register.php

    Here is part of the code:

    if (eregi ('^[[:alpha:]]\.\'\-{2,15}$',stripslashes(trim($POST['name'])))) {
    $n = escape_data($_POST['name']);
    } else {
    $n = FALSE ;
    echo '<p><font color="red" size="+1">Please enter a user name!</font></p>';
    }

    I thought it is the single quotes problem so I have tried this:

    if (eregi ('^[[:alpha:]]{2,15}$',stripslashes(trim($POST['name'])))) {
    $n = escape_data($_POST['name']);
    } else {
    $n = FALSE ;
    echo '<p><font color="red" size="+1">Please enter a user name!</font></p>';
    }

    but the same error popped up, can anyone tell me what the problem is?
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.