Jump to content

ilikephp

Members
  • Posts

    350
  • Joined

  • Last visited

    Never

Posts posted by ilikephp

  1. Hello,

     

    I am using the send mail form, everything is sent to my mail except the country field, it is sending blank.

     

    $name = $_REQUEST['name'] ; 
    $phone = $_REQUEST['phone'] ; 
    $email = $_REQUEST['email'] ; 
    $country = $_REQUEST['country'] ; 
    $message = $_REQUEST['message'] ; 
    
    $headers = "From: $email"; 
    $sent = mail( $to, $subject, $name."\n".$phone."\n".$email."\n".$country."\n".$message, $headers);

     

    How could it be fixed plz?

     

    Thx

  2. Hello,

     

    I need to add rel="..." in the first part of the script but it is not working,

     

    below is the script:

     

    echo " <a href='products/".$image[$abc]."' target='_blank'><img border=0 src='products/thumbs2/".$image[$abc]."' /></a>";

     

     

    Thank you,

  3. Hello!

     

    When I fill my php form in internet explorer or firefox and click on submit, the spry validaitons will be displayed; but using google chrome or safari they are not displayed.

    I tried the form using safari but on localhost, they are displayed but over the internet the form will skip to the database and will not be validated.

     

    What could be the problem plz?

  4. The form is too big, I just need to echo 'Fix your Errors please anywhere, could be next to the submit button'

     

    is this one correct?

    <?php
    if($_POST['form1'] == 0){
        echo 'Check your errors';
    } 
    ?>

  5. Hi, I have a form, it is working fine and it validates using spry...

     

    When the user clicks the submit button and all the fields are filled, he will be redirected to the homepage page if not the required fields will be highlighted, I want to add a message next to the submit button or a popup that displays: "Plz check the errors"

     

    this is the code, I think I should add an echo somewhere ?!

     

    if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) {
      $insertSQL = sprintf(               
          GetSQLValueString($_POST['IP'], "text"));
    
    .
    .
    .
    
      mysql_select_db($database_myform, $myform);
      $Result1 = mysql_query($insertSQL, $myform) or die(mysql_error());
    
    
      if (isset($_SERVER['QUERY_STRING'])) {
        $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
        $insertGoTo .= $_SERVER['QUERY_STRING'];
      }
    header('Location: homepage.php');
    }
    
    ?>
    

  6. I want them to be displayed in the same field with a comma to separate them.

     

    I put this code in the form:

    <input type="checkbox" name="father[]" value="answer 1" /> answer 1</label>  <br /><label>
    <input type="checkbox" name="father[]" value="answer 2" /> answer 2 </label>  <br />
    
    			<?php  $fatherValue = (isset($_POST['father']) ? implode(',', $_POST['father']) : '');  ?>

     

    and in the $insertSQL = sprintf("INSERT INTO ....

    GetSQLValueString($fatherValue, "text"),

     

     

    I dont know if I did something wrong but I am getting Null value in the Mysql database

  7. Hi, I am using this code to display the info in mysql database to dropdown list, it is working good on the localhost, when I upload everything the form is still working fine, but the drop down list are not displaying anything!!

    What could be the problem?

     

    * I did upload all the tables also

     

    <?php
    $query="SELECT ID, nationality FROM nationalities";
    $result = mysql_query ($query);
    
    echo "<select name=first_nationality_father value=''></option>";
    echo "<option value=''>-- Choose one --</option>";
    while($nt=mysql_fetch_array($result)){
    echo "<option value=$nt[nationality]>$nt[nationality]</option>";
    }
    echo "</select>";
    ?>

  8. I tried to put this in my code:

     

    in the insert to database:

    GetSQLValueString($_POST['father'][1], $_POST['father'][2]),

     

    In the form:

    <label>
    <input type="checkbox" name="father[]" value="answer 1" /> answer 1</label>  <br /><label>
    <input type="checkbox" name="father[]" value="answer 2" /> answer 2 </label> <br />

     

     

    I got an error :S

  9. <input type="checkbox" name="father" value="answer 1" />
    answer 1</label>
                        <br />
                        <label>
    <input type="checkbox" name="father" value="answer 2" />
                          answer 2</label>
                        

     

     

  10. THANKS A LOT (Y)

     

    still have one issue:

     

    when the form is submitted successfully the success.php page will open

     

    $insertGoTo = "success.php";

     

     

    if someone tries to put this link www.mywebsite.php/success.php it will be opened, how can I restricted from being viewed unless the form is submitted?

     

     

    Thanks,

  11. I am using the code below, it is working fine, but how can I add to the first line of the list an item without a value like: "Select please"

     

    <?php
    $query="SELECT yearID,year FROM years";
    
    $result = mysql_query ($query);
    echo "<select name=education_level value=''>Education Level</option>";
    
    while($nt=mysql_fetch_array($result)){
    echo "<option value=$nt[yearID]>$nt[year]</option>";
    }
    echo "</select>";
    ?>

  12. Hi,

     

    I am trying to call the data from Mysql but I am getting an empty drop down list, this is the code:

     

     

    mysql:

     

    create table years
    (  yearID integer auto_increment,
       year varchar(30),
       primary key (yearID)
    );
    
    insert into years (yearID, year) values ('1', '2007-2008');
    insert into years (yearID, year) values ('2', '2008-2009');
    insert into years (yearID, year) values ('3', '2009-2010');
    insert into years (yearID, year) values ('4', '2010-2011');
    insert into years (yearID, year) values ('5', '2011-2012');
    insert into years (yearID, year) values ('6', '2012-2013');
    

     

    PHP:

     

    <?php require_once('../Connections/connection.php'); ?>
    <?php
    
    $result = @mysql_query( "select yearID, year, from sss.years");
    
    print "<p>Select a year:\n";
    print "<select name=\"yearID\">\n";
    while ($row = mysql_fetch_assoc($result)){
    $yearID = $row[ 'yearID' ];
    $year = $row[ 'year' ];
    print "<option value=$yearID>$year\n";
    }
    print "</select>\n";
    print "</p>\n";
    ?>

     

     

    Thank you!

  13. this is the code:

     

    <html>
    <body>
    <script type='text/javascript'>
    function update1(a)
    {
    if(a=='1' || a=='2')
    {
    document.getElementById("destination").innerHTML="<select name='combo2'><option>option A</option><option>Option B</option></select>";
    }
    }
    
    </script>
    <form name='form1'>
    <table>
    <p>First:</p>
    <tr>
      <td><select name='combo1'  onChange='update1(this.value)'>
        <option value="" selected>Select</option>
        <option value="1">1</option>
        <option value="2">2</option>
    
      </select></td>
    </tr>
    <tr><td>
      <p><span id='destination'>
        <select name='combo2' disabled='disabled' >
          <option selected>Select combo 1 first</option>
        </select>
      </span></p>
      <p><script type='text/javascript'>
    function update2(a)
    {
    if(a=='1' || a=='2')
    {
    document.getElementById("destination2").innerHTML="<select name='combo4'><option>option A</option><option>Option B</option></select>";
    }
    }
    
    </script></p>
      <p> </p>
      <p>Second</p>
      <p> </p>
      <p>
        <select name='combo3'  onChange='update2(this.value)'>
          <option value="" selected>Select</option>
          <option value="1">1</option>
          <option value="2">2</option>
        </select>
      </p>
      <p>
        <span id='destination2'><select name='combo4' disabled='disabled' >
          <option selected>Select combo 1 first</option>
        </select></span>
      </p></td></tr>
    
    </form>
    </body>
    </html>

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