-
Posts
1,842 -
Joined
-
Last visited
Posts posted by marcus
-
-
just make sure you have $id defined on the pages that need it
-
Try checking if the folder you're trying to move exists
if(is_dir("/new/folder/where/file/is/to/be/stores")){ //rename }else { //fail }
-
well that's the only option i thought of
-
if($id == 1){ echo "<a href=\"/admin/index.php\">Admin Index</a>\n"; }
// admin/index.php if($id != 1){ echo "You are not an admin and cannot be here!\n"; }else { echo "Welcome runnerjp!\n"; }
-
Well try using file_exists before trying to move the first file
$file = "/home/you/public_html/temp/".$_POST['user']."/file.jpg"; if(file_exists($file)){ //rename that to move it }else { //file doesn't exist }
-
What Michan said will work which will convert " to " and < to < etc...
If you just want to remove like bold, italic and other forms of HTML use strip_tags()
for your BBCode you would have to use a form of preg replace or str replace
for bold it would be something like
$find = "/\[b\](.*?)\[\/b\]/is"; $replace = "<b>$1</b>"; $bold_test = "hello my name is [b]marcus[/b]"; echo preg_replace($find, $replace, $bold_test);
-
You can have them act as image submit buttons.
-
Have you tried using the full path?
rename("/home/you/public_html/temp/".$_POST['user']."/file.jpg", "/home/you/public_html/gallery/".$year."/".$month."/".$day."/'.$_POST['user']."-"time()."_m.jpg");
-
that's a lot of usage of the modulus.
<?php echo "<table border=\"1\" cellspacing=\"3\" cellpadding=\"3\">"; $array = array("once", "there", "was", "a", "puppy", "who", "loved", "friendly", "people"); echo "<tr>\n"; $z = round(count($array)/3); $x=1; $y=1; for($i=0;$i<count($array);$i++){ echo "<td>".$array[$i]."</td>\n"; if($x == 3){ echo "</tr>\n"; if($y != $z){ echo "<tr>\n"; } $x=0; $y++; } $x++; } echo "</table>"; ?>
i'd say something like that is a bit simpler
-
I think you want to echo:
$row['id'] //not $id
by the way if you don't want random searches don't include the allowment of "_" being searched
-
Then login isn't defined, just replace $login with login in your query
-
if($_SERVER['HTTP_REFERRER'] == "/start.php"){ echo "HELLO"; }
-
Sure, try echoing $login and see if it really is defined.
-
Can you confirm the values you are trying to process to the database coincide with the database indefinite value?
INT, VARCHAR, TEXT, etc..
-
No, it means there's no value within the two quotes.
Therefore, login isn't defined.
-
$subjbect = $_POST['subject'];
$body = "<h1>Hello, {$row[username]}</h1><br /><br />"; $body .="<p>".$_POST['message']."</p>";
$to = $row['email'];
mail($to, $subject, $body, $headers) or die("Failed to send e-mail");
-
What's the error you have?
Try selecting the database before executing a query, and for queries check for errors
$result = mysql_query($query) or die(mysql_error());
-
$id isn't defined...
-
Does the table even exist.
-
You're changing the wrong query, silly.
-
echo $query;
Try doing something like:
$query = "SELECT * FROM `". $login . "`";
-
You're just asking us to do this for you...
-
if(!ctype_alnum($value)){ $errors[] = "Invalid name"; }
-
There's a couple examples of how to do it on Google, just search "php copy directory"
PHP and the textarea field
in PHP Coding Help
Posted
*to an HTML break