-
Posts
4,953 -
Joined
-
Last visited
Everything posted by darkfreaks
-
"echo" Syntax Error Generating Html Code With Php Bits Subed In
darkfreaks replied to kate_rose's topic in PHP Coding Help
Kate: did you escape your array variable with curly braces inside your HEREDOC? it should have output just fine. -
"echo" Syntax Error Generating Html Code With Php Bits Subed In
darkfreaks replied to kate_rose's topic in PHP Coding Help
if you do something like echo <<<EOL //code here EOL; you do not really have to put in dots or quotes to escape or concat. just do something like echo <<<EOL my system is $systems. {$systems[$rand_system][1]} EOL; -
"echo" Syntax Error Generating Html Code With Php Bits Subed In
darkfreaks replied to kate_rose's topic in PHP Coding Help
can you post the full error code please also as Jesi just mentioned you are not concatenate your strings properly. -
Phpmailer, Smtp -> Error: Ehlo Not Accepted From Server:
darkfreaks replied to TheNavigator's topic in PHP Coding Help
In class.smtp.php search for the function Hello Replace: SendHello("EHLO", $host)) with SendHello("EHLO", "[" . $host . "]")) Replace: SendHello("HELO", $host)) with SendHello("HELO", "[" . $host . "]")) -
after researching you need to add mysql_fetch_array inside your select function. <?php function select($amount = "*", $table, $where = NULL, $order = NULL, $limit = NULL){ $query = "SELECT ".$amount." FROM ".$table; if($where !== NULL){ $query .= " WHERE ".$where; } if($order !== NULL){ $query .= " ORDER BY ".$order; } if($limit !== NULL){ $query .= " LIMIT ".$limit; } $result = mysql_query($query); $result_two =mysql_fetch_array($result); if($result_two!==FALSE){ return $result; }else{ return false; } } ?>
-
print_r($newvar); what does it output?
-
cleaned up the function abit not sure if it will help or not. <?php function select($amount = "*", $table, $where = NULL, $order = NULL, $limit = NULL){ $query = "SELECT ".$amount." FROM ".$table; if($where !== NULL){ $query .= " WHERE ".$where; } if($order !== NULL){ $query .= " ORDER BY ".$order; } if($limit !== NULL){ $query .= " LIMIT ".$limit; } $result = mysql_query($query); if($result!==FALSE){ return $result; }else{ return false; } } ?>
-
is select a custom function can we see the code for that???
-
have you tried the identical operator === if($fetch['pageType'] === 1 OR 4) { //***DO Stuff**// }else { echo 'no default pages found.'; }
-
what happens when you do elseif($fetch['pageType'] == 2 OR 3) { echo "NO default page selected";}
-
This will not work as stated sending images outputs X and Y cordinates if(isset($_POST['submit'])) { //** Do Stuff **// } however this will because it includes the X & Y cordinates in the submit. if(isset($_POST['submit_x') && isset($_POST['submit_y'])) { //**DO Stuff**// }
-
remove the error supression @'s and make sure you are not getting any errors in your resize script.
-
you have to make sure nothing else is being output before header() including php code. there are several other ways to achieve this using meta tags and javascript and a combination of both.
-
edit: Remember that header() must be called before any actual output is sent, either by normal HTML tags, blank lines in a file, or from PHP
-
instead of doing $this->$image = imagesy($this->$image); can you put it in a function like so??? (taken from simon jarvis simple image class) public function getWidth(){ return imagesx ($this->$image); } public function getHeight(){ return imagesy ($this->$image); } [color=#000000][b]function[/b][/color] resizeToHeight[color=#009900]([/color][color=#000088]$height[/color][color=#009900])[/color] [color=#009900]{[/color] [color=#000088]$ratio[/color] [color=#339933]=[/color] [color=#000088]$height[/color] [color=#339933]/[/color] [color=#000088]$this[/color][color=#339933]->[/color][color=#004000]getHeight[/color][color=#009900]([/color][color=#009900])[/color][color=#339933];[/color] [color=#000088]$width[/color] [color=#339933]=[/color] [color=#000088]$this[/color][color=#339933]->[/color][color=#004000]getWidth[/color][color=#009900]([/color][color=#009900])[/color] [color=#339933]*[/color] [color=#000088]$ratio[/color][color=#339933];[/color] [color=#000088]$this[/color][color=#339933]->[/color][color=#004000]resize[/color][color=#009900]([/color][color=#000088]$width[/color][color=#339933],[/color][color=#000088]$height[/color][color=#009900])[/color][color=#339933];[/color] [color=#009900]}[/color] [color=#000000][b]function[/b][/color] resizeToWidth[color=#009900]([/color][color=#000088]$width[/color][color=#009900])[/color] [color=#009900]{[/color] [color=#000088]$ratio[/color] [color=#339933]=[/color] [color=#000088]$width[/color] [color=#339933]/[/color] [color=#000088]$this[/color][color=#339933]->[/color][color=#004000]getWidth[/color][color=#009900]([/color][color=#009900])[/color][color=#339933];[/color] [color=#000088]$height[/color] [color=#339933]=[/color] [color=#000088]$this[/color][color=#339933]->[/color][color=#004000]getheight[/color][color=#009900]([/color][color=#009900])[/color] [color=#339933]*[/color] [color=#000088]$ratio[/color][color=#339933];[/color] [color=#000088]$this[/color][color=#339933]->[/color][color=#004000]resize[/color][color=#009900]([/color][color=#000088]$width[/color][color=#339933],[/color][color=#000088]$height[/color][color=#009900])[/color][color=#339933];[/color] [color=#009900]}[/color] [color=#000000][b]function[/b][/color] scale[color=#009900]([/color][color=#000088]$scale[/color][color=#009900])[/color] [color=#009900]{[/color] [color=#000088]$width[/color] [color=#339933]=[/color] [color=#000088]$this[/color][color=#339933]->[/color][color=#004000]getWidth[/color][color=#009900]([/color][color=#009900])[/color] [color=#339933]*[/color] [color=#000088]$scale[/color][color=#339933]/[/color][color=#cc66cc]100[/color][color=#339933];[/color] [color=#000088]$height[/color] [color=#339933]=[/color] [color=#000088]$this[/color][color=#339933]->[/color][color=#004000]getheight[/color][color=#009900]([/color][color=#009900])[/color] [color=#339933]*[/color] [color=#000088]$scale[/color][color=#339933]/[/color][color=#cc66cc]100[/color][color=#339933];[/color] [color=#000088]$this[/color][color=#339933]->[/color][color=#004000]resize[/color][color=#009900]([/color][color=#000088]$width[/color][color=#339933],[/color][color=#000088]$height[/color][color=#009900])[/color][color=#339933];[/color] [color=#009900]}[/color] [color=#000000][b]function[/b][/color] resize[color=#009900]([/color][color=#000088]$width[/color][color=#339933],[/color][color=#000088]$height[/color][color=#009900])[/color] [color=#009900]{[/color] [color=#000088]$new_image[/color] [color=#339933]=[/color] [color=#990000]imagecreatetruecolor[/color][color=#009900]([/color][color=#000088]$width[/color][color=#339933],[/color] [color=#000088]$height[/color][color=#009900])[/color][color=#339933];[/color] [color=#990000]imagecopyresampled[/color][color=#009900]([/color][color=#000088]$new_image[/color][color=#339933],[/color] [color=#000088]$this[/color][color=#339933]->[/color][color=#004000]image[/color][color=#339933],[/color] [color=#cc66cc]0[/color][color=#339933],[/color] [color=#cc66cc]0[/color][color=#339933],[/color] [color=#cc66cc]0[/color][color=#339933],[/color] [color=#cc66cc]0[/color][color=#339933],[/color] [color=#000088]$width[/color][color=#339933],[/color] [color=#000088]$height[/color][color=#339933],[/color] [color=#000088]$this[/color][color=#339933]->[/color][color=#004000]getWidth[/color][color=#009900]([/color][color=#009900])[/color][color=#339933],[/color] [color=#000088]$this[/color][color=#339933]->[/color][color=#004000]getHeight[/color][color=#009900]([/color][color=#009900])[/color][color=#009900])[/color][color=#339933];[/color] [color=#000088]$this[/color][color=#339933]->[/color][color=#004000]image[/color] [color=#339933]=[/color] [color=#000088]$new_image[/color][color=#339933];[/color] [color=#009900]}[/color]
-
Mysql_Pconnect And General Bad Practice...
darkfreaks replied to Drongo_III's topic in PHP Coding Help
i would not consider 800 a week high volume traffic more like Normal. i would probably switch to mysql_connect until you hit a good 10,000+ visitors a day/week/month. -
Mysql_Pconnect And General Bad Practice...
darkfreaks replied to Drongo_III's topic in PHP Coding Help
here is your answer @ OP Mysql_pconnect will also open a new connection when a PHP page is called up (at any rate, it will the first time after a server reboot), but it will NOT close the connection at the end of the request - instead, it will save it in a connection pool so that a subsequent request can continue to use the same connection. It's intended for pages that do have a heavy usage - where the resources burn up by opening and closing connections every time might have a severe effect on performance. If your local supermarket had a door that was opened each time someone went in and out, there would be a lot of needless opening and closing going on - better to leave it open and let a whole lot of people in and out at the same time. Mysql_connect opens a new connection each time a PHP page is called up, and closes the connection down again at the end of the request. It's ideal for pages that don't have a heavy usage - doesn't need tuning, is straightforward internally. If you compare MySQL to a shop, this is the connection that you would use for a small shop where the door is opened each time a new customer wishes to enter. -
mysql_real_escape_string() needs a database connection identifier link to work if no database connection is called it is not going to work.
-
i don't see the output but it looks like his works fine. it does combine both array properly.
-
why do you have combine twice? do it his way first tell us what it outputs then do it my way tell us what it outputs. not both.
-
if you don't want it to rewrite the array data you can do something like $combine = $player+$count; $result= implode($combine);
-
http://php.net/array_combine
-
adding isset() to make sure values are set. <?php $name= isset($_POST['name']) ? $_POST['name'] : ''; $subject = isset($_POST['subject']) ? $_POST['subject'] : ''; $email = isset($_POST['email']) ? $_POST['email'] : ''; $message = isset($_POST['message']) ? $_POST['message'] : ''; $to = "[email protected]"; headers = "From: \"".$name."\" <".$email.">\n"; $headers .= "Return-Path: <".$email.">\n"; mail($to,$subject,$message,$headers) or die("Something went wrong, please go back and try again."); echo "Thank you for contacting me."; ?> if there is nothing in the value that value will just send blank. if it is not sending at all as mentioned output each variable with print_r and tell us what the output is.
-
@Jessica it is a dreamweaver effect using javascript and css. http://www.communitymx.com/content/source/CDC72/
-
Added reply-to & FROM headers if you still are wanting to use Mail over a more advanced class like PHPMailer. <?php $name = $_POST['name']; $subject = $_POST['subject']; $email = $_POST['email']; $message = $_POST['message']; $to = "[email protected]"; headers = "From: \"".$name."\" <".$email.">\n"; $headers .= "Return-Path: <".$email.">\n"; mail($to,$subject,$message,$headers) or die("Something went wrong, please go back and try again."); echo "Thank you for contacting me."; ?>