![](https://forums.phpfreaks.com/uploads/set_resources_1/84c1e40ea0e759e3f1505eb1788ddf3c_pattern.png)
fugix
-
Posts
1,483 -
Joined
-
Last visited
Posts posted by fugix
-
-
the leading zeroes could cause an issue... try trimming your values
$var = ltrim($var, '0');
-
what does your mysql table look like?
-
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
-
well you definitely over complicated the upload process..try to shorten your code and decrease the amount of possible things that can go wrong
-
how are you displaying the data?
-
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()
-
Yup, thanks
?
-
also, it doesnt upload to you img dir because you stated that it should go to the dir above that here
define('UPLOAD_DIR', 'C:/upload_test/');
-
same link i posted...lol...just realized my sentence got all jumbled..weird
-
you can set the default timezone ofhere the script by using the function
-
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...
-
same thing happened, no errors came up though
:(
:(
: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...
-
but what im asking is...if you arent able to receive a value when you echo $row['city_name'], then how is it that $row['city_name'] has a value in your option tag..
-
fix your problem?
-
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')";
-
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?
-
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...
-
no errors are triggered?
-
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']; } ?>
-
sorry for being unclear..i'm talking about $gid and $status
-
your host var must be wrong
-
what do you receive when you echo $row['city_name']?
-
where do you assign your $_GET values to variables?
-
sort($a); foreach($a as $key=>$values) { $strpos = strpos($values, "z-"); $values = substr($values,0,$strpos); echo $values; }
send variables
in PHP Coding Help
Posted
please stop bumping your thread(s)..and no your question doesnt make sense to me