Jump to content

harristweed

Members
  • Posts

    346
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by harristweed

  1.  

    $new_val=strtotime($arr[7]);

    $into_db=date("Y-m-d H:i:s",$new_val);

     

    //or $into_db=date("Y-d-m H:i:s",$new_val); depending on whether $arr[7] is America(mm/dd/yyyy) or English date format(dd/mm/yyyy)

     

    $sql = "INSERT INTO Links(URL,Title,Description,Email,SubmitURL,ContactedOn)

          VALUES('{$arr[0]}','{$arr[1]}','{$arr[2]}','{$arr[3]}','{$arr[4]}','$into_db"

  2. I have a form in a pop up window. When the form is submitted a database is updated (via php). I then want the widow to close, I have this in the php script:

    exit("<a href=\"javascript:window.close();\">Close Window</a>");

     

    Is it possible to get the window to close without the need to click on the link?

     

    You can see from the above that I am a total idiot where Javascript is concerned!

     

  3. Try this!

    <?php

    $email = "someone@example.com";

    $subject = "Test mail";

    $message = "Hello! This is a simple email message.";

     

    $headers.= "From: someonelse@example.com\n";

    $headers.= "X-Priority: 2\n";

    $headers.= "MIME-Version: 1.0\n";

    $headers.= "Content-Type: text/html; charset=iso-8859-1\n";

     

    if(mail($email, $subject, $message, $headers));

  4. I have some scripts that i run consecutively. How I do it :I make one script out of the seveveral i.e.

    all_at_once.php

    <?php

    ini_set (max_execution_time,600);

    include_once("script1.php");

    include_once("script2.php");

    include_once("script3.php");

    echo"finished";

    ?>

    
    

     

    Then just run all_at_once.php

    I know it's a bit simple but it works for my needs, hope it helps!

     

     

  5. I think that you need the field names in the query:

    $query="INSERT INTO 'table' VALUES

    ('$_POST[street]','$_POST[city]','$_POST[stateabbr]',' $_POST[zipcode])";

     

    should be:

    $query="INSERT INTO 'table' (street, city, stateabbr, zipcode ) VALUES

    ('$_POST[street]','$_POST[city]','$_POST[stateabbr]',' $_POST[zipcode])";

     

  6. ToonMariner is correct the xml should look like this:

    <taxonomy>

      <form id="1" name="category1">

      <taxonomy>

        <form id="2" name="subcategory1">

    </form>

      </taxonomy>

      </form>

      <form id="3" name="category2">

      </form>

      <form id="4" name="category3">

      </form>

    </taxonomy>

  7. I think this will do it

    <?php
    $sql="";
    $search_query=array();
    if(trim($_POST['Designer'])!=="")$search_query[]=" Desiner='$_POST[Designer]' ";
    if(trim($_POST['Style'])!=="")$search_query[]=" Style ='$_POST[style]' ";
    if(trim($_POST['Colour'])!=="")$search_query[]="Colour = '$_POST[Colour]' ";
    $boxes=count($search_query);
    if($boxes==1)
    {
    $detail=implode(" ",$search_query);
    $sql="Where $detail";
    }
    if($boxes>1)
    {
    $sql="Where ";
    $detail=implode(" and ",$search_query);
    $sql.=$detail;
    }
    //put $sql in the mysql query
    ?>

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