Jump to content

Mirek

New Members
  • Posts

    6
  • Joined

  • Last visited

    Never

Posts posted by Mirek

  1. Thanks to you both,

    I did forget to mention that the actual script runs from an external include file and I was hoping to not to have to fiddle with every form on several pages but have a global script to adjust what I need.

    I guess what I seek is something similar to the javascript :: document.form.textfield.value etc

    I cant seem to find reference to similar in PHP.

    Your solution is good and it works great, its what I use atm but I am hoping for something more like above.

  2. Hi all,

    How does one get a status of a check box from a form via the $_POST[] variable and the assign that same status in a check box of a form on the new page?

    i.e if a form has been submited with a check box 'checked' I want to be able to 'check' a box on a different form.

    [code]
    <?php

    if ($_POST['checkbox1']){

          ???;

    }

    ?>
    [/code]

    thx in advance
    Mirek
  3. Ahh excelent Wildteen, thx

    That did the trick except for the ';' .

    I am sure I would have tried that but yeah thats coding.

    ----------------------------------

    onlyican -

    the query refers to including a valid link in a form stored in a varaible that does not cause an error when echoed as that variable from an include file.

    Cheers
  4. Hi there,

    I am trying to create a form which gets added to a page via an include file but can not work out how to insert ' php $_SERVER['PHP_SELF']; ' in it so when it gets loaded from the variable it actually works.

    I have tried many different ways and its got me kind of beat as it either comes back with just useless text or a php error.


    current code
    [code]

    $a_status = '<form action="<?php $_SERVER['PHP_SELF']; ?>" method="post" name="form1" id="form1"> ' ;

    [/code]


    thx in advance.

  5. Hi all

    I am stuck with a problem of passing a $_GET[] variable via a header line.

    Here is my code ::

    [code]

    if( $_POST["submit"]){


        $mid = $_GET['id'];    
        $mname = $_POST['threadname'];
        $mbody = $_POST['threadbody'];
        $mtime = $_POST['threadtime'];
        

        $sqled = "INSERT INTO messagereply (threadid,replytime,replyname,replybody) VALUES ('$mid','$mtime','$mname','$mbody')";

      
                     $resulted = mysql_query($sqled) or die(mysql_error());


                      if ($resulted){

                             header("Location: message_board_view.php?id=".$mid);

                }
        }
    ?>

    [/code]

    $_GET['id'] is a variable passed from a previous page stored in $mid.

    Everything works great, the query and header until I add $mid on the end of my header message where I get the following error on the target page after submiting the form::

    [!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]
    You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
    [/quote]

    Any help would be greatly appriciated.

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