Jump to content

interpim

Members
  • Posts

    303
  • Joined

  • Last visited

    Never

Posts posted by interpim

  1. If the row already exists in the database, change your query to an UPDATE, and in your SQL statement "UPDATE Welcome WHERE Title ='title'"

    Since it seems like your Title is your primary key, you cannot insert a new row with the same value as an already existant Primary ID.  If you need to change the title as well, then I would suggest adding another field to your database and set it as your unique id.

  2. first you have to build your form... which is simple html, but for the action you want to put the script that will display the next page...

     

    for instance say your first page is form.php, you'll have your form code, and it is submitting to display.php

     

    form code

    <form action='display.php' method='post'>
    <input type='text' name='name'><br>
    <input type='submit' value='submit'>
    </form>
    

     

    your display.php will get the data submitted and display it...

    <?php
    $name = $_POST['name'];
    echo $name;
    ?>
    

  3. well... the problem is when you use setcookie() it sends a header, so if you are calling it from another script that writes anything else to the screen then it will give that error unless you use output buffering...

     

    That script by itself shouldn't give that error, but if you are calling it from another script that you expect output from you will get that error...

     

    output buffering can be turned on in the script you call your setcookie from by putting ob_start(); at the beginning of the script and then an ob_end_flush(); at the end.  But there are some disadvantages to this primarily concerning security...

  4. I believe it actually puts the text of your email like you type it in your script...

     

    so I think if you write out the email like you want it seen in your script that may work.  I have had a similar issue to this before, but I can't remember exactly how I got it to format correctly

  5. build an additional array for the categories you want to give, then when you run through the results of your query, then you can put the information into your arrays around the page such as blue/green/red etc...

     

    Or, you could have several queries... one for each box as you put it.  Basically just select what you want to use from your database... if you want to display stuff from category green only search for those in your query... but for each box have a seperate query.

  6. OK... my bit of code is for paging in a guestbook script.  if anyone puts anything into the address bar besides a number it will display it aswell :/  anywho, does anyone know how to prevent this?

     

    here is my code snippet.

     

    $page = 1;
    if(isset($_GET['page'])){
    $page = $_GET['page'];
    $x = $page*5-5;
    }

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