php

Any knowledge on how to embed an image via PHPmail without using PHPMailer?

I would prefer to use what I already have and just add an image on if possible. Here is my code so far: $to = $Email; $subject = "$auth->first_name $auth->last_name left you a comment"; $message = "$auth->first_name $auth->last_name left you a comment: <br /><br /> <a href='http://www.blah.org/Profile.php?id=" . $prof->id . "'>Click he...

PHP echo duplicate rows when none exist

<html> <head> <title>Test</title> <link rel="stylesheet" type="text/css" href="style.css"> </head> <body> <?php $username ="matt"; $pass = "bs12kfj"; $db = "mytest"; $tbl = "test2"; mysql_connect(localhost,$username,$pass); mysql_select_db($db) or die( "Unable to select database"); $res = mysql_query("SELEC...

PHPDocumentor date problem warnings

I'm having some issues getting phpdoc to run correctly. The docs are being generated for the most part successfully, but I get the following warning many times: Warning: date(): It is not safe to rely on the system's timezone settings. You are required to use the date.timezone setting or the date_default_timezone_set() funct...

PHP Variables from another var

This may sound confusing: $myVar = "Helloooo!"; $text = "myVar"; How could i call $myVar from just the fact $text is filled with the variable name, perhaps this ? (it doesnt work though) echo $($text); All help appreciated!! ...

Codeigniter--add "active" css class to link, how to?

What's the quickest and easiest way to add the "active" class to a link, so it can be styled? I'm developing an app in CI, and I'd like a quick easy way to do this automatically. jQuery is an option too... ...

how to change the output encoding, while displaying a file through php

how to change the output encoding, while displaying a file through php ...

PHP - Loopless way to split a string into a multidimensional array

How do I split a string into a multidimensional array in PHP without loops? My string is in the format "A,5|B,3|C,8" ...

Where's the difference between self and $this-> in a PHP class or PHP method?

Where's the difference between self and $this-> in a PHP class or PHP method? Example: I've seen this code recently. public static function getInstance() { if (!self::$instance) { self::$instance = new PDO("mysql:host='localhost';dbname='animals'", 'username', 'password');; self::$instance-> setAttribute(PDO::ATT...

Can't get the keys in a database to parse as part of an array

I have an table in my database which so far has been great for storing stuff in more than one object. But i want to be able to transform it into a multi-object array thingy. Here is the data which is related to this new 'object' (in mysql): uid field value page:1 shop[2].location In Shops, Dundas Arcades,M...

php email() with image

Hi there Using outlook I can send emails with images inserted into message body(not as attachment). How can i do that using mail() function from PHP? ...

which of this method is recomended - mail function

hay now i want to send mail to 200 users first way $users = 'user1@,user2@,user3,etc'; foreach(explod(',',$users as $mail){ mail($mail,'','',''); } or mail(mail one,mail 2,mail3,mail4,etc) i know the code is fully error but i want the meaning which is the best mail with multi by spreate by , or looping the mail function with the ...

Can I use whereIn in a query with named parameters?

I'm working on a Symfony app that uses Doctrine as the ORM. I want to run a query with an WHERE foo IN (bar) clause, and I'm adding the IN bit like so: $query->andWhereIn('p.foo', $bar); where $bar is an array of id numbers. Browsing the docs and trying out a few combinations, I was unable to make Doctrine treat the parameter I'm pass...

Calling a PHP function

I've got the following function that generates and saves an image based a text parameter. How can I call this in my file? I tried INCLUDE 'outPrice.php'; to link to the external PHP and called it with this command, outPrice($text); To which I got the following response. Warning: Cannot modify header information - headers already...

What does PHP do with strings to numbers when used as array keys?

I'm trying to create an associative array like this: $key = '0' $arr = array((string)$key=>$value); Later, checking is_string(array_keys($arr)[0]) returns false. The casting didn't help, using " instead of ' didn't help. Am I doing something wrong, or is there another way around this, or is it impossible to have a numeric string arr...

retrieve email address from inbox

Hi there Services as linkedin, facebook, etc, can import email addresses(contacts) from my Inbox if I provide my gmail/yahoo password. How are they doing it? Can I do it too, using PHP? ...

Problem using imagecreatefromjpeg and imagejpeg

Hello As per an assignment given to me, I am trying to see the effects of the following two function of php on a image file 1. imagecreatefromjpeg 2. imagejpeg I upload the file using a html and then my php code looks like this: <?php try{ if(!$image=imagecreatefromjpeg('zee1.jpg')){ throw new Exception('Error loading imag...

How to optimize mysql full match

Hey guys, do you know some trick about how can I optimize more a full match search? The code that I'm trying to optimize: $do = $this->select() ->where('MATCH(`name`,`ort`) AGAINST( ? IN BOOLEAN MODE)', $theString) ->order('premium DESC'); The search should search for some companies...and let's say that in the field name ...

Problem printing PHP output on multiple lines

I am newbie to PHP I have written the following program: $address=array('[email protected]','[email protected]','[email protected]'); foreach($address as $value) { echo "processing $value\n"; } If you see I have \n in the echo statement but I am not getting the output on new line. How can I get each output on a new line? ...

What are your templating strategies?

I try to develop my own little framework. For this, I'd like to read up some templating techniques. I know that templating is a really complex topic, but knowing some strategies could help find the right one. Please, if you mention one, don't just write "smarty" for example. Write a little about the concept behind it. Let me start with...

PHP: __set function behaviour different each time

This manages to create a new property on the object. But, can someone explain, with supporting links, why setAttrib behaves in two different ways? Why doesn't it cause a... wait for it... stack overflow!!?? class Test { public function setAttrib( $key, $value ) { echo "setAttrib\n"; // first time: calls $this->__set($key, $...