Re: [PHP] Fwd: Mail delivery failed: returning message to sender

2010-10-31 Thread Ashley Sheridan
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 
> > Date: October 31, 2010 7:37:54 PM CDT
> > To: Tamara Temple 
> > Subject: Mail delivery failed: returning message to sender
> >
> > This message was created automatically by mail delivery software.
> >
> > A message sent by
> >
> >  
> >
> > could not be delivered to all of its recipients.
> > The following address(es) failed:
> >
> >  
> >
> > The following text was generated during the delivery attempt(s):
> >
> > 
> >(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 
> >  > >)
> > id 1PCiPJ-0001i7-R8
> > for sascha.br...@immosky.ch; 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 
> >  > >)
> > id 1PCiPs-00047o-Sb
> > for sascha.br...@immosky.ch; Mon, 01 Nov 2010 01:38:29 +0100
> > Authentication-Results: pb1.pair.com header.from=tamouse.li...@gmail.com 
> > ; 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 ; Sun, 31 Oct  
> > 2010 19:37:51 -0500
> > Received: (qmail 51732 invoked by uid 1010); 1 Nov 2010 00:37:02 -
> > Mailing-List: contact php-general-h...@lists.php.net; run by ezmlm
> > Precedence: bulk
> > list-help: 
> > list-unsubscribe: 
> > list-post: 
> > List-Id: php-general.lists.php.net
> > Delivered-To: mailing list php-general@lists.php.net
> > Received: (qmail 51725 invoked from network); 1 Nov 2010 00:37:02  
> > -
> > Authentication-Results: pb1.pair.com header.from=tamouse.li...@gmail.com 
> > ; sender-id=pass; domainkeys=bad
> > Authentication-Results: pb1.pair.com  
> > smtp.mail=tamouse.li...@gmail.com; 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: tamouse.li...@gmail.com
> > 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: <30708a14-2818-4b28-87f9-11db56c40...@gmail.com>
> > From: Tamara Temple 
> > To: PHP General 
> > In-Reply-To: 
> > 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: <15.34.06635.e1b1b...@pb1.pair.com>  
> >   > > <94df613c-6b40-4897-b101-21cf7d83a...@gmail.com> 
> > >  > >
> > X-Mailer: Apple Mail (2.936)
> > Subject: Re: [PHP] Watermark with GD
> > X-Envelope-To: sascha.br...@immosky.ch
> > X-Envelope-From: 
> > php-general-return-309188-sascha.braun=immosky...@lists.php.net
> > 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:  > width="auto

[PHP] Fwd: Mail delivery failed: returning message to sender

2010-10-31 Thread Tamara Temple
Is this something I need to worry about?? Is my mail sending some  
malware??


Begin forwarded message:


From: Mail Delivery Subsystem 
Date: October 31, 2010 7:37:54 PM CDT
To: Tamara Temple 
Subject: Mail delivery failed: returning message to sender

This message was created automatically by mail delivery software.

A message sent by

 

could not be delivered to all of its recipients.
The following address(es) failed:

 

The following text was generated during the delivery attempt(s):


   (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 >)

id 1PCiPJ-0001i7-R8
for sascha.br...@immosky.ch; 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 >)

id 1PCiPs-00047o-Sb
for sascha.br...@immosky.ch; Mon, 01 Nov 2010 01:38:29 +0100
Authentication-Results: pb1.pair.com header.from=tamouse.li...@gmail.com 
; 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 ; Sun, 31 Oct  
2010 19:37:51 -0500

Received: (qmail 51732 invoked by uid 1010); 1 Nov 2010 00:37:02 -
Mailing-List: contact php-general-h...@lists.php.net; run by ezmlm
Precedence: bulk
list-help: 
list-unsubscribe: 
list-post: 
List-Id: php-general.lists.php.net
Delivered-To: mailing list php-general@lists.php.net
Received: (qmail 51725 invoked from network); 1 Nov 2010 00:37:02  
-
Authentication-Results: pb1.pair.com header.from=tamouse.li...@gmail.com 
; sender-id=pass; domainkeys=bad
Authentication-Results: pb1.pair.com  
smtp.mail=tamouse.li...@gmail.com; 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: tamouse.li...@gmail.com
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: <30708a14-2818-4b28-87f9-11db56c40...@gmail.com>
From: Tamara Temple 
To: PHP General 
In-Reply-To: 
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: <15.34.06635.e1b1b...@pb1.pair.com>  
 > <94df613c-6b40-4897-b101-21cf7d83a...@gmail.com> >

X-Mailer: Apple Mail (2.936)
Subject: Re: [PHP] Watermark with GD
X-Envelope-To: sascha.br...@immosky.ch
X-Envelope-From: php-general-return-309188-sascha.braun=immosky...@lists.php.net
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: " alt="" /> This photo was taken in 

You've got an img tag there, indicating the src of:

images/

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 

Re: [PHP] Watermark with GD

2010-10-31 Thread Tamara Temple


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: width="auto">class="WADADetailsMainImage" style="border:#FF 6px solid"  
src="images/" alt="echo $row_WADAimages["description"]; ?>" />width="25%"> This photo was taken in $row_WADAimages["where_taken"]; ?>


You've got an img tag there, indicating the src of:

images/

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:


" .. 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



RE: [PHP] Problem with "shell_exec"

2010-10-31 Thread admin
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:boyan...@googlemail.com] 
Sent: Sunday, October 31, 2010 12:26 PM
To: ad...@buskirkgraphics.com
Cc: php-general@lists.php.net
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,  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:boyan...@googlemail.com]
> Sent: Sunday, October 31, 2010 11:16 AM
> To: php-general@lists.php.net
> 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
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] a question about user and permission on linux

2010-10-31 Thread a...@ashleysheridan.co.uk
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" 
Date: Sun, Oct 31, 2010 18:43
Subject: [PHP] a question about user and permission on linux
To: "a...@ashleysheridan.co.uk" 

Then whats the user of php?
On 10/31/2010 2:39 PM, a...@ashleysheridan.co.uk 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
>
>
>



Re: [PHP] a question about user and permission on linux

2010-10-31 Thread a...@ashleysheridan.co.uk
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



[PHP] a question about user and permission on linux

2010-10-31 Thread Ryan Sun
which user it is executed as when request a php script on 
browser?(suppose we are on a shared LAMP hosting)


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] questions about if statements regarding a checkbox

2010-10-31 Thread Ben Brentlinger
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, ad...@buskirkgraphics.com 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:b...@benbrent.com]
Sent: Sunday, October 31, 2010 8:26 AM
To: php-general@lists.php.net
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 = 'b...@benbrent.com';
$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 = 'b...@benbrent.com';
$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:' . $...@benbrent.com);
}

header ("location:thankyoupage")
[/php_code]



[html_code]




 
Contact Form
 

Email:  





First Name:




Last Name:




I know you in real life








 


[/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



Re: [PHP] questions about if statements regarding a checkbox

2010-10-31 Thread Ben Brentlinger
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.


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Watermark with GD

2010-10-31 Thread tedd

At 12:12 PM -0400 10/31/10, Gary wrote:

"tedd"  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:

 

 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:

 

 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/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Integrating zend-facebook error

2010-10-31 Thread Yuri Yarlei
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."


Re: [PHP] Problem with "shell_exec"

2010-10-31 Thread Boyan Penev
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,  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:boyan...@googlemail.com]
> Sent: Sunday, October 31, 2010 11:16 AM
> To: php-general@lists.php.net
> 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
>
>


Re: [PHP] Watermark with GD

2010-10-31 Thread Gary

"tedd"  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:
>
> 
>
> 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:
>
> 
>
> 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





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] questions about if statements regarding a checkbox

2010-10-31 Thread tedd

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/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] search is not case insensitive

2010-10-31 Thread tedd

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/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Watermark with GD

2010-10-31 Thread tedd

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:



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:



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/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Problem with "shell_exec"

2010-10-31 Thread admin
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:boyan...@googlemail.com] 
Sent: Sunday, October 31, 2010 11:16 AM
To: php-general@lists.php.net
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


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Problem with "shell_exec"

2010-10-31 Thread Boyan Penev
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


RE: [PHP] questions about if statements regarding a checkbox

2010-10-31 Thread admin
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.









 
Contact Form
 

Email: 





First Name: 




Last Name: 




I know you in real life








 








Richard L. Buskirk


-Original Message-
From: ad...@buskirkgraphics.com [mailto:ad...@buskirkgraphics.com] 
Sent: Sunday, October 31, 2010 10:37 AM
To: 'Ben Brentlinger'; php-general@lists.php.net
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:b...@benbrent.com] 
Sent: Sunday, October 31, 2010 8:26 AM
To: php-general@lists.php.net
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 = 'b...@benbrent.com';
$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 = 'b...@benbrent.com';
$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:' . $...@benbrent.com);
}

header ("location:thankyoupage")
[/php_code]



[html_code]




 
Contact Form
 

Email: 





First Name: 




Last Name: 




I know you in real life








 


[/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


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] questions about if statements regarding a checkbox

2010-10-31 Thread admin
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:b...@benbrent.com] 
Sent: Sunday, October 31, 2010 8:26 AM
To: php-general@lists.php.net
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 = 'b...@benbrent.com';
$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 = 'b...@benbrent.com';
$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:' . $...@benbrent.com);
}

header ("location:thankyoupage")
[/php_code]



[html_code]




 
Contact Form
 

Email: 





First Name: 




Last Name: 




I know you in real life








 


