Closed Thread
Results 1 to 4 of 4

Thread: Need PHP Help

  1. #1
    Rising is offline x10 Lieutenant Rising is an unknown quantity at this point
    Join Date
    Dec 2005
    Posts
    396

    Need PHP Help

    ok, ive wrote my website, but i have trouble with the users logging in, here is what i have in my 'connect.php'
    Code:
    <html>
    <head>
    <title>Logging In</title>
    </head>
    <?php 
    $connect = mysql_connect(“localhost”,”username”,”password”) or die(“Failed to connect to database“); 
    $db = mysql_select_db(“dohguild_clanunx”) or die(“Failed to connect to database“); 
    ?> 
    
    </body>
    
    </html>
    Here is the home page:
    http://www.disciplesofheaven.x10host...nunx/index.php

    You can log in using the User/Pass of Sample/test

    You should get an error,
    Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in /home/dohguild/public_html/clanunx/main.php on line 328
    when it goes to the main.php, do i link the login button to connect.php

    but on main.php it has a problem with the stats
    Code:
    <?php 
    Echo “Total Unique hits: $unique_hits_nr; <br>
    Echo “Today’s Unique hits: “ $unique_hits_today_nr; <br> 
    Echo “Total hits: “ $total_hits_nr; <br>
    Echo “Total hits today: “ $total_hits_today_nr; <br> 
    ?>
    I have the table setup in MySQL for it, included files:
    add_hits.php
    Code:
    <html>
    <head>
    <title></title>
    </head>
     
    <?php 
    Include(“connect.php”); 
    $IP = $_SERVER[‘REMOTE_ADDR’]; 
    $referer = $_SERVER[‘HTTP_REFERER’]; 
    $time = time(); 
    $date = date(“M, d, Y”); 
    $add_stats = mysql_query(“INSERT INTO stats(IP,referer,time,date) VALUES (‘$ip’, ‘$referer’, ‘$time’, ‘$date‘)”); 
    ?> 
    
    </body>
    
    </html>
    Set_hits.php
    Code:
    <html>
    <head>
    <title></title>
    </head>
    <?php 
    Include(“connect.php”); 
    $date = date(“M, d, Y”); 
    $unique_hits_select = mysql_query(“SELECT DISTINCT ip FROM stats”); 
    $unique_hits_nr = mysql_num_rows($unique_hits_select); 
    $unique_hits_today_select = mysql_query(“SELECT DISTINCT ip FROM stats WHERE date = ‘$date’”); 
    $unique_hits_today_nr = mysql_num_rows($unique_hits_today_select); 
    $total_hits_select = mysql_query(“SELECT * FROM stats”); 
    $total_hits_nr = mysql_num_rows($total_hits_select); 
    $total_hits_today_select = mysql_query(“SELECT * FROM stats WHERE date = ‘$date’”); 
    $total_hits_today_nr = mysql_num_rows($total_hits_today_select); 
    ?> 
    </body>
    
    </html>
    But how do i link it so that you can login correctly.

    Ill give at least 200 points if someone can help me

  2. #2
    dharmil's Avatar
    dharmil is offline x10 Elder dharmil is an unknown quantity at this point
    Join Date
    Sep 2005
    Location
    Avenel New Jersey
    Posts
    828

    Re: Need PHP Help

    PHP Code:
    <?php
    echo "Total Unique hits: $unique_hits_nr";
    echo 
    "<br>";
    echo 
    "Today’s Unique hits: $unique_hits_today_nr";
    echo 
    "<br>";
    echo 
    "Total hits: $total_hits_nr";
    echo 
    "<br>";
    echo 
    "Total hits today: $total_hits_today_nr";
    echo 
    "<br>";
    ?>

  3. #3
    Rising is offline x10 Lieutenant Rising is an unknown quantity at this point
    Join Date
    Dec 2005
    Posts
    396

    Re: Need PHP Help

    lol thanks

  4. #4
    dharmil's Avatar
    dharmil is offline x10 Elder dharmil is an unknown quantity at this point
    Join Date
    Sep 2005
    Location
    Avenel New Jersey
    Posts
    828

    Re: Need PHP Help

    no problem

Closed Thread

Similar Threads

  1. [PHP] MySQL and PHP
    By Bryon in forum Tutorials
    Replies: 43
    Last Post: 03-24-2011, 07:27 AM
  2. [PHP] Variables in PHP
    By Bryon in forum Tutorials
    Replies: 15
    Last Post: 01-29-2009, 09:46 AM
  3. tons of PHP Resources
    By Chris S in forum Scripts & 3rd Party Apps
    Replies: 10
    Last Post: 01-16-2009, 10:07 AM
  4. [PHP] PHP For Starters
    By Complex in forum Tutorials
    Replies: 24
    Last Post: 06-14-2008, 11:40 PM
  5. Unstand PHP?
    By o0slowpaul0o in forum Tutorials
    Replies: 8
    Last Post: 01-07-2008, 09:16 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers