-
Posts
1,842 -
Joined
-
Last visited
Posts posted by marcus
-
-
<?php echo " <html> <head> "; if (isset($_POST["submit"])) { include "connect.php"; $name = $_POST['name']; $path = $_POST['path']; $description = $_POST['description']; $date = getdate(); if (strlen($name) < 1 || strlen($path) < 1 || strlen($description) < 1) { print "<table>"; print "<tr><td><center>Trying to add file.</center></td></tr>"; print "<tr><td><center>"; print "One of the required fields was not filled in, please go back and try again"; print "</td></tr></table>"; } else { $posting = "INSERT INTO strata_links (name, path, description,date) values ('$name', '$path', '$description', '$date')"; mysql_query($posting) or die("could not post"); } } else { ?> </head> <body bgcolor="white"> <table align="center" border="1" bordercolor="gray" width="400px"> <tr> <td><form action="<?= $PHP_SELF ?>" method="post"> <font style="font-family:Verdana, Arial, Helvetica, sans-serif; color:#FF0000;">name of file</font><input type="text" name="name" value="name of file" /><br/><br/> <font style="font-family:Verdana, Arial, Helvetica, sans-serif; color:#FF0000;">Complete Path of File:</font><input type="text" name="path" value="Complete Path here"/><br/><br/> <font style="font-family:Verdana, Arial, Helvetica, sans-serif; color:#FF0000;">Description of file:</font><textarea id='7' rows='6' name="description" cols='45'></textarea> <input type="submit" name="submit" value="submit" /></form> </td> </tr> </table> </body> </html> <? } ?>
-
mysql error most likely
<?php include ('connectdb.php'); $sql = "SELECT * FROM `fflists` WHERE `id`='" . $id . "' AND `active`='1' LIMIT 1"; $result = mysql_query($sql) or die(mysql_error()); $num = mysql_num_rows($result); while ($row = mysql_fetch_array($result)) { $business_name = $row['business_name']; $listid = $row['id']; $dcr = $row['dcr']; $add1 = $row['add1']; } ?>
-
<?php $sql = "SELECT * FROM `menu`"; $res = mysql_query($sql) or die(mysql_error()); while($row = mysql_fetch_assoc($res)){ if($owh == $row['url']){ include $row['url2']; }else { include $row['url3']; } } ?>
something like that i suppose.
-
Also if he has error reporting to the max he should get undefined constants.
VALUES('".$row['entry_id']."','".$row['title']."')";
-
try echoing it
<?php echo $_SERVER['PHP_SELF']; ?>
-
$build .= "<td rowspawn=\"2\"><img src=\"thumnails/".$row['thumbnail']."\" title=\"".$row['name']."\"> /></td>\n";
-
eep error in mine.
<?php $get = count($_GET); if($get > 0){ foreach($_GET as $name => $value){ echo $name . " has the value of " . $value . "<br>\n"; } }else { echo "There are no valid get parameters in the URL!"; } ?>
when my url looks like: http://localhost/test/get.php?1=2&3=4&5=6
my results:
1 has the value of 2 3 has the value of 4 5 has the value of 6
when my url looks like: http://localhost/test/get.php
my results:
There are no valid get parameters in the URL!
-
You're missing the semi colon after the $test variable.
-
I completed the loop in about 4 minutes. 1,607,040 results. lol
-
i see.
<?php $get = count($_GET); if($get > 0){ foreach($get AS $name => $value){ echo $name . " has the values of " . $value . "<br>\n"; } }else { echo "There are no valid get parameters in the URL!"; } ?>
-
hmm
<?php function errors($value){ $errors = array(); if(strlen($value) < 3){ $errors[] = "The value must be greater than 3 characters"; }else { if(strlen($value) > 32){ $errors[] = "The value must be less than 32 characters"; } } return $errors; } $error_check = errors('some values'); if(count($error_check) > 0){ foreach($error_check AS $error){ echo $error . "<br>\n"; } }else { echo "No errors, proceed with caution!"; } ?>
-
p2grace, his syntax is fine.
do something like:
<?php $img = mysql_query("SELECT `img` FROM `routes` WHERE `location` = '".mysql_real_escape_string($location)."' AND `destination` = '".mysql_real_escape_string($destination)."'") or die(mysql_error()); if(mysql_num_rows($img) > 0){ $row = mysql_fetch_assoc($img); echo $row['img']; }else { echo "Doesn't exist"; } ?>
-
If you really want to check 50,000+ filenames...
<?php for ($a = 2005; $a <= 2008; $a++) { //year for ($b = 1; $b <= 12; $b++) { //month for ($c = 1; $c <= 31; $c++) { //days for ($d = 1; $d <= 24; $d++) { //hours for ($e = 1; $e <= 60; $e++) { //minutes if (file_exists("test" . $a . $b . $c . $d . $e . ".jpg")) { echo "Filename: " . "test" . $a . $b . $c . $d . $e . ".jpg exists<br>\n"; } } } } } } ?>
-
I get no error, show us the code before that.
-
Lol, he's just showing us an example that if what they selected the hidden value changes to that.
-
Javascript can do it.
And why does Connecticut get "Poop Street," I live in that state, not fair.
-
Try:
function calculate_range($cat, $bool, $range_min, $range_max, $tab = TRUE)
Then do inside the function:
$split_by = $tab ? "\t" : " ";
Then change:
list($_cat, $_bool, $_id, $num) = explode("\t", $line_value);
To:
list($_cat, $_bool, $_id, $num) = explode($split_by, $line_value);
And if you're splitting by just a single space, when calling your function:
calculate_range($cat, $bool, $range_min, $range_max, FALSE);
Add false as your last parameter.
If you're doing by the tab, just keep it:
calculate_range($cat, $bool, $range_min, $range_max);
-
-
If you make your message using HTML, just use nl2br() on it.
-
hehe you're trying to do multiple emails.
try:
<?php $to = $_POST['emailto']; // other variables $ex = explode(";",$to); if(count($ex) > 0){ foreach($ex AS $emails){ $email = trim($emails); mail($email,$subject,$message,$headers); } }else { mail($email,$subject,$message,$headers); } ?>
-
that will remove only OOM not oOm or Oom or ooM or OOm, etc...
-
$result = mysql_query($query) or die(mysql_error());
lol
-
<?php $string = "OOM0100"; if(preg_match("/OOM/is",$string)){ $string = preg_replace("/OOM/is","",$string); } echo $string; ?>
0100
-
Try just echoing $_POST['min'] to see if it's even set.
[SOLVED] PHP Login
in PHP Coding Help
Posted
assign the number 1 to what