[/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



Re: [PHP] Watermark with GD

2010-10-31 Thread Gary
Gary
>
> is this the imageDetail.php script?
>
> From what it appears in the code, `image_file` is holding the file  name 
> rather than the actual image. Yet you have `image_file` defined  as a 
> longblob, which would make sense if you were storing the actual  image 
> data in the data base rather than on the file system. As Ashley  noted, 
> you can do it either way. I notice you also have a field  `file_name` --  
> what is this used for? It sounds like your design is a  bit off -- neither 
> one way or the other. The php shown doesn't look  complete enough, 
> though -- where is the img tag and such? Also, going  in and out of php on 
> each line is kind of a waste and looks sloppy. If  i read that code right, 
> it would emit something like this:
>
>
> caption text
> src="images/pathtoimagefile" description text
>
> where taken text
> description text
>
> Look at the html that's emitted from the script and see if that's what 
> you get.
>
> Can you post or pastebin more of the .php script so I can see more of 
> what is going on?
>
>
>
> __ Information from ESET Smart Security, version of virus 
> signature database 5576 (20101029) __
>
> The message was checked by ESET Smart Security.
>
> http://www.eset.com
>
>
> 



__ Information from ESET Smart Security, version of virus signature 
database 5578 (20101031) __

The message was checked by ESET Smart Security.

http://www.eset.com





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Watermark with GD

2010-10-31 Thread Gary

"Tamara Temple"  wrote in message 
news:94df613c-6b40-4897-b101-21cf7d83a...@gmail.com...
>
> On Oct 30, 2010, at 9:31 AM, Gary wrote:
>
>>
>> "tedd"  wrote in message
>> news:p06240800c8f1d19b9...@[192.168.1.2]...
>>> At 3:05 PM -0400 10/29/10, Gary wrote:
>>>> I am trying to get the watermark to work, however I am having a 
>>>> problem in
>>>> that the image is being called from a database (image sits in images
>>>> file).
>>>>
>>>> The script in question is this
>>>>
>>>> $image = imagecreatefromjpeg($_GET['src']);
>>>>
>>>> However it produces an error message of
>>>>
>>>> Warning: imagecreatefromjpeg() [function.imagecreatefromjpeg]: 
>>>> Filename
>>>> cannot be empty in /home/content/a/l/i/alinde52/html/ imagesDetail.php 
>>>> on
>>>> line 233
>>>>
>>>> I have tried various methods, for example: ($_GET ['images/'] or 
>>>> ($_GET
>>>> ['images/$row_WADAimages["image_id"]].
>>>>
>>>> Can anyone shed some light on this for me.
>>>>
>>>> Thank you
>>>>
>>>> Gary
>>>
>>> Gary:
>>>
>>> Several things.
>>>
>>> 1. Getting an image from a database? You mean that you are getting  the
>>> path of the image in the file system, right?
>>>
>>> Side note: You could place the image inside the database using a  BLOB 
>>> and
>>> do away with the path all together. That has the benefit of being
>>> portable -- you simply move the database to where ever you want it.  The
>>> downside is that the database becomes very large, but no more so  that 
>>> the
>>> file system. There are pro's and con's in storing actual images in a
>>> database.
>>>
>>> 2. Using a GET is not the way to get the path. Instead, you have to
>>> retrieve the path from the database table where the path is stored --
>>> and that requires a MySQL query similar to "SELECT * FROM   
>>> WHERE
>>> id=". There are lot's of examples of how to pull data  from a
>>> database.
>>>
>>> 3. After getting the path, then you can create the watermark like so:
>>>
>>> http://webbytedd.com/b/watermark/
>>>
>>> Hope this helps,
>>>
>>> tedd
>>>
>>> -- 
>>> ---
>>> http://sperling.com/
>>>
>>
>> tedd
>>
>> Thank you for your reply.
>>
>> I was under the impression that the image is stored in a folder called
>> images, in fact the images file do go in, however I have the DB set  up 
>> for
>> longblob, averaging about 20kb each, so now I am unsure.  I exported  the 
>> sql
>> so perhaps you can tell me.
>>
>> Table structure for table `images`
>> --
>>
>> CREATE TABLE IF NOT EXISTS `images` (
>>  `image_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
>>  `caption` varchar(50) NOT NULL,
>>  `wheretaken` varchar(100) NOT NULL,
>>  `description` text NOT NULL,
>>  `file_name` varchar(25) NOT NULL,
>>  `image_file` longblob NOT NULL,
>>  `submitted` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
>>  PRIMARY KEY (`image_id`)
>> ) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=1447 ;
>>
>> When I call the images, which works fine, I do need to specify the  path 
>> that
>> leads to the images folder. Am I being redundant in this structure.
>>
>> This is the script that I use to call the images. I have pulled out  some 
>> of
>> the html that styles the data.
>>
>>  0) { // Show if recordset not  empty ?>
>>  
>>  src="images/" > $row_WADAimages["description"]; ?>"
>>
>> 
>>
>>
>> Thank you for your help.
>>
>> Gary
>
> is this the imageDetail.php script?
>
> From what it appears in the code, `image_file` is holding the file  name 
> rather than the actual image. Yet you have `image_file` defined  as a 
> longblob, which would make sense if you were storing the actual  image 
> data in the data base rather than on the file system. As Ashley  noted, 
> you can do it either way. I notice you also have a field  `file_name` --  
> what is this used for? It sounds like your design is a  bit off -- neither 
> one way or the other. The php shown doesn't look  complete enough, 
> though -- where is the img tag and such? Also, going  in and out of php on 
> each line is kind of a waste and looks sloppy. If  i read that code right, 
> it would emit something like this:
>
>
> caption text
> src="images/pathtoimagefile" description text
>
> where taken text
> description text
>
> Look at the html that's emitted from the script and see if that's what 
> you get.
>
> Can you post or pastebin more of the .php script so I can see more of 
> what is going on?
>

Tamara

Thanks for the reply, here is a link to the code of the page.

http://www.paulgdesigns.com/detailcode.php

Again, thank you for your help.

Gary 



__ Information from ESET Smart Security, version of virus signature 
database 5578 (20101031) __

The message was checked by ESET Smart Security.

http://www.eset.com





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] questions about if statements regarding a checkbox

2010-10-31 Thread Ben Brentlinger
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 = 'b...@benbrent.com';
$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 = 'b...@benbrent.com';
$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:' . $...@benbrent.com);
}

header ("location:thankyoupage")
[/php_code]



[html_code]




 
Contact Form
 

Email: 






First Name: 
size="20">




Last Name: 
size="20">




I know you in real life
size="20">








 


[/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



Re: [PHP] search is not case insensitive

2010-10-31 Thread Dr Michael Daly
thanks for this Ash...I didn't really understand but I do now!

unfortunately the fix didn't work, possibly bec the mysql data is in
binary format (default then becomes: case sensitive). I got a 'syntax
error' result

I'll find a mysql forum

Michael


This isn't a php question but a mysql one. Take out the lower() part of
the sql statement, as like is case insensitive by default.

Thanks,
Ash
http://www.ashleysheridan.co.uk

- Reply message -
From: "Dr Michael Daly" 
Date: Sun, Oct 31, 2010 04:47
Subject: [PHP] search is not case insensitive
To: 

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.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Dr Michael Daly MB, BS
GradDip(Integrative Medicine), GradCert(Evidence Based Practice),
M Bus(Information Innovation), GradDip(Document Management)
03 9521 0352
0413 879 029

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] questions about if statements regarding a checkbox

2010-10-31 Thread Andre Polykanine
Hello Ben,

You should use isset:
if (isset($_POST['check'])) {
// The checkbox is checked
} else {
// It's unchecked
}

-- 
With best regards from Ukraine,
Andre
Skype: Francophile
Twitter: http://twitter.com/m_elensule
Facebook: http://facebook.com/menelion

- Original message -
From: Ben Brentlinger 
To: php-general@lists.php.net 
Date: Sunday, October 31, 2010, 4:05:06 AM
Subject: [PHP] questions about if statements regarding a checkbox

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

-- 
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



Re: [PHP] include html

2010-10-31 Thread a...@ashleysheridan.co.uk
This can only be done with javascript, as the iframe is client-side, which php 
knows nothing about.

Thanks,
Ash
http://www.ashleysheridan.co.uk

- Reply message -
From: "Karl DeSaulniers" 
Date: Sun, Oct 31, 2010 03:32
Subject: [PHP] include html
To: "php-general" 

Hello,
I am looking for a solution to inject some dynamic html into an  
iframe and rework the css from the results.
Is there a way to do this in PHP? I am not talking about just using  
the src attribute of the iframe either.

Basically,
I want to call on a web page, grab the html code, replace the   
tag with my own and insert it into an iframe on my page.

I am sure this is not as complicated as I am making it, but I have  
been trying with Ajax for the past couple of days and no luck.
So I was wondering if there was a php alternative to do this with. Or  
if it is even possible or ok to do so.

I am building a website for a tshirt company that uses another  
company to get garments and promo items to print on.
The client wants to just have those pages load on top of their  
website, but wants the layout to go with their look and feel. their css.
We have the go ahead from the other companies to do so as well.

TIA,

Karl DeSaulniers
Design Drumm
http://designdrumm.com



Re: [PHP] search is not case insensitive

2010-10-31 Thread a...@ashleysheridan.co.uk
This isn't a php question but a mysql one. Take out the lower() part of the sql 
statement, as like is case insensitive by default.

Thanks,
Ash
http://www.ashleysheridan.co.uk

- Reply message -
From: "Dr Michael Daly" 
Date: Sun, Oct 31, 2010 04:47
Subject: [PHP] search is not case insensitive
To: 

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.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] questions about if statements regarding a checkbox

2010-10-31 Thread a...@ashleysheridan.co.uk
What is the code you're using now? You have a syntax error, but without seeing 
the code, we are all left to guessing what the problem could be.

Thanks,
Ash
http://www.ashleysheridan.co.uk

- Reply message -
From: "Ben Brentlinger" 
Date: Sun, Oct 31, 2010 03:56
Subject: [PHP] questions about if statements regarding a checkbox
To: 

I tried that, but I'm getting the syntax error that says "unexpected 
T_IF".  Probably because I'm trying to process this information directly 
in an email rather letting a mysql database handle the data, which I 
find harder to set up when writing a script from scratch than it would 
be to code a php script to send the data in an email.

On 10/30/2010 22:28, ad...@buskirkgraphics.com wrote:
>
> 
>
> If check it will submit the value of 'on'
>
> So
>
> If($_POST['test'] == "on')
> {
> Do this
> }else{
> Do this
> }
>
>
> Richard L. Buskirk
>
>
> -Original Message-
> From: Ben Brentlinger [mailto:b...@benbrent.com]
> Sent: Saturday, October 30, 2010 10:05 PM
> To: php-general@lists.php.net
> Subject: [PHP] questions about if statements regarding a checkbox
>
> 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
>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php