|
Is your file saved as utf8 (better without bom)?
Also you should add in your html
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
...Plug & Pray...
|
|
|
|
|
Yes I do.
Anyway I have found the solution myself. PHP.ini configured incorrectly with multi-bite strings. Now everything working fine.
I appreciate your help all the time...
CodingLover
|
|
|
|
|
Hi,all
This is My Php Code
<?php
$from = "someone@something.com";
$to = "someone@something.com";
$subject = "Hi!";
$body = "Hi,\n\nHow are you?";
$host = "myhost";
$username = "mail@myhost.com";
$password = "something";
$port=25;
$headers = array ('From' => $from,'To' => $to,'Subject' => $subject);
$smtp = Mail::factory('smtp',array ('host' => $host ,'port' => $port , 'auth' => true , 'username' => $username,'password' => $password));
Now How Can i Call mail(); Function?
Please Help Me
Arunkumar.t
Arunkumar.
|
|
|
|
|
Is this what you are searching for Example 1[^] ?
[Edit]
Example 2 [^]
[/Edit]
Regards
modified on Saturday, June 4, 2011 6:23 AM
|
|
|
|
|
I Know The Mail Function In php
I want to know how can i pass the smtp information through mail() function
|
|
|
|
|
i try to upload videos to youtube using zend library , but i have a problem that i may upload a video that is already uploaded (duplicate) , so the youtube refuses to upload it , i need to know the id of the duplicate video that was uploaded before .
please if any body can help me...
thanks in advance
|
|
|
|
|
Hi All,
I am getting null value for some virtual machines.
Do anybody have any idea regarding permissions that we need to get this object from machines.
Thanks
|
|
|
|
|
To codeproject.com forum,
This is question about script
http://obiewebsite.sourceforge.net/obie.php?Mini_Web_Shop
As the script is released in 2004 there is no much online
documentation except those brief help file from author
Here is the one working example
http://emarfa.3x.ro/store/admin.php?act=conf
but most other online installations are not functional as I suppose during
php version incompatibilities
http://gillhov.tripod.com/miniwebshop/miniwebshop/index.php
and other sites..
So I am asking interested to review installation setup and examine this script and post some
suggestions with details, modifications or something?
Best greetings,
Nik P.
|
|
|
|
|
hello everyone! i want to upload photo, i have tag img and button (i dont use type="file") i want to write code to open directory as type="file" on button, but i can't solve it. please help me!
regard
thanks!
|
|
|
|
|
use tag input, not button
A hidden needle is way more effective than an unsheathed sword.
That is, in the hand of professionals.
What about you?
Just pray your enemies are blind
|
|
|
|
|
First time developing in PHP. Used to coding in c#, so feel free to make fun of me.
Here is the code I am using:
<?php
$response = file_get_contents($url);
$jsonResults = json_decode($response, true);
echo "Title: ".$jsonResults['items']['0']['volumeInfo']['title'];
echo "Title: ".$jsonResults['items']['1']['volumeInfo']['title'];
for ($i = 0; $i < $jsonResults['items'].length; $i++) {
echo "Link: ".$jsonResults['items'][$i]['volumeInfo']['title'];
}
?>
Now the json results look like this:
array(3) {
["items"]=>
array(10) {
[0]=>
array(7) {
<snipped>
["volumeInfo"]=>
array(12) {
["title"]=>
string(64) "MyTitle"
<snipped>
}
*****************
"We need to apply 21st-century information technology to the health care field. We need to have our medical records put on the I.T." —GW
|
|
|
|
|
PHP doesn't use the . operator for class members. If $jsonResults['items'] was an instance of a class, then the way to access the length member would be $jsonResults['items']->length .
Native arrays are not classes though, so to find their length you need to use the count function:
<?php
$length = count($jsonResults['items']);
for($i = 0; $i < $length; $i++) {
echo "Link: ".$jsonResults['items'][$i]['volumeInfo']['title'];
}
or you could use foreach instead of for :
<?php
foreach($jsonResults['items'] as $item) {
echo "Link: ".$item['volumeInfo']['title'];
}
|
|
|
|
|
I always sizeof() thou
A hidden needle is way more effective than an unsheathed sword.
That is, in the hand of professionals.
What about you?
Just pray your enemies are blind
|
|
|
|
|
Thank you both!
*****************
"We need to apply 21st-century information technology to the health care field. We need to have our medical records put on the I.T." —GW
|
|
|
|
|
Hi there,
I'm quiet new to the PHP language, tho I have mostly programmed in C# in .NET platforms. Now I want to get some experience with the opensource part of the web development.
I know the basic coding for PHP (the syntax), but I'm not sure about which app is the best to make dynamic PHP programming in (like MS Visual Studio for C#), which patterns is a most, which do I have to code by hand, and which can be autogenerated by the developer app?
I'm especially curious about the possibilities of doing DataMapping, like DataBase Markup Language/LinQ to SQL in Visual Studio for C#, where Database tables are being related to code objects like:
UML diagram:
http://yuml.me/diagram/scruffy/class/[Phones]1->*[Category]
Code with ORM to the DB table:
Phone p = new Phone();
Or how do you guys handle objects in PHP, where Foreinger keys between tables can happen, in a easy way?
|
|
|
|
|
|
Cheers, will look at the possibilities.
So, when you have to program a PHP web app by your own, do you hand code all patterns needed to control objects between each others? Like controlling FKs between relations.
|
|
|
|
|
yes I hand code it, including table/data relations. But I have what I guess would be a custom pattern I have developed over the years and find it able to adjust and handle any web/app I can toss at it while still being readable and flexible.
Chris J
www.redash.org
|
|
|
|
|
|
Hey CodeProject!
So I'm trying to make a query in PHP and mySQL..
One of the database tables has a value I want to SELECT DISTINCT while selecting everything else regularly with an asterisk (*).
Example:
<br />
<br />
$model_select = "select DISTINCT model FROM models where shw=1 ORDER BY modelid";<br />
$model_select = "select * FROM models where shw=1 ORDER BY modelid";<br />
<br />
Is there a way I can do both DISTINCT and * in the same query command? Or is there a way around this without making 2 queries?
It would be great if I could 'cause I'm using the mysql_fetch_array thing.
Thanks.
-Paul
|
|
|
|
|
I don't know, however I think it can't be done because the results would be undefined.
Assume the MODELS table holds the following data:
field1 field2
1 2
1 3
1 4
5 6
7 8
7 9
If you do "SELECT DISTINCT field1 FROM MODELS" you would get 1, 5, and 7.
Now there are three rows with field1=1, which field2 value should contribute to the result?
Assuming "SELECT field2, DISTINCT(field1) FROM MODELS" would be accepted, the field2 values would be unpredictable, i.e. the query is ambiguous.
Things would make more sense if you would need, and were allowed to do, the following:
"SELECT MAX(field2), DISTINCT(field1) FROM MODELS"
PS: this isn't a PHP question, it is a database related question, the MySQL forum would have been a better choice.
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
I think you can use
select distinct * from tablename where col='mycondition'
or you may select only required columns, if you get unexpected rows
select distinct model,col1,col2,col2 from tablename where col='mycondition'
|
|
|
|
|
A sub-select with a GROUP_CONCAT should do it....although I have not test this query.
select GROUP_CONCAT((select DISTINCT model FROM models where shw=1 ORDER BY modelid)) as mod_name, * FROM models where shw=1 ORDER BY modelid
this would return the subselect as a comma seperated value on each row by a column named "mod_name".
I would advise that you do not use the "*" in the other query as this forces mysql to do a secondary query to find and return the column names for the table models, it is better to just set them in the query to improve performance.
Chris J
www.redash.org
|
|
|
|
|
Hi All,
<?php
echo "Hello World";
?>
This index.php is not outputting anything to the browser but I can copy this file to another computer and it works as expected. Also, on the problem machine phpinfo() works fine and displays everything you'd expect.
I'm running Ubuntu 11.04 32-bit, Apache 2.2.17, and PHP 5.3.5-1. I'm guessing there must be something wrong with the php configuration but I haven't a clue as to what that might be. I've also tried print() as well and get the same results.
Suggestions?
Thanks much for any help...
|
|
|
|
|
First, I would check that the page is actually blank, and not just serving the PHP as HTML.
The next thing I would check is the file permissions.
After that I would take a look at the server log to see if there are any errors reported there.
Next, I would make sure display_errors and error_reporting are turned on and insert an error into the page to make sure it is actually being executed.
|
|
|
|