Jump to content

Eiolon

Members
  • Posts

    358
  • Joined

  • Last visited

Posts posted by Eiolon

  1. I have an external webserver that needs to communicate with an internal one for a PHP script.

     

    External server

    Linux-based

    Apache

     

    Internal server

    Windows-based

    IIS

     

    On the external server, I will have a script that in the FORM ACTION I will link to a script at the internal server.

     

    <form action="http://IP_ADDRESS_HERE/script.php" method="get">
       Username: <input type="text" name="username" /><br />
       Password: <input type="text" name="password" /><br />
       <input type="submit" value="Submit" />
    </form> 

     

    My question is, do I need to enable anything on the external or internal web server in the PHP config to allow this to work?

     

    With the external server I cannot change anything in the PHP.ini, which is why I am trying to re-direct to the internal server.

  2. I have a table that has the first row being the name of a program, and the second row being the session(s) available.  The program and sessions are being pulled from a database.

     

    Example:

     

    =======================================
    English 101          Date / Time
    =======================================
    Session A             9/1/2012
    Session B             10/1/2012
    =======================================
    Math 101             Date / Time
    =======================================
    Session A             9/1/2012
    Session B             10/1/2012
    

     

    When the program name such as "English 101" is clicked, the row with the sessions expand so you can see what is available.

     

    However, the jQuery is only displaying the first session "Session A".

     

    I know my database query is correct, as if I remove the jQuery the table is displayed properly in full.

     

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html>
    <head>
    <title></title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
    <script type="text/javascript">
    jQuery(document).ready(function() {
      jQuery(".sessions").hide();
      jQuery(".programs").click(function()
      {
        jQuery(this).next(".sessions").slideToggle(500);
      });
    });
    </script>
    </head>
    
    <table>
    <?php 
    $last = '0';
    do {
    if($row_programs['pid'] != $last){ 
    ?>
    <tr class="programs">
    <th align=left><?php echo $row_programs['pname']; ?></th>
    <th align=left>Date / Time</th>
    </tr>
    <?php } ?>
    <tr class="sessions">
    <td><?php echo $row_programs['sname']; ?></td>
    <td><?php echo $row_programs['date_time']; ?></td>
    </tr>
    <?php 
    $last = $row_programs['pid']; 
    }  while ($row_programs = mysql_fetch_assoc($programs));
    ?> 
    </table>
    
    
    </body>
    
    </html>

  3. I log the hostname of the computers when they do certain things in our Intranet.

     

    When the hostname is logged, certain clients are getting both the hostname and the localhost IP address added.

     

    For example, if the PC name is TOMS-PC, the hostname logged is TOMS-PC172.0.0.1

     

    Other clients are logging just the hostname as it should be.

     

    All I use to grab the hostname is:

     

    $hostname = gethostbyaddr($_SERVER['REMOTE_ADDR']);

     

    Any clues as to what causes this?

  4. I just upgraded to a new web server.  Using Windows Server 2008 64-bit, Apache 2.2.1, PHP 5.2 and MySQL 5.5.

     

    I created an ODBC connection using the 32-bit Microsoft Access driver because there is not a 64-bit one around.  However, my script wants to look at the 64-bit ODBC drivers so it does not detect the 32-bit one exists.  Is there a way to force it to look for the 32-bit Access Driver?

  5. I think it could use some color, at least on the front page.  Black and gray look negative to me when you are trying to find eternal happiness :)

     

    Also, your logo of keystonepersonals.com, the .com is highlighted to stand out.  You want people to remember the name of your site, not the .com.  One will assume it will be a .com but if they don't remember what comes before it then it is useless.

  6. So I am trying to learn PDO and after some reading, I have found that you cannot use exec with select statements, however, if you are using a prepared statement, you can.

     

    However, PDO has a function just selecting the data, using PDO::query. 

     

    So my question is, how do I know when is the proper used to use PDO::query or the prepared statement route?  I have been able to duplicate the queries using both methods and obtain the same results. 

     

    Is the prepared statement needed for sanitizing the data if I am selecting from user input and PDO:query used if I am only doing a general select where I explicitely state what I am selecting for in the SQL statement?

  7. I am starting to learn PDO by re-writing one of my existing scripts. Do I still need to validate $_GET or does PDO do the work for me?  Currently I am using:

     

    $id = $_GET['id'];
    
    $sth = $dbh->prepare('DELETE FROM van_reservations WHERE id = :id');
    $sth->bindParam(':id', $id, PDO::PARAM_INT);
    $sth->execute();
    

     

    I used to validate by using this:

     

    $id = isset($_GET['id']) && is_numeric($_GET['id'])?(int) $_GET['id']:0;
    

  8. I am logged into the MySQL command line as root.

     

    I created a new user:

     

    CREATE USER 'programs'@'localhost'
    IDENTIFIED BY 'mypassword';
    

     

    Then I try and grant privileges:

     

    GRANT SELECT, INSERT, UPDATE, DELETE
    ON programs.*
    TO 'programs'@'localhost'
    

     

    I get this as the response:

     

    Query OK, 0 rows affected (0.00 sec)

     

    When I check the user, it still has N for each of the permissions.

     

    I tried flushing privileges.  Using MySQL 5.5.

  9. Looks fine to me, but I did notice that $category appears as the fourth field in your SQL statement, but when you are escaping the data, it appears as the third item.  Try moving $details in front of $category when you are escaping your data so it's in the same position in your SQL statement.  I've seen weirder things.

  10. Like the concept, but the design needs polishing and the logo looks like something made in MS Paint.

     

    You've got some validation errors. Check at: http://validator.w3.org/

     

    When you fill out the post form, if your form errors out you have to re-enter all the info again.

     

    Kind of interested in the overhead to run the site, if only cash is accepted, which means you'll almost none of it is automated.  Do people send you the card to hold onto and make the switch, like escrow?

×
×
  • 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.