Jump to content

Lee-Bartlett

Members
  • Posts

    225
  • Joined

  • Last visited

    Never

Posts posted by Lee-Bartlett

  1. <?php
    
    require_once "includes/db_connection.php";
    
    $sql = "SELECT email  FROM email";
    
    if ($result = mysql_query($sql)) {
      if (mysql_num_rows($result)) {
        $row = mysql_fetch_assoc($result);
        echo "<form action='' method='post'>\n";
        echo "<input type='text' name='id' value='" . $row['email'] . "'>\n";
        echo "  <input type='submit' value='update' name='updatebutton'>\n";
        echo "</form>\n";
      } else {
        echo "No email found";
      }
    } else {
      echo mysql_error() . "<br />$sql";

     

    I know it means somthing aint closed, but i cant se where, i tried closing the else at the end and didnt work.

     

     

    Parse error: syntax error, unexpected $end in /home/nexodom/public_html/website/admin/email.php on line 21

  2. im using the code u gave me.

     

    error is

    Notice: Undefined variable: row in /home/nexodom/public_html/website/admin/email.php on line 12

     

    <?php error_reporting(E_ALL) ; ini_set('display_errors','1'); ?>
    
    <?php
    
    require_once "includes/db_connection.php";
    
    $sql = "SELECT email  FROM email";
    
    if ($result = mysql_query($sql)) {
      if (mysql_num_rows($result)) {
        echo "<form action='' method='post'>\n";
        echo "<input type='text' name='id' value='" . $row['email'] . "'>\n";
        echo "  <input type='submit' value='update' name='updatebutton'>\n";
        echo "</form>\n";
      } else {
        echo "No email found";
      }
    } else {
      echo mysql_error() . "<br />$sql";
    }
    
    ?>
    

  3. Im trying to duplicate somthing i done but on a smaller size, but thats proving to be alot harder for some reason.

     

    I have a db table called email, in that table there are 2 feilds, email and id. there will only ever be 1 entry to this table but i cant seem to pull that entry into my text boxx, or even get it to echo. heres my code.

     

    <?php  require_once("includes/db_connection.php"); ?>
    <?php 
    
    
    $email = $_GET['email'];
    
    $sql = "SELECT * FROM email WHERE id='1'";
    $res = mysql_query($sql) or die(mysql_error());
    
    while ($row = mysql_fetch_array($res));
    
    {
    echo $email;
    $email = $row['email'];
    
    echo "<form action='' method='post'> <input type='text' name='id' value='" . $row['email'] . "'><input 
    type='submit' value='update' name='updatebutton' ></form>";
    }
    ?>

  4. At the moment there is a varible called $to with an email in, i need a text box, which will change that data in that varible to what ever i put in the text box, if you know what i mean. Say this is the varible

     

    $to = bob  .........  puts jim in text box then submits it ........... new varible ............ $to = jim

     

    anyone got a tut on how to do that?

  5. This is the code i use, it might help it might not.

     

    <?php
    $sql="INSERT INTO tblbasicform (name, email, buissnes_name, location, ct, website, telephone, longitude, latitude, type, approve)
    VALUES
    ('$_POST[name]','$_POST[email]','$_POST[buissnes_name]','$_POST[location]','$_POST[ct]','$_POST[website]','$_POST[telephone]','$_POST[longitude]',
    '$_POST[latitude]','$_POST[type]','$_POST[approve]')";
    
    if (!mysql_query($sql,$connect))
      {
      die('Error: ' . mysql_error());
      }
    
    ?>

  6. Ok, im not sure how to do this, imagine i have just a form button and when that is clicked i need it to send an email to my email adress, i used the basic code, seen below. But that dont work, how do i acheive this ?

     

    <?php
    $to = "leebartlett18@googlemail.com";
    $subject = "Hi!";
    $body = "Hi,\n\nHow are you?";
    if (mail($to, $subject, $body)) {
      echo("<p>Message</p>");
    } else {
      echo("<p>Message delivery failed...</p>");
    }
    ?>
    

  7. This is the whole code, first im putting stuff into my db, then i want a mail to go me, telling me somthing new has been entered. this is all my code. Im new to mailing so got no clue how :(

     

    <?php session_start(); ?>
    
    <?php require_once('db_connection.php'); ?>
    <?php
    
    include_once ("securimage/securimage.php");
    
    $securimage = new Securimage();
    
    if ($securimage->check($_POST['captcha_code']) == false) {
      // the code was incorrect
      // handle the error accordingly with your other error checking
    
      // or you can do something really basic like this
      
      ?>
      
      <a href="http://www.nexodom.com/website/userform.php">The code you entered was incorrect.  Go back and try again.</a>
      <?php
      
      die('');
    }
    
    
    $sql="INSERT INTO tblbasicform (name, email, buissnes_name, location, ct, website, telephone, longitude, latitude, type, approve)
    VALUES
    ('$_POST[name]','$_POST[email]','$_POST[buissnes_name]','$_POST[location]','$_POST[ct]','$_POST[website]','$_POST[telephone]','$_POST[longitude]',
    '$_POST[latitude]','$_POST[type]','$_POST[approve]')";
    
    if (!mysql_query($sql,$connect))
      {
      die('Error: ' . mysql_error());
      }
    
    ?>
    
    <?php
    $to = "leebartlett18@googlemail.com";
    $subject = "Hi!";
    $body = "Hi,\n\nHow are you?";
    if (mail($to, $subject, $body)) {
      echo("<p>Message</p>");
    } else {
      echo("<p>Message delivery failed...</p>");
    }
    ?>
    
    
    <html>
    <head>
    
    <meta http-equiv="refresh" content="2;url=http://nexodom.com/website/index.php">
    
    <title></title>

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