php-general Digest 1 Nov 2010 06:56:10 -0000 Issue 7015
Topics (messages 309172 through 309190):
Re: questions about if statements regarding a checkbox
309172 by: admin.buskirkgraphics.com
309177 by: tedd
309182 by: Ben Brentlinger
309183 by: Ben Brentlinger
Problem with "shell_exec"
309173 by: Boyan Penev
309174 by: admin.buskirkgraphics.com
309179 by: Boyan Penev
309187 by: admin.buskirkgraphics.com
Re: Watermark with GD
309175 by: tedd
309178 by: Gary
309181 by: tedd
309188 by: Tamara Temple
Re: search is not case insensitive
309176 by: tedd
Integrating zend-facebook error
309180 by: Yuri Yarlei
a question about user and permission on linux
309184 by: Ryan Sun
309185 by: [email protected]
309186 by: [email protected]
Re: Mail delivery failed: returning message to sender
309189 by: Tamara Temple
309190 by: [email protected]
Administrivia:
To subscribe to the digest, e-mail:
[email protected]
To unsubscribe from the digest, e-mail:
[email protected]
To post to the list, e-mail:
[email protected]
----------------------------------------------------------------------
--- Begin Message ---
I placed an example of your code on my site.
I simply pasted exactly what you had, minus the actual mailing portion.
If you check the box you will see the array, if you do not check the box no
array.
http://www.richardbuskirk.com/blunk.php
Forgive my prior post, I had not woke up yet.
So the wording is missing things though, yet not put to email mid sentence.
Code from site.
<?php
if(isset($_POST['reallife']))
{
print_r($_POST);
}
?>
<form action=? method=post>
<div align="center">
<table border="0"
cellpadding="3" cellspacing="0" width="59%">
<tr>
<td colspan="2">
<h2 align="center"> </h2>
<h2 align="center"><font color="blue" face="Arial">Contact Form</font></h2>
<p align="center"> </p>
<td width="51%" align="right">
<p align="left"><font face="Arial">Email</font><font face="Times New
Roman">:</font><font face="Arial"> </font></td>
<td width="49%" align="left"><input type="text" name="email" size="20"></td>
</tr>
<tr>
<td width="51%" align="right">
<p align="left"><font face="Arial">First Name: </font></td>
<td width="49%" align="left"><input type="text" name="firstname"
size="20"></td>
</tr>
<tr>
<td width="51%" align="right">
<p align="left"><font face="Arial">Last Name: </font></td>
<td width="49%" align="left"><input type="text" name="lastname"
size="20"></td>
</tr>
<tr>
<td width="51%" align="right">
<p align="left"><font face="Arial">I know you in real life</font></td>
<td width="49%" align="left"><input type="checkbox" name="reallife"
size="20"></td>
</tr>
</table>
<p><input type="submit" value="contact me"
name="B1"></p>
</center></div>
</form>
</td>
<td> </td>
</tr>
</table>
Richard L. Buskirk
-----Original Message-----
From: [email protected] [mailto:[email protected]]
Sent: Sunday, October 31, 2010 10:37 AM
To: 'Ben Brentlinger'; [email protected]
Subject: RE: [PHP] questions about if statements regarding a checkbox
I tested your code and besides adding a form to the beginning it works.
If you want to see the results of the posted for try.
print_r($_POST);
you can see every position of the array passed and validate they are passing as
intended.
Try this.
//if reallife is not set (Checked it will not pass)
// I am pretty sure I read where someone had responded with the isset
if(isset($_POST['reallife']))
{
print_r($_POST);
}
Richard L. Buskirk
-----Original Message-----
From: Ben Brentlinger [mailto:[email protected]]
Sent: Sunday, October 31, 2010 8:26 AM
To: [email protected]
Subject: Re: [PHP] questions about if statements regarding a checkbox
Here's the code I'm using with the exception of the php tags and the
redirect script that redirects to another page once the form is
submitted. This is just a test script I'm working on in order to teach
myself php. The php portion will be posted first, than the html form
related to the php. I've got the code inside tags similar to the "code"
tag which only serves to serarate the php code from the html form.
[php_code]
$name = $_POST['firstname'] . ' ' . $_POST['lastname'];
$email = $_POST['email'];
if($_POST['reallife'] == "on")
{
$to = '[email protected]';
$subject ='test email one';
$msg = "$name has filled out the test form. \n" .
"this is just a test message";
mail ($to, $subject, $msg, 'From:' . $email);
} else {
$to = '[email protected]';
$subject ='test email two';
$msg = "$name has filled out the test form." ;
mail ($to, $subject, $msg, 'From:' . $email);
}
if($_POST['reallife'] == "on") {
$to = '$email';
$subject = "Thank you email number one";
$msg = "hello $name, \n" .
"thank you for filling out the form. \n" .
"This is the first of two test emails \n" .
"The second would have been sent \n" .
"if you had left the checkbox unchecked \n";
mail ($to, $subject, $msg, 'From:' . [email protected]);
}
header ("location:thankyoupage")
[/php_code]
[html_code]
<div align="center">
<table border="0"
cellpadding="3" cellspacing="0" width="59%">
<tr>
<td colspan="2">
<h2 align="center"> </h2>
<h2 align="center"><font color="blue" face="Arial">Contact Form</font></h2>
<p align="center"> </p>
<td width="51%" align="right">
<p align="left"><font face="Arial">Email</font><font face="Times New
Roman">:</font><font face="Arial"> </font></td>
<td width="49%" align="left"><input type="text" name="email" size="20"></td>
</tr>
<tr>
<td width="51%" align="right">
<p align="left"><font face="Arial">First Name: </font></td>
<td width="49%" align="left"><input type="text" name="firstname"
size="20"></td>
</tr>
<tr>
<td width="51%" align="right">
<p align="left"><font face="Arial">Last Name: </font></td>
<td width="49%" align="left"><input type="text" name="lastname"
size="20"></td>
</tr>
<tr>
<td width="51%" align="right">
<p align="left"><font face="Arial">I know you in real life</font></td>
<td width="49%" align="left"><input type="checkbox" name="reallife"
size="20"></td>
</tr>
</table>
<p><input type="submit" value="contact me"
name="B1"></p>
</center></div>
</form>
</td>
<td> </td>
</tr>
</table>
[/html_code]
This actual code that is on the portion of my hosting account which I
use as my test server. In my opinion, it's much cheaper to pay for a
hosting account to use as a test server to teach myself php than it is
to pay some collage professor to teach it to you only to be slapped in
the face by having him assume you're learning php to be a freelance
coder working for a company that does freelance work. The truth is, I
only have an interest in learning php to use in my own business and when
I get good enough, I may do some freelancing on the side on sites like
Scriptlance, but my main focus will be my own business and for anyone to
have the audacity that I plan on working for someone else my whole life
pisses me off, so that's why I'd much rather teach myself than to take a
college class on php.
Thanks,
Ben
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
At 10:05 PM -0400 10/30/10, Ben Brentlinger wrote:
hello,
I'd like to know the proper code to use in a php script that
processes a form with a checkbox in order to send one email if the
checkbox has been checked and another email if the checkbox hasn't.
I tried if($check == true) and I tried putting the word "true" in
double quotes, and both of them caused the "unexpected variable"
syntax error. The only problem is, all I could think to use was
that line of code I just used, I'm not sure what the proper syntax
is for checkbox when using the if statement to send one email when
the checkbox is checked and a different email when it's not checked.
I'm wanting to send an email to the site admin with the information
given by the person who filled out the form that contains the
checkbox.
Thanks,
Ben
Ben:
Here you go:
http://php1.net/b/form-checkbox/
and if you want to make it sticky:
http://php1.net/b/form-checkbox1/
Cheers,
tedd
--
-------
http://sperling.com/
--- End Message ---
--- Begin Message ---
thanks for your help. I just retested my code and even though it didn't
work, I found the reason it wasn't working was because I had an unneeded
space between the "if" and the rest of the if statement.
--- End Message ---
--- Begin Message ---
Also, as far as the form is concerned, I actually did have the form in a
separate .htm file, I just put the two together, separating them with
the those tags to make them easier to read in the email.
On 10/31/2010 10:36, [email protected] wrote:
I tested your code and besides adding a form to the beginning it works.
If you want to see the results of the posted for try.
print_r($_POST);
you can see every position of the array passed and validate they are passing as
intended.
Try this.
//if reallife is not set (Checked it will not pass)
// I am pretty sure I read where someone had responded with the isset
if(isset($_POST['reallife']))
{
print_r($_POST);
}
Richard L. Buskirk
-----Original Message-----
From: Ben Brentlinger [mailto:[email protected]]
Sent: Sunday, October 31, 2010 8:26 AM
To: [email protected]
Subject: Re: [PHP] questions about if statements regarding a checkbox
Here's the code I'm using with the exception of the php tags and the
redirect script that redirects to another page once the form is
submitted. This is just a test script I'm working on in order to teach
myself php. The php portion will be posted first, than the html form
related to the php. I've got the code inside tags similar to the "code"
tag which only serves to serarate the php code from the html form.
[php_code]
$name = $_POST['firstname'] . ' ' . $_POST['lastname'];
$email = $_POST['email'];
if($_POST['reallife'] == "on")
{
$to = '[email protected]';
$subject ='test email one';
$msg = "$name has filled out the test form. \n" .
"this is just a test message";
mail ($to, $subject, $msg, 'From:' . $email);
} else {
$to = '[email protected]';
$subject ='test email two';
$msg = "$name has filled out the test form." ;
mail ($to, $subject, $msg, 'From:' . $email);
}
if($_POST['reallife'] == "on") {
$to = '$email';
$subject = "Thank you email number one";
$msg = "hello $name, \n" .
"thank you for filling out the form. \n" .
"This is the first of two test emails \n" .
"The second would have been sent \n" .
"if you had left the checkbox unchecked \n";
mail ($to, $subject, $msg, 'From:' . [email protected]);
}
header ("location:thankyoupage")
[/php_code]
[html_code]
<div align="center">
<table border="0"
cellpadding="3" cellspacing="0" width="59%">
<tr>
<td colspan="2">
<h2 align="center"> </h2>
<h2 align="center"><font color="blue" face="Arial">Contact Form</font></h2>
<p align="center"> </p>
<td width="51%" align="right">
<p align="left"><font face="Arial">Email</font><font face="Times New
Roman">:</font><font face="Arial"> </font></td>
<td width="49%" align="left"><input type="text" name="email" size="20"></td>
</tr>
<tr>
<td width="51%" align="right">
<p align="left"><font face="Arial">First Name:</font></td>
<td width="49%" align="left"><input type="text" name="firstname"
size="20"></td>
</tr>
<tr>
<td width="51%" align="right">
<p align="left"><font face="Arial">Last Name:</font></td>
<td width="49%" align="left"><input type="text" name="lastname"
size="20"></td>
</tr>
<tr>
<td width="51%" align="right">
<p align="left"><font face="Arial">I know you in real life</font></td>
<td width="49%" align="left"><input type="checkbox" name="reallife"
size="20"></td>
</tr>
</table>
<p><input type="submit" value="contact me"
name="B1"></p>
</center></div>
</form>
</td>
<td> </td>
</tr>
</table>
[/html_code]
This actual code that is on the portion of my hosting account which I
use as my test server. In my opinion, it's much cheaper to pay for a
hosting account to use as a test server to teach myself php than it is
to pay some collage professor to teach it to you only to be slapped in
the face by having him assume you're learning php to be a freelance
coder working for a company that does freelance work. The truth is, I
only have an interest in learning php to use in my own business and when
I get good enough, I may do some freelancing on the side on sites like
Scriptlance, but my main focus will be my own business and for anyone to
have the audacity that I plan on working for someone else my whole life
pisses me off, so that's why I'd much rather teach myself than to take a
college class on php.
Thanks,
Ben
--- End Message ---
--- Begin Message ---
Hello,
i have installed php 5.2.14 on an embedded system. I have run a couple of
test scripts and everything works fine,
but i can't get "shell_exec" to work. When i invoke "shell_exec", the
script doesn't get interpreted, instead
i get prompted to download the whole .php file. I have tried both /bin/php
and /bin/php-cgi- same problem.
When i try to execute it per command line instead of web server, with both
php and php-cgi i get "Segmentation fault"
and nothing happens. I use busybox http as a web server, if it's relevant.
Does anybody have an idea what the problem
might be? Any help would be appreciated.
Best regards,
Boyan
--- End Message ---
--- Begin Message ---
It seems most probably a permission problem. If I were you I would
check the permissions on the bin directory and the files in it. PHP
will probably run under the uid of the webserver, which, on most
systems is either "apache" or "nobody" depending on the configuration.
Richard L. Buskirk
-----Original Message-----
From: Boyan Penev [mailto:[email protected]]
Sent: Sunday, October 31, 2010 11:16 AM
To: [email protected]
Subject: [PHP] Problem with "shell_exec"
Hello,
i have installed php 5.2.14 on an embedded system. I have run a couple of
test scripts and everything works fine,
but i can't get "shell_exec" to work. When i invoke "shell_exec", the
script doesn't get interpreted, instead
i get prompted to download the whole .php file. I have tried both /bin/php
and /bin/php-cgi- same problem.
When i try to execute it per command line instead of web server, with both
php and php-cgi i get "Segmentation fault"
and nothing happens. I use busybox http as a web server, if it's relevant.
Does anybody have an idea what the problem
might be? Any help would be appreciated.
Best regards,
Boyan
--- End Message ---
--- Begin Message ---
Hello Richard,
thank you for the prompt reply. I just tried to follow your suggestion, but
i couldn't solve my problem:
1. I have started the server with user "nobody". All the binaries i was
trying to execute(e.g. /bin/ls) were "chown"-ed to the user "nobody"
Problem presisted. Than i "chown" -ed /var/www to the user "nobody". Than
the php and php-cgi interpreters as well- same thing.
I tried the same with users "adm" and even "root"
2. I than gave the executables all the permissions possible("777"- i know it
is dangerous, but i am just testing)- still nothing.
I copied the binaries from /bin to /var/www and tried to execute them
with all kinds of permissions and "chown"'s- didn't work
3. Than i moved to the command line interpreter: i tried to execute it in
/var/www and in the home folder. The permissions were also adjusted. I
executed it with root privileges- i always get "Segmentation fault". One
more thing- if i omit the arguments in shell_exec( "$output = shell_exec();)
i get "Missing parameters" but no "Segmentation fault"
Boyan
On Sun, Oct 31, 2010 at 4:34 PM, <[email protected]> wrote:
> It seems most probably a permission problem. If I were you I would
> check the permissions on the bin directory and the files in it. PHP
> will probably run under the uid of the webserver, which, on most
> systems is either "apache" or "nobody" depending on the configuration.
>
> Richard L. Buskirk
>
>
> -----Original Message-----
> From: Boyan Penev [mailto:[email protected]]
> Sent: Sunday, October 31, 2010 11:16 AM
> To: [email protected]
> Subject: [PHP] Problem with "shell_exec"
>
> Hello,
>
> i have installed php 5.2.14 on an embedded system. I have run a couple of
> test scripts and everything works fine,
> but i can't get "shell_exec" to work. When i invoke "shell_exec", the
> script doesn't get interpreted, instead
> i get prompted to download the whole .php file. I have tried both /bin/php
> and /bin/php-cgi- same problem.
> When i try to execute it per command line instead of web server, with both
> php and php-cgi i get "Segmentation fault"
> and nothing happens. I use busybox http as a web server, if it's relevant.
> Does anybody have an idea what the problem
> might be? Any help would be appreciated.
>
> Best regards,
>
> Boyan
>
>
--- End Message ---
--- Begin Message ---
After going over this a thousand times in my head and on sever.
Here are a few reasons why a shell_exec will not function.
First I tested the PHP CLI
Can I see my version of php.
$output = shell_exec('php -v');
Echo $output;
If I am not getting the information about the php version. Is shell_exec for
php and http on?
In your php.ini file there will be a section called disable_functions.
If you are sure that shell_exec is not in the list.
If neither of these are an issue for you, It has to be a permissions issue.
I do not claim to be an expert in the shell_exec area of php, I cannot
duplicate your error.
Richard L. Buskirk
-----Original Message-----
From: Boyan Penev [mailto:[email protected]]
Sent: Sunday, October 31, 2010 12:26 PM
To: [email protected]
Cc: [email protected]
Subject: Re: [PHP] Problem with "shell_exec"
Hello Richard,
thank you for the prompt reply. I just tried to follow your suggestion, but
i couldn't solve my problem:
1. I have started the server with user "nobody". All the binaries i was
trying to execute(e.g. /bin/ls) were "chown"-ed to the user "nobody"
Problem presisted. Than i "chown" -ed /var/www to the user "nobody". Than
the php and php-cgi interpreters as well- same thing.
I tried the same with users "adm" and even "root"
2. I than gave the executables all the permissions possible("777"- i know it
is dangerous, but i am just testing)- still nothing.
I copied the binaries from /bin to /var/www and tried to execute them
with all kinds of permissions and "chown"'s- didn't work
3. Than i moved to the command line interpreter: i tried to execute it in
/var/www and in the home folder. The permissions were also adjusted. I
executed it with root privileges- i always get "Segmentation fault". One
more thing- if i omit the arguments in shell_exec( "$output = shell_exec();)
i get "Missing parameters" but no "Segmentation fault"
Boyan
On Sun, Oct 31, 2010 at 4:34 PM, <[email protected]> wrote:
> It seems most probably a permission problem. If I were you I would
> check the permissions on the bin directory and the files in it. PHP
> will probably run under the uid of the webserver, which, on most
> systems is either "apache" or "nobody" depending on the configuration.
>
> Richard L. Buskirk
>
>
> -----Original Message-----
> From: Boyan Penev [mailto:[email protected]]
> Sent: Sunday, October 31, 2010 11:16 AM
> To: [email protected]
> Subject: [PHP] Problem with "shell_exec"
>
> Hello,
>
> i have installed php 5.2.14 on an embedded system. I have run a couple of
> test scripts and everything works fine,
> but i can't get "shell_exec" to work. When i invoke "shell_exec", the
> script doesn't get interpreted, instead
> i get prompted to download the whole .php file. I have tried both /bin/php
> and /bin/php-cgi- same problem.
> When i try to execute it per command line instead of web server, with both
> php and php-cgi i get "Segmentation fault"
> and nothing happens. I use busybox http as a web server, if it's relevant.
> Does anybody have an idea what the problem
> might be? Any help would be appreciated.
>
> Best regards,
>
> Boyan
>
>
--- End Message ---
--- Begin Message ---
At 9:19 AM -0400 10/31/10, Gary wrote:
I was sure that the images were being stored and called from the images
folder and not directly from the DB, that is until tedd brought it up. I
did have an issue of getting the images to show in the beginning, however I
solved it by inserting the path in the call from the DB. I am wondering now
if they are stored in both locations.
Gary
Gary:
Both locations? I think you are confusing yourself.You either have
the images stored in the database OR the file system, but not both.
However, I think you have the images stored as files within the file
directory, such as:
http://yourdomain.com/images/picture1.jpg
Now, in your database you should have only the path name stored
(i.e., images/picture1.jpg) and not the image. However, I usually
only store the file names and NOT the path. That way I can move the
images to where ever I want and only change their reference in the
HTML.
To recap, to show any image you use the HTML img tag, such as:
<img src="images/picture1.jpg">
To tie this statement to a database, you need to pull out the image
name (or file path) from the database and use that. Something like
this:
$query = "SELECT file_name FROM pictures WHERE id = '$id' ";
$result = mysql_query($query) or die();
$row = mysql_fetch_array($result);
$file_name = $row['file_name'];
And then in the HTML you would use:
<img src="images/<?php echo($file_name);?>">
If you can get to this part, then we can deal with placing a
watermark on the image before showing it.
Please let me know when you get this part to work.
Cheers,
tedd
PS: There is no need to use a LONG BLOB in your database -- that's
just a waste of space.
--
-------
http://sperling.com/
--- End Message ---
--- Begin Message ---
"tedd" <[email protected]> wrote in message
news:p06240800c8f339e20...@[192.168.1.2]...
> At 9:19 AM -0400 10/31/10, Gary wrote:
>>I was sure that the images were being stored and called from the images
>>folder and not directly from the DB, that is until tedd brought it up. I
>>did have an issue of getting the images to show in the beginning, however
>>I
>>solved it by inserting the path in the call from the DB. I am wondering
>>now
>>if they are stored in both locations.
>>
>>Gary
>
> Gary:
>
> Both locations? I think you are confusing yourself.You either have the
> images stored in the database OR the file system, but not both.
>
> However, I think you have the images stored as files within the file
> directory, such as:
>
> http://yourdomain.com/images/picture1.jpg
>
> Now, in your database you should have only the path name stored (i.e.,
> images/picture1.jpg) and not the image. However, I usually only store the
> file names and NOT the path. That way I can move the images to where ever
> I want and only change their reference in the HTML.
>
> To recap, to show any image you use the HTML img tag, such as:
>
> <img src="images/picture1.jpg">
>
> To tie this statement to a database, you need to pull out the image name
> (or file path) from the database and use that. Something like this:
>
> $query = "SELECT file_name FROM pictures WHERE id = '$id' ";
> $result = mysql_query($query) or die();
> $row = mysql_fetch_array($result);
> $file_name = $row['file_name'];
>
> And then in the HTML you would use:
>
> <img src="images/<?php echo($file_name);?>">
>
> If you can get to this part, then we can deal with placing a watermark on
> the image before showing it.
>
> Please let me know when you get this part to work.
>
> Cheers,
>
> tedd
>
> PS: There is no need to use a LONG BLOB in your database -- that's just a
> waste of space.
>
> --
> -------
> http://sperling.com/
tedd
Thank you for your reply.
I have the images being displayed in the browser fine, my issue was that I
was not able to get the watermark to show up. I believe the issue was here
$img=imagecreatefromjpeg($_GET['pic']);
in that 'pic' is asking for the image that I wanted the watermark displayed
on, and what I put in did not work. Since the image file name is being
stored in the DB, I tried
$row_WADAimages["image_file"]
as well as a few others.
What do you suggest I changed "longblob" to, and is it safe to do so?
Again, thank you for your help.
gary
__________ Information from ESET Smart Security, version of virus signature
database 5579 (20101031) __________
The message was checked by ESET Smart Security.
http://www.eset.com
--- End Message ---
--- Begin Message ---
At 12:12 PM -0400 10/31/10, Gary wrote:
"tedd" <[email protected]> wrote in message
news:p06240800c8f339e20...@[192.168.1.2]...
At 9:19 AM -0400 10/31/10, Gary wrote:
I was sure that the images were being stored and called from the images
folder and not directly from the DB, that is until tedd brought it up. I
did have an issue of getting the images to show in the beginning, however
I
solved it by inserting the path in the call from the DB. I am wondering
now
if they are stored in both locations.
Gary
Gary:
Both locations? I think you are confusing yourself.You either have the
images stored in the database OR the file system, but not both.
However, I think you have the images stored as files within the file
directory, such as:
http://yourdomain.com/images/picture1.jpg
Now, in your database you should have only the path name stored (i.e.,
images/picture1.jpg) and not the image. However, I usually only store the
file names and NOT the path. That way I can move the images to where ever
I want and only change their reference in the HTML.
To recap, to show any image you use the HTML img tag, such as:
<img src="images/picture1.jpg">
To tie this statement to a database, you need to pull out the image name
(or file path) from the database and use that. Something like this:
$query = "SELECT file_name FROM pictures WHERE id = '$id' ";
$result = mysql_query($query) or die();
$row = mysql_fetch_array($result);
$file_name = $row['file_name'];
And then in the HTML you would use:
<img src="images/<?php echo($file_name);?>">
If you can get to this part, then we can deal with placing a watermark on
the image before showing it.
Please let me know when you get this part to work.
Cheers,
tedd
PS: There is no need to use a LONG BLOB in your database -- that's just a
waste of space.
--
-------
http://sperling.com/
tedd
Thank you for your reply.
I have the images being displayed in the browser fine, my issue was that I
was not able to get the watermark to show up. I believe the issue was here
$img=imagecreatefromjpeg($_GET['pic']);
in that 'pic' is asking for the image that I wanted the watermark displayed
on, and what I put in did not work. Since the image file name is being
stored in the DB, I tried
$row_WADAimages["image_file"]
as well as a few others.
What do you suggest I changed "longblob" to, and is it safe to do so?
Again, thank you for your help.
gary
gary:
At some point you're going to have to learn:
1. The difference between a VARCHR and a LONGBLOB. Question: If you
are simply storing the name of an image file, then why use a LONGBLOB
to do that? Please look up the difference between the two and post
your findings here;
2. The GET (again) is *not* the way to get the name of the image. I
have shown you how to pull the name of the image via a database call
-- so why do you go back to your old code telling me what the problem
is? If you already know what the problem is, then why ask me?
3. If you want my help, then use what I have shown you instead of
going back to your past problematic solution.
It looks to me as if you are not willing to learn but rather are
looking for a simple solution. I am not going to write your code for
you.
Now, please use my last email and write code to present an image as I
demonstrated to you. When you can do that, then we can address how to
put a watermark on the image. However, if you fail to do that and
continue to bring up old nonsensical code, then I will discontinue
commenting re this thread.
Cheers,
tedd
--
-------
http://sperling.com/
--- End Message ---
--- Begin Message ---
On Oct 31, 2010, at 7:29 AM, Gary wrote:
Thanks for the reply, here is a link to the code of the page.
http://www.paulgdesigns.com/detailcode.php
Ok, that was pretty messy code. But what I could glean from it is
this. (See your code at http://pastie.org/1262989).
Line 238: <table border="2" cellpadding="0" width="100%" ><tr><td
width="auto"><div class="WADADetailsMainImageArea"><img
class="WADADetailsMainImage" style="border:#FFFFFF 6px solid"
src="images/<?php echo $row_WADAimages["image_file"]; ?>" alt="<?php
echo $row_WADAimages["description"]; ?>" /></div></td><td valign="top"
width="25%"> <div class="WADADetailsSubHeading" style="padding-left:
15px;">This photo was taken in <?php echo
$row_WADAimages["where_taken"]; ?></div>
You've got an img tag there, indicating the src of:
images/<?php echo $row_WADAimages["image_file"]; ?>
Is this the image file you want to watermark?
The code there has me confused. Is this all one script? Or is it
multiple scripts?
If it's all one script, it won't work the way you intend. The script
emits data before it gets to the point where you have set up to
watermark the image. Thus, the point where you call header to change
the Content-type won't work. Then there is more data emitted after the
image.
Am I reading this correctly? Is it all one big script?
If it is, what you really need to do, is at the point where you want
the watermarked image to appear, is put out some HTML like so:
<img src="watermark.php?src=images/<?php echo
$row_WADAimages["image_file"]; ?>" .. other stuff ..>
Then put that code you've got in lines 247-272 in the script
watermark.php and it should work as is.
--- End Message ---
--- Begin Message ---
At 3:47 PM +1100 10/31/10, Dr Michael Daly wrote:
Hi
Using a php search form produces a nil return on any information that is
capitalised within a mysql database; retrieval is fine for non-capitalised
data. Could someone tweak this please? The relevant code I think is as
follows:
// Description is a BLOB in MySQL... we need to UPPER the blob
//values to make the search case-insensitive.
$query = "SELECT C.*, A.surname, A.name, A.surname_prefix, A.id AS user
FROM pbcs_user A, pbcs_join_table_user_app B, pbcs_appointment C ".
"WHERE A.id = B.user_id AND
B.appointment_id = C.id ".
"AND LOWER(C.description) LIKE
'%".strtolower($search_for)."%' AND
C.start_time > $start_time AND C.start_time < $end_time ORDER BY
C.start_time";
$result = pbcs_db_query($query);
Thanks
Michael
Melb, Aust.
Why are you using a BLOB?
You are just storing text data, right? If so, then a VARCHAR will work.
Additionally, using a BLOB changes things somewhat in that all data
are stored as binary strings and as such makes all comparisons
case-sensitive. Too many double negatives for me.
Cheers,
tedd
--
-------
http://sperling.com/
--- End Message ---
--- Begin Message ---
Hi,
I'm trying to integrate facebook to show the wall in a site.
ok, i generate the auth_token here:
https://login.facebook.com/code_gen.php?api_key=API_KEY&v=1.0
And put the rest connection configuration here:
$facebookArr = array(
"appapikey" => $appapikey,
"appidkey" => $appidkey,
"appsecret" => $appsecret,
"appcallbackurl" => $appcallbackurl,
'cookie' => true,
'token' => $token
);
$fb = new FacebookRestClient($facebookArr['appapikey'],
$facebookArr['appsecret']);
$result = $fb->call_method('facebook.auth.getSession',
array('auth_token' =>$facebookArr['token'],
'generate_session_secret' => true));
Its work, but only the first time, if i refresh i get this exception:
exception 'FacebookRestClientException' with message 'Invalid parameter'
If i generate the token again, its work for the first time again.
Please someone have any recent tutorial to integrate facebook to some php
site?
Atenciosamente,
Yuri Yarlei.
www.yuriyarlei.net (under construction)
Programmer PHP, JAVA, CSS, ORACLE 10g, PostgreSQL;
Next step is the SCJP.
"Se você ainda não esta com dor de cabeça, é por que ainda cabe um pouco
mais de conhecimento."
--- End Message ---
--- Begin Message ---
which user it is executed as when request a php script on
browser?(suppose we are on a shared LAMP hosting)
--- End Message ---
--- Begin Message ---
If its Apache on Linux (as most hosting will be) then the user will generally
be either apache, www, or http.
Thanks,
Ash
http://www.ashleysheridan.co.uk
--- End Message ---
--- Begin Message ---
There isn't a php user. If php scripts are executed through the web server,
they belong to the server. If they are cli scripts, then they belong to the
user that executed them, or the user the process that executed them is running
as.
Thanks,
Ash
http://www.ashleysheridan.co.uk
----- Reply message -----
From: "Ryan Sun" <[email protected]>
Date: Sun, Oct 31, 2010 18:43
Subject: [PHP] a question about user and permission on linux
To: "[email protected]" <[email protected]>
Then whats the user of php?
On 10/31/2010 2:39 PM, [email protected] wrote:
> If its Apache on Linux (as most hosting will be) then the user will
> generally be either apache, www, or http.
>
> Thanks,
> Ash
> http://www.ashleysheridan.co.uk
>
>
>
--- End Message ---
--- Begin Message ---
Is this something I need to worry about?? Is my mail sending some
malware??
Begin forwarded message:
From: Mail Delivery Subsystem <[email protected]>
Date: October 31, 2010 7:37:54 PM CDT
To: Tamara Temple <[email protected]>
Subject: Mail delivery failed: returning message to sender
This message was created automatically by mail delivery software.
A message sent by
<[email protected]>
could not be delivered to all of its recipients.
The following address(es) failed:
<[email protected]>
The following text was generated during the delivery attempt(s):
<[email protected]>
(reason: 550 This message contains malware
(winnow.malware.wa.webinjection.1450.UNOFFICIAL))
------ This is a copy of the message, including all the headers.
Received: from [192.168.1.110] (helo=mailin01.ims-firmen.de)
by mail01.ims-firmen.de with esmtp (Exim 4.69)
(envelope-from <[email protected]
>)
id 1PCiPJ-0001i7-R8
for [email protected]; Mon, 01 Nov 2010 01:37:53 +0100
Received: from pb1.pair.com ([76.75.200.58] helo=lists.php.net)
by mailin01.ims-firmen.de with esmtp (Exim 4.72)
(envelope-from <[email protected]
>)
id 1PCiPs-00047o-Sb
for [email protected]; Mon, 01 Nov 2010 01:38:29 +0100
Authentication-Results: pb1.pair.com [email protected]
; domainkeys=bad
DomainKey-Status: bad
X-DomainKeys: Ecelerity dk_validate implementing draft-delany-
domainkeys-base-01
X-Host-Fingerprint: 76.75.200.58 pb1.pair.com
Received: from [76.75.200.58] ([76.75.200.58:2084] helo=lists.php.net)
by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP
id EF/73-24094-FDB0ECC4 for <[email protected]>; Sun, 31 Oct
2010 19:37:51 -0500
Received: (qmail 51732 invoked by uid 1010); 1 Nov 2010 00:37:02 -0000
Mailing-List: contact [email protected]; run by ezmlm
Precedence: bulk
list-help: <mailto:[email protected]>
list-unsubscribe: <mailto:[email protected]>
list-post: <mailto:[email protected]>
List-Id: php-general.lists.php.net
Delivered-To: mailing list [email protected]
Received: (qmail 51725 invoked from network); 1 Nov 2010 00:37:02
-0000
Authentication-Results: pb1.pair.com [email protected]
; sender-id=pass; domainkeys=bad
Authentication-Results: pb1.pair.com
[email protected]; spf=pass; sender-id=pass
Received-SPF: pass (pb1.pair.com: domain gmail.com designates
209.85.214.170 as permitted sender)
X-DomainKeys: Ecelerity dk_validate implementing draft-delany-
domainkeys-base-01
X-PHP-List-Original-Sender: [email protected]
X-Host-Fingerprint: 209.85.214.170 mail-iw0-f170.google.com
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=gamma;
h=domainkey-signature:received:received:message-id:from:to
:in-reply-to:content-type:content-transfer-encoding:mime-
version
:subject:x-priority:date:references:x-mailer;
bh=1SBvdJiJMqFW3oAPgBXlRPveD1uwTXHSzA8U6+E93g0=;
b=XHIyqG6ZzyCKVSLzyPdNuLXtAIWM1ny0zKFupfTsZgMElSrlCA1aJ9FpDUGvgHMQof
0ygppTTq2fo3499HwTzbRYXQSJ4Z2NiEZfYHmwwoTmuenC9XjYbPk+ZUE3p
+6S4Okbsm
sSzu18qFOWAGGhJ8dG8LfcDSfhKhRj3R57Yh4=
DomainKey-Signature: a=rsa-sha1; c=nofws;
d=gmail.com; s=gamma;
h=message-id:from:to:in-reply-to:content-type
:content-transfer-encoding:mime-version:subject:x-
priority:date
:references:x-mailer;
b=CnWjshGm9zyFaRv0eUKJml94xT5U1Lb
+kEBb503a7VlYtSAWaZm4nK38otH7iJ+Bit
wr77nJ0SSxoXmaQ/ljQ16IoSGhhXJ9Ew6lOaBE7ntbjibfYnnz7Yzi+sfGt
+8STXjHZx
LP7Z8lk+uMvIH4gNDGw6CcqWawTHJ3Ll7PX7o=
Message-Id: <[email protected]>
From: Tamara Temple <[email protected]>
To: PHP General <[email protected]>
In-Reply-To: <[email protected]>
Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes
Content-Transfer-Encoding: 7bit
Mime-Version: 1.0 (Apple Message framework v936)
X-Priority: 3
Date: Sun, 31 Oct 2010 19:36:53 -0500
References: <[email protected]>
<p06240800c8f1d19b9...@[192.168.1.2]> <[email protected]
> <[email protected]> <[email protected]
>
X-Mailer: Apple Mail (2.936)
Subject: Re: [PHP] Watermark with GD
X-Envelope-To: [email protected]
X-Envelope-From: [email protected]
X-IMS-IP: 76.75.200.58
X-AV-scan: yes
On Oct 31, 2010, at 7:29 AM, Gary wrote:
Thanks for the reply, here is a link to the code of the page.
http://www.paulgdesigns.com/detailcode.php
Ok, that was pretty messy code. But what I could glean from it is
this. (See your code at http://pastie.org/1262989).
Line 238: <table border="2" cellpadding="0" width="100%" ><tr><td
width="auto"><div class="WADADetailsMainImageArea"><img
class="WADADetailsMainImage" style="border:#FFFFFF 6px solid"
src="images/<?php echo $row_WADAimages["image_file"]; ?>" alt="<?php
echo $row_WADAimages["description"]; ?>" /></div></td><td valign="top"
width="25%"> <div class="WADADetailsSubHeading" style="padding-left:
15px;">This photo was taken in <?php echo
$row_WADAimages["where_taken"]; ?></div>
You've got an img tag there, indicating the src of:
images/<?php echo $row_WADAimages["image_file"]; ?>
Is this the image file you want to watermark?
The code there has me confused. Is this all one script? Or is it
multiple scripts?
If it's all one script, it won't work the way you intend. The script
emits data before it gets to the point where you have set up to
watermark the image. Thus, the point where you call header to change
the Content-type won't work. Then there is more data emitted after the
image.
Am I reading this correctly? Is it all one big script?
If it is, what you really need to do, is at the point where you want
the watermarked image to appear, is put out some HTML like so:
<img src="watermark.php?src=images/<?php echo
$row_WADAimages["image_file"]; ?>" .. other stuff ..>
Then put that code you've got in lines 247-272 in the script
watermark.php and it should work as is.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
On Sun, 2010-10-31 at 20:06 -0500, Tamara Temple wrote:
> Is this something I need to worry about?? Is my mail sending some
> malware??
>
> Begin forwarded message:
>
> > From: Mail Delivery Subsystem <[email protected]>
> > Date: October 31, 2010 7:37:54 PM CDT
> > To: Tamara Temple <[email protected]>
> > Subject: Mail delivery failed: returning message to sender
> >
> > This message was created automatically by mail delivery software.
> >
> > A message sent by
> >
> > <[email protected]>
> >
> > could not be delivered to all of its recipients.
> > The following address(es) failed:
> >
> > <[email protected]>
> >
> > The following text was generated during the delivery attempt(s):
> >
> > <[email protected]>
> > (reason: 550 This message contains malware
> > (winnow.malware.wa.webinjection.1450.UNOFFICIAL))
> >
> > ------ This is a copy of the message, including all the headers.
> >
> > Received: from [192.168.1.110] (helo=mailin01.ims-firmen.de)
> > by mail01.ims-firmen.de with esmtp (Exim 4.69)
> > (envelope-from
> > <[email protected]
> > >)
> > id 1PCiPJ-0001i7-R8
> > for [email protected]; Mon, 01 Nov 2010 01:37:53 +0100
> > Received: from pb1.pair.com ([76.75.200.58] helo=lists.php.net)
> > by mailin01.ims-firmen.de with esmtp (Exim 4.72)
> > (envelope-from
> > <[email protected]
> > >)
> > id 1PCiPs-00047o-Sb
> > for [email protected]; Mon, 01 Nov 2010 01:38:29 +0100
> > Authentication-Results: pb1.pair.com [email protected]
> > ; domainkeys=bad
> > DomainKey-Status: bad
> > X-DomainKeys: Ecelerity dk_validate implementing draft-delany-
> > domainkeys-base-01
> > X-Host-Fingerprint: 76.75.200.58 pb1.pair.com
> > Received: from [76.75.200.58] ([76.75.200.58:2084] helo=lists.php.net)
> > by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP
> > id EF/73-24094-FDB0ECC4 for <[email protected]>; Sun, 31 Oct
> > 2010 19:37:51 -0500
> > Received: (qmail 51732 invoked by uid 1010); 1 Nov 2010 00:37:02 -0000
> > Mailing-List: contact [email protected]; run by ezmlm
> > Precedence: bulk
> > list-help: <mailto:[email protected]>
> > list-unsubscribe: <mailto:[email protected]>
> > list-post: <mailto:[email protected]>
> > List-Id: php-general.lists.php.net
> > Delivered-To: mailing list [email protected]
> > Received: (qmail 51725 invoked from network); 1 Nov 2010 00:37:02
> > -0000
> > Authentication-Results: pb1.pair.com [email protected]
> > ; sender-id=pass; domainkeys=bad
> > Authentication-Results: pb1.pair.com
> > [email protected]; spf=pass; sender-id=pass
> > Received-SPF: pass (pb1.pair.com: domain gmail.com designates
> > 209.85.214.170 as permitted sender)
> > X-DomainKeys: Ecelerity dk_validate implementing draft-delany-
> > domainkeys-base-01
> > X-PHP-List-Original-Sender: [email protected]
> > X-Host-Fingerprint: 209.85.214.170 mail-iw0-f170.google.com
> > DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
> > d=gmail.com; s=gamma;
> > h=domainkey-signature:received:received:message-id:from:to
> > :in-reply-to:content-type:content-transfer-encoding:mime-
> > version
> > :subject:x-priority:date:references:x-mailer;
> > bh=1SBvdJiJMqFW3oAPgBXlRPveD1uwTXHSzA8U6+E93g0=;
> >
> > b=XHIyqG6ZzyCKVSLzyPdNuLXtAIWM1ny0zKFupfTsZgMElSrlCA1aJ9FpDUGvgHMQof
> > 0ygppTTq2fo3499HwTzbRYXQSJ4Z2NiEZfYHmwwoTmuenC9XjYbPk+ZUE3p
> > +6S4Okbsm
> > sSzu18qFOWAGGhJ8dG8LfcDSfhKhRj3R57Yh4=
> > DomainKey-Signature: a=rsa-sha1; c=nofws;
> > d=gmail.com; s=gamma;
> > h=message-id:from:to:in-reply-to:content-type
> > :content-transfer-encoding:mime-version:subject:x-
> > priority:date
> > :references:x-mailer;
> > b=CnWjshGm9zyFaRv0eUKJml94xT5U1Lb
> > +kEBb503a7VlYtSAWaZm4nK38otH7iJ+Bit
> > wr77nJ0SSxoXmaQ/ljQ16IoSGhhXJ9Ew6lOaBE7ntbjibfYnnz7Yzi+sfGt
> > +8STXjHZx
> > LP7Z8lk+uMvIH4gNDGw6CcqWawTHJ3Ll7PX7o=
> > Message-Id: <[email protected]>
> > From: Tamara Temple <[email protected]>
> > To: PHP General <[email protected]>
> > In-Reply-To: <[email protected]>
> > Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes
> > Content-Transfer-Encoding: 7bit
> > Mime-Version: 1.0 (Apple Message framework v936)
> > X-Priority: 3
> > Date: Sun, 31 Oct 2010 19:36:53 -0500
> > References: <[email protected]>
> > <p06240800c8f1d19b9...@[192.168.1.2]> <[email protected]
> > > <[email protected]>
> > > <[email protected]
> > >
> > X-Mailer: Apple Mail (2.936)
> > Subject: Re: [PHP] Watermark with GD
> > X-Envelope-To: [email protected]
> > X-Envelope-From:
> > [email protected]
> > X-IMS-IP: 76.75.200.58
> > X-AV-scan: yes
> >
> >
> > On Oct 31, 2010, at 7:29 AM, Gary wrote:
> >> Thanks for the reply, here is a link to the code of the page.
> >>
> >> http://www.paulgdesigns.com/detailcode.php
> >>
> >
> > Ok, that was pretty messy code. But what I could glean from it is
> > this. (See your code at http://pastie.org/1262989).
> >
> > Line 238: <table border="2" cellpadding="0" width="100%" ><tr><td
> > width="auto"><div class="WADADetailsMainImageArea"><img
> > class="WADADetailsMainImage" style="border:#FFFFFF 6px solid"
> > src="images/<?php echo $row_WADAimages["image_file"]; ?>" alt="<?php
> > echo $row_WADAimages["description"]; ?>" /></div></td><td valign="top"
> > width="25%"> <div class="WADADetailsSubHeading" style="padding-left:
> > 15px;">This photo was taken in <?php echo
> > $row_WADAimages["where_taken"]; ?></div>
> >
> > You've got an img tag there, indicating the src of:
> >
> > images/<?php echo $row_WADAimages["image_file"]; ?>
> >
> > Is this the image file you want to watermark?
> >
> > The code there has me confused. Is this all one script? Or is it
> > multiple scripts?
> >
> > If it's all one script, it won't work the way you intend. The script
> > emits data before it gets to the point where you have set up to
> > watermark the image. Thus, the point where you call header to change
> > the Content-type won't work. Then there is more data emitted after the
> > image.
> >
> > Am I reading this correctly? Is it all one big script?
> >
> > If it is, what you really need to do, is at the point where you want
> > the watermarked image to appear, is put out some HTML like so:
> >
> > <img src="watermark.php?src=images/<?php echo
> > $row_WADAimages["image_file"]; ?>" .. other stuff ..>
> >
> > Then put that code you've got in lines 247-272 in the script
> > watermark.php and it should work as is.
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
>
>
Scan your computer just to be on the safe side with an antivirus that's
up-to-date. It's likely though that someone just has their filter
mis-configured, as I've seen a lot of messages bounce with odd replies
lately.
Thanks,
Ash
http://www.ashleysheridan.co.uk
--- End Message ---