Jump to content

Lee-Bartlett

Members
  • Posts

    225
  • Joined

  • Last visited

    Never

Posts posted by Lee-Bartlett

  1. Ok all im trying to do is a simple mail script but im not sure how completly, atm i have the code below, that is on a html page which re directs in about 3 seconds. where am i going wrong ?

     

    <?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>");
    }
    ?>

  2. Never knew it was so hard to get a submit button to put a yes into a collum, here it my most recent attempt but it just renamed the button and not put yet into the database.

     

    echo "<td><form action='' method='post'> <input type='hidden' name='approve' value='" . $row['approve'] . "'><input type='submit' value='yes' name='app' ></form></td>";

         

  3. $wordlist = "crap|dang|shoot";
    $comment = preg_replace("/\b($wordlist)\b/ie", 'preg_replace("/./","*","\\1")', $comment);
    

    This seems to work really good, because it catches words by themselves, not if they are part of another word like class

     

    ex) it changes crap into ****.

     

    Does anyone know how to modify it so it will instead change it to cr*p.

    In other words modify it so I can add a new list of replacement words?

     

    Thanks

     

     

     

     

    not to sound a bit baffled by this, isnt it better to have it all * out, to complety get rid of the word

  4. Here is my page, i would like my bottom button, the approve button to pass a value of yes to my db, but im not quite sure how to do this. the code for this is...

     

    <?php
    echo "<td><form action='' method='post'> <input type='hidden' name='id' value='yes'><input type='submit' value='approve' name='approvebutton' ></form></td>";
    ?>
    

     

    i was thinking of doing somthing like this tho...

     

    
    <?php
    
    echo "<td><form action='' method='post'> <input type='hidden' name='id' value='" . $row['id'] . "'><input type='submit' value='update' name='updatebutton' ></form></td>";
    
    
    ?>
    
    

  5. I think i know how i will do this, still new to php, bit im little confused on is how to work it in with the delete statement, do i just start another one with the approve db entry.

     

    Also on the public page would i call it like this, if db entry = yes echo else do nothing

  6. Nah, its just a mess arround site to practice on, my uncle is giving me little tasks to get used to this sort of stuff, atm i have used php my admin for password the admin, an i thought it would be a if yes else no, have you got any links to a tut or somthing like that, here are all my pages of code which it will be linked to.

     

    the admin page, havn't put the check box in, wasnt sure if it was best to use, or maybe a button which said allow, then it will be displayed on the code below this code.

     

    --Admin page--

     

    <?php  require_once("includes/db_connection.php"); ?>
        
        <html>
    
    <title></title>
    <style type="text/css">
    <!--
    .style1 {
          font-size: 36px;
          color: #FFFFFF;
    }
    -->
    </style>
    </head>
    
    <body>
    <table width="617" border="1" align="center" cellpadding="5" cellspacing="0" bordercolor="#000000">
      <tr>
        <td colspan="2" bgcolor="#0099FF"><p> </p>
        <p align="center" class="style1"><?php $header = implode("", file("header.htt")); echo $header ?></p>      
        <p> </p></td>
      </tr>
      <tr>
        <td width="129" height="318" align="left" valign="top"><p><br>
            <a href="index.php">Delete/Update</a></p>
       
            <a href="http://www.nexodom.com/website/admin/index.php">Take me back to my database</a></p>
        
    
            <a href="adminuserform.php">Add a new user.</a></p>
        
        <td width="482" align="left" valign="top"><p align="center"> </p>
        
    
    
    
    <?php
    
          if(isset($_POST['id']))
          {
                $id = $_POST['id'];
    
                $delete = mysql_query("DELETE FROM tblbasicform WHERE id='$id'"); 
          }
          
    
    $sql = "SELECT * from tblbasicform";
    $res = mysql_query($sql) or die(mysql_error());
    ?>
    
    <?
    // Table where the db feilds sit
    echo "<table border=1 align=centre font size=\"5\" face=\"verdana\">";
    echo "<tr><td>id</td> <td>Name</td><td>Email</td><td>Buissnes Name</td><td>Street Name</td><td>Website</td><td>Telephone</td><td>Free or Paid</td><td>Longitude</td><td>Latitude</td><td>Delete</td><td>Update</td></tr>"; 
    while($row = MYSQL_FETCH_ARRAY($res))
    {
    //Database is echoed for user to see all entries
    echo "<tr><td>".$row['id']."</td>";
    echo "<td>".$row['name']."</td>";
    echo "<td>".$row['email']."</td>";
    echo "<td>".$row['location']."</td>";
    echo "<td>".$row['ct']."</td>";
    echo "<td>".$row['website']."</td>";
    echo "<td>".$row['telephone']."</td>";
    echo "<td>".$row['type']."</td>";
    echo "<td>".$row['longitude']."</td>";
    echo "<td>".$row['latitude']."</td>";
    
    
    // Begining of the form buttons.
    echo "<td><form action='".$_SERVER['PHP_SELF']."' method='post'> <input type='hidden' name='id' value='" . $row['id'] . "'><input type='submit' value='delete' name='deletebutton'></form></td>"; 
    echo "<td><form action='form2.php' method='post'> <input type='hidden' name='id' value='" . $row['id'] . "'><input type='submit' value='update' name='updatebutton' ></form></td>";
    
    }
    
    echo "</tr>";
    ?>
    <?php $footer = implode("", file("footer.htt")) ?>
    
    
    
    </table><br>
    
        
        <p> </p>
        <p> </p>
        <p> </p>
        <p> </p>
        <p> </p></td>
      </tr>
      <tr>
        <td height="20" colspan="2" bgcolor="#0099FF"> <?php echo $footer ?> </td>
      </tr>
    </table>
    </body>
    </html>
    

     

     

    -- Public Side--

     

    <?php  require_once("includes/db_connection.php"); ?>
    
    <html>
    <head> <style type="text/css">
    <!--
    .style1 {
    font-size: 36px;
    color: #FFFFFF;
    }
    -->
    </style>
    </head>
    <body onLoad="load()" onUnload="GUnload()" >
    <table width="1128" border="1" align="center" cellpadding="5" cellspacing="0" bordercolor="#000000">
      <tr>
        <td colspan="2" bgcolor="#0099FF"><p> </p>
        <p align="center" class="style1"><?php $header = implode("", file("header.htt")); echo $header ?> </p>
        <p> </p></td>
      </tr>
      <tr>
        <td width="198" height="318" align="left" valign="top"><p><a href="index.wifi"></a><br>
            <a href="index.php">Home</a></p>
        </td>
        <td width="904" align="left" valign="top"><p align="center">WIFI Hot Spot List<br>
    
    
    <?php
    
    $sql = "SELECT * from tblbasicform";
    $res = mysql_query($sql) or die(mysql_error());
    
    echo "<table border=2>";
    echo "<tr> <td>Buissnes Name</td><td>Location</td><td>City/Town</td><td>Website</td><td>Telephone</td><td>Latitude</td><td>Longitude</td> <td>Free or Paid</td><td>Veiw on a map</td></tr>";
    while($row = MYSQL_FETCH_ARRAY($res))
    {
    $id = $row['id'];
    
    
    ?>
    <script language='javascript' type='text/javascript'>
    <!--
    function openWindow<?=$id?>() {
    popupWin = window.open('popup.php?id=<?=$id?>', 'popup','width=550,height=400,resizable=no,scrollbars=yes,toolbar=no,screenX=0,screenY=0,Top=0,Left=0')
    }
    // -->
    </script>
    
    
    <?php
    
    echo "<form method=\"post\" name=\"pop$id\">";
    echo "<tr><td>".$row['buissnes_name']."</td>";
    echo "<td>".$row['location']."</td>";
    echo "<td>".$row['ct']."</td>";
    echo "<td>".$row['website']."</td>";
    echo "<td>".$row['telephone']."</td>";
    echo "<td>".$row['latitude']."</td>";
    echo "<td>".$row['longitude']."</td>";
    echo "<td>".$row['type']."</td>";
    echo "<form>";
    if ($row['latitude'] and $row['longitude']) {
    echo "<td><input type=\"button\" onClick=\"openWindow$id(); return false;\" value=\"Pop Up  Map\">";
    } else {
    echo "<td>No Lat or Long entered";
    }
    }
    
    
    echo "</td>";
    echo "</form>";
    
    
    ?><?php $footer = implode("", file("footer.htt")) ?>
    </tr></table>
    <table>
    <tr><td>
    
    </td></tr>
    </table>
    
    
    <br> 
    <a href="userform.php">Submit a WIFI hotspot</a>
    <br />
    <br />
      <?php echo $footer; ?>
    </body>
    </html>

  7. Im not the best at explaining :( i do have captchas i would like a little system like this. The user fills in the form, it goes into the database and stays there. On an admin page i have a check box in a collum, if checked it moves to the public page, else it either remains hidden or gets automatically deleted. Somthing like, validation can only go so far, cause they can still enter aaabbb somthing like that.

  8. Im not sure what the code would look like for this, at the moment my web page has a database echoed on a page. When the form is filled in, it automatically puts in a new entry, but i need an approval page to stop spam after spam of entries. So i have full controll of what goes on there. Atm all i have is my database echoed out on the pages, that code is bellow. How would i go about doing the rest of it, it would be good if it was check boxxed.

  9. This might sound bit stupid, but is css3 out, if so is it a download or does it automatically kick in?

     

    Also when i use a div, i use the ones out of dreamweaver atm, they change postion on each browser. Its very annoying :(

  10. I tried somthing like this.

     

    body

    {

    background-repeat: repeat-x;

    background-image: url(navbarbg.png);

    }

     

    body

    {

    background-repeat: no-repeat;

    background-image: url(sidebar.png);

    }

     

    and it takes out the top one, i tried to re name body and it didnt work, how do i put multiple backgrounds onto a page with out using tables, tables mess up for me in browsers when i use dw

  11. Ah cool, how do you do multiple background images, i looked at a site and they got like 15 images in there background, but when i try it, it just deletes the ones above it.

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