Jump to content

fugix

Members
  • Posts

    1,483
  • Joined

  • Last visited

Posts posted by fugix

  1. i notice that in this line

    $uploadfile = $target_path . basename($_FILES[uploadedfile][name][$key]);

    your forget to quote your indices and should be

    $uploadfile = $target_path . basename($_FILES['uploadedfile']['name'][$key]);

    also, you assign a value to $id twice...so your $_POST['id'] is being overwritten

  2. i still need the numbers at the end of the strings/values then on the end when echoing it. i just need the sort(); function to ignore them (the numbers at the end behind -aa-zz-) when sorting. the sort(); should sort only till aa-zz- and not by the number at the end. :)

     

    for example, this doesn't work the right way now:

     

    <?php
    $a=array(
    '222-aa-zz-6',
    '333-aa-zz-5',
    '333-aa-zz-4'
    );
    sort($a);
    foreach($a as $key=>$values){
    
    $strpos=strpos($values, "z-");
    $values1=substr($values,0,$strpos);
    echo $values.' ('.$values1.')<br />';
    }
    ?>

     

    as it echoes this:

     

    222-aa-zz-6 (222-aa-z)

    333-aa-zz-4 (333-aa-z)

    333-aa-zz-5 (333-aa-z)

     

    instead of this:

     

    222-aa-zz-6 (222-aa-z)

    333-aa-zz-5 (333-aa-z)

    333-aa-zz-4 (333-aa-z)

    thought thats what you wanted...and abra is right... the numbers on the end are irrelevant when using sort()

  3. what exactly is your issue? and mysql_close() will close the connection to the mysql server that is associated with the link identifier...but is not actually necessary here because the connection will automatically close when the script is finished executing...

  4. same thing happened, no errors came up though  :( :( :( :( :confused: :confused: :confused:

    well if you didnt receive the error in the else statement then your file must have been moved..perhaps if you add some more smileys to your posts your question might be resolved... ;D

  5. this

    $query = "INSERT INTO contact_us (rate_us,your_name,email,your_comments)"."VALUES ('$rate_us','$your_name','$email','$your_comments');

    should be

    $query = "INSERT INTO contact_us (rate_us,your_name,email,your_comments) VALUES ('$rate_us','$your_name','$email','$your_comments')";

  6. if nothing works than how is your option tag being populated with your city_name?

    echo "<option value='{$row['city_code']}'>{$row['city_name']}</option>";

    how would i go POST the city_name when pushing submit, if it's even possible?

    what exactly are you trying to ask?

  7. have you tried inserting some code to debug?

    if (move_uploaded_file($_FILES['uploadedfile']['tmp_name'][$key], $uploadfile)) { echo $value . ' uploaded<br>'; }else {echo "error";}

    etc...

  8. its blank because you are trying to echo it outside of your while loop ....try

    echo "<form method='POST' action =''>";
    echo "<select name='cityd'>";
    while($row = mysql_fetch_array($res))
    {
    echo "<option value='{$row['city_code']}'>{$row['city_name']}</option>";
    }
    echo "</select>";
    echo "<input type='submit' name='weaCode' value='Submit'/>";
    echo "</form>";
    echo $_POST["cityd"];
    while($row = mysql_fetch_array($res))
    {
    echo $row['city_name'];
    }
    ?>

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