Jump to content

marcus

Members
  • Posts

    1,842
  • Joined

  • Last visited

Posts posted by marcus

  1. [quote author=AndyB link=topic=110795.msg448545#msg448545 date=1160239395]
    [quote author=mgallforever link=topic=110795.msg448540#msg448540 date=1160238896]
    i'll show the whole code then :P

    [code]
    :)

    [/code]
    [/quote]

    Thank you. I'll add you to my list of people who would like help.
    [/quote]

    What do you mean, haha, I only edited it.
  2. It doesnt post, it's for a theme, once a new user comes to the website they will automatically be inserted into the database w/ their IP and theme, sooner or later they can change this theme, but it's working now, thanks anyway!
  3. [code]
    <?php
    $ip = $_SERVER[REMOTE_ADDR];
    echo "<input type=hidden value='$ip'>";
    $connection = mysql_connect(localhost,$dbuser,$dbpass;

    $db = mysql_select_db($dbname, $connection);

    $query="SELECT * FROM `theme` WHERE `ip`='$ip'";
    $result44=mysql_query($query);
    if(mysql_num_rows){

    echo ":)";

    }else
    {
    $query2 ="INSERT INTO `theme` (`ip` , `theme` ) VALUES ('$ip', '1');";
    $sql1888 = mysql_query($query2);

    };
    ?>
    [/code]

    it doesnt SQL the information
  4. this should be your final code

    [code]
    <?PHP
        $Name=$_POST['name'];
      $Cname=$_POST['cname'];
      $Query=$_POST['Question'];
      $email=$_POST['email'];
      $Pnumber=$_POST['Pnumber'];
      $date = time();
      $showdate = date("F j, Y, g:i a");
    mysql_select_db($database_csc, $csc);
    $query_Recordset1 = "SELECT * FROM onlineform";
    $Recordset1 = mysql_query($query_Recordset1, $csc) or die(mysql_error());
    $row_Recordset1 = mysql_fetch_assoc($Recordset1);
    $totalRows_Recordset1 = mysql_num_rows($Recordset1);
    $query_Recordset1 or die( "Unable to select database");
    if($_POST['submit']) {

    $query = "INSERT INTO onlineform VALUES ('','$name','$Cname','$email','$Query', '$Pnumber', '$showdate')";
    mysql_query($query);

    mysql_close();


      echo "<h2>THank you for filling in this form, we will be in touch with you ASAP</h2>";
      echo $showdate;
    }

    ?>[/code]
  5. that's what he has.

    did you change the $showdate to [code]$showdate = date("F j, Y, g:i a");[/code]

    do that, then edit your sql

    [code]
    $query = "INSERT INTO onlineform VALUES ('$name','$Cname','$email','$Query', '$Pnumber', '$showdate')";
    mysql_query($query);
    [/code]

    you had $date while $date = time();, showdate is the date
  6. well, how are you submitting it? because if i'm right your sql is incorrect

    [code]
    $query = "INSERT INTO onlineform VALUES ('','$name','$Cname','$email','$Query', '$Pnumber', '$date')";
    [/code]

    should be:
    [code]
    $query = "INSERT INTO onlineform VALUES ('','$name','$Cname','$email','$Query', '$Pnumber', '$showdate')";
    [/code]
×
×
  • 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.