f



Getting rid of 'escape' backslashes in text

I have a script for sending 'round-robin' emails to choir members 
appended below.

The data (sender, body, subject) is passed from an HTML form using POST.

The script works fine except that apostrophes, quotes etc. appear 
'escaped' in the text of the email e.g. don\'t

Not a deal-breaker but untidy: can I clean this up somehow?

<?php
$sender = $_POST['sender'];
$body = $_POST['body'];
$subject = $_POST['subject'];

// set mail headers

$headers = "From: $sender \r\n" .
        "X-Mailer: PHP/" . phpversion() . "\r\n";

echo "$subject <br><br>";
echo "$headers <br><br>";
echo "$body <br><br>";

// now get mail recipients
include("/home/cantabi1/admin_connect.php");
$sql = "SELECT `memberName`, `email`\n"
        . "FROM `member`\n"
        . "WHERE active = 1 \n";

$result = mysql_query($sql, $conn) or die(mysql_error());

// and generate mail for each active member

while ($row = mysql_fetch_assoc($result)) {
    $to = $row['email'];

    $message = "Dear " . $row['memberName'] . ",\n\n $body";

    if (mail($to, $subject, $body, $headers)) {
        echo "mail sent to " . $row['memberName'] . "<br/><br/>";
    }
    else {
        echo "error in sending mail to " . $row['memberName'] . "<br/><br/
>";
    }
} //endwhile

?>

0
frderek (43)
8/18/2010 9:15:28 AM
comp.lang.php 32646 articles. 0 followers. Post Follow

12 Replies
542 Views

Similar Articles

[PageSpeed] 37

On 18 Aug, 10:15, Derek Turner <frde...@cesmail.net> wrote:
> I have a script for sending 'round-robin' emails to choir members
> appended below.
>
> The data (sender, body, subject) is passed from an HTML form using POST.
>
> The script works fine except that apostrophes, quotes etc. appear
> 'escaped' in the text of the email e.g. don\'t
>
> Not a deal-breaker but untidy: can I clean this up somehow?
>
> <?php
> $sender =3D $_POST['sender'];
> $body =3D $_POST['body'];
> $subject =3D $_POST['subject'];
>
> // set mail headers
>
> $headers =3D "From: $sender \r\n" .
> =A0 =A0 =A0 =A0 "X-Mailer: PHP/" . phpversion() . "\r\n";
>
> echo "$subject <br><br>";
> echo "$headers <br><br>";
> echo "$body <br><br>";
>
> // now get mail recipients
> include("/home/cantabi1/admin_connect.php");
> $sql =3D "SELECT `memberName`, `email`\n"
> =A0 =A0 =A0 =A0 . "FROM `member`\n"
> =A0 =A0 =A0 =A0 . "WHERE active =3D 1 \n";
>
> $result =3D mysql_query($sql, $conn) or die(mysql_error());
>
> // and generate mail for each active member
>
> while ($row =3D mysql_fetch_assoc($result)) {
> =A0 =A0 $to =3D $row['email'];
>
> =A0 =A0 $message =3D "Dear " . $row['memberName'] . ",\n\n $body";
>
> =A0 =A0 if (mail($to, $subject, $body, $headers)) {
> =A0 =A0 =A0 =A0 echo "mail sent to " . $row['memberName'] . "<br/><br/>";
> =A0 =A0 }
> =A0 =A0 else {
> =A0 =A0 =A0 =A0 echo "error in sending mail to " . $row['memberName'] . "=
<br/><br/
>
> >";
> =A0 =A0 }
> } //endwhile
>
> ?>

Take a look at:
http://www.google.co.uk/search?hl=3Den&q=3Dphp+magic+quotes
0
paul_lautman (2109)
8/18/2010 9:38:45 AM
El 18/08/2010 11:15, Derek Turner escribió/wrote:
> I have a script for sending 'round-robin' emails to choir members
> appended below.
>
> The data (sender, body, subject) is passed from an HTML form using POST.
>
> The script works fine except that apostrophes, quotes etc. appear
> 'escaped' in the text of the email e.g. don\'t
>
> Not a deal-breaker but untidy: can I clean this up somehow?

It can be easy to fix... or not. Your server has the Magic Quotes 
feature enabled:

http://es2.php.net/magic_quotes

You can disable them as explained on the link.

However, before disabling it you need to make sure that your code does 
not rely on this feature to escape input data in SQL queries. You appear 
to be using good old MySQL extension so must use 
mysql_real_escape_string() to inject data into your SQL code.

> $sender = $_POST['sender'];
[...]
> $headers = "From: $sender \r\n" .
>          "X-Mailer: PHP/" . phpversion() . "\r\n";
[...]
>      if (mail($to, $subject, $body, $headers)) {

Oh my, you should not be doing this. If $_POST['sender'] contains a line 
feed, anyone can use your server to send spam or anything they want:

http://en.wikipedia.org/wiki/E-mail_injection



-- 
-- http://alvaro.es - Álvaro G. Vicario - Burgos, Spain
-- Mi sitio sobre programación web: http://borrame.com
-- Mi web de humor satinado: http://www.demogracia.com
--
0
UTF
8/18/2010 9:43:13 AM
On 18 Aug 2010 09:15:28 GMT, Derek Turner <frderek@cesmail.net> wrote:

>The data (sender, body, subject) is passed from an HTML form using POST.
Not a problem if only you are allowed to use this but there could be
further security issues if this was in public view.  I'm sure you know
this.
>
>The script works fine except that apostrophes, quotes etc. appear 
>'escaped' in the text of the email e.g. don\'t
>
>Not a deal-breaker but untidy: can I clean this up somehow?
>
><?php
>$sender = $_POST['sender'];
>$body = $_POST['body'];
>$subject = $_POST['subject'];

Replace that with:

if (get_magic_quotes_gpc()) {
$sender =stripslashes( $_POST['sender']);
$body = stripslashes($_POST['body']);
$subject = stripslashes($_POST['subject']);
}
else {
$sender = $_POST['sender'];
$body = $_POST['body'];
$subject = $_POST['subject']; 

}
-- 
Geoff Berrow (Put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs www.4theweb.co.uk/rfdmaker

0
Geoff
8/18/2010 10:27:03 AM
On Wed, 18 Aug 2010 11:43:13 +0200, Álvaro G. Vicario wrote:

>
> 
> It can be easy to fix... or not. Your server has the Magic Quotes
> feature enabled:
> 
> http://es2.php.net/magic_quotes
> 
> You can disable them as explained on the link.
> 
I don't think I can: I don't think I can change any PHP settings but will 
investigate.
> 
> Oh my, you should not be doing this. If $_POST['sender'] contains a line
> feed, anyone can use your server to send spam or anything they want:
> 
> http://en.wikipedia.org/wiki/E-mail_injection

Thank you for that warning. The 'From input' is a radio button choice so 
can not have a line-feed. Also the HTML form is behind .htaccess, not 
indexed and available only to me and the musical director. HOWEVER having 
read the article I will change over to Zend_Mail ASAP!
0
Derek
8/18/2010 11:18:32 AM
On Wed, 18 Aug 2010 11:27:03 +0100, Geoff Berrow wrote:

> On 18 Aug 2010 09:15:28 GMT, Derek Turner <frderek@cesmail.net> wrote:
> 
>>The data (sender, body, subject) is passed from an HTML form using POST.
> Not a problem if only you are allowed to use this but there could be
> further security issues if this was in public view.  I'm sure you know
> this.

See my answer to Alvaro upthread.

> 
> Replace that with:
> 
> if (get_magic_quotes_gpc()) {
> $sender =stripslashes( $_POST['sender']); $body =
> stripslashes($_POST['body']); $subject =
> stripslashes($_POST['subject']); }
> else {
> $sender = $_POST['sender'];
> $body = $_POST['body'];
> $subject = $_POST['subject'];
> 
> }

Brilliant thanks. I might try turning off magicquotes in this folder 
using .htaccess first.
0
Derek
8/18/2010 11:34:08 AM
On 18 Aug 2010 11:18:32 GMT, Derek Turner <frderek@cesmail.net> wrote:

>> Oh my, you should not be doing this. If $_POST['sender'] contains a line
>> feed, anyone can use your server to send spam or anything they want:
>> 
>> http://en.wikipedia.org/wiki/E-mail_injection
>
>Thank you for that warning. The 'From input' is a radio button choice so 
>can not have a line-feed. Also the HTML form is behind .htaccess, not 
>indexed and available only to me and the musical director. HOWEVER having 
>read the article I will change over to Zend_Mail ASAP!

The radio button is no defence unfortunately.  Having it password
protected will help.  For just two of you you could have two separate
pages with from addresses hard coded.
-- 
Geoff Berrow (Put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs www.4theweb.co.uk/rfdmaker

0
Geoff
8/18/2010 12:31:47 PM
Derek Turner wrote:
> On Wed, 18 Aug 2010 11:43:13 +0200, Álvaro G. Vicario wrote:
> 
>>
>> It can be easy to fix... or not. Your server has the Magic Quotes
>> feature enabled:
>>
>> http://es2.php.net/magic_quotes
>>
>> You can disable them as explained on the link.
>>
> I don't think I can: I don't think I can change any PHP settings but will 
> investigate.
>> Oh my, you should not be doing this. If $_POST['sender'] contains a line
>> feed, anyone can use your server to send spam or anything they want:
>>
>> http://en.wikipedia.org/wiki/E-mail_injection
> 
> Thank you for that warning. The 'From input' is a radio button choice so 
> can not have a line-feed. Also the HTML form is behind .htaccess, not 
> indexed and available only to me and the musical director. HOWEVER having 
> read the article I will change over to Zend_Mail ASAP!

Álvaro is correct.  You must ALWAYS check user input.  Sure, the input 
on your form is a radio button. But how do you know the input is coming 
from YOUR form?  I could create a form containing anything I want and 
direct it at your page.  It's a favorite trick of hackers.

NEVER trust user input!

-- 
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
0
jstucklex (14659)
8/18/2010 12:54:14 PM
..oO(Derek Turner)

>On Wed, 18 Aug 2010 11:43:13 +0200, �lvaro G. Vicario wrote:
>
>>
>> 
>> It can be easy to fix... or not. Your server has the Magic Quotes
>> feature enabled:
>> 
>> http://es2.php.net/magic_quotes
>> 
>> You can disable them as explained on the link.
>> 
>I don't think I can: I don't think I can change any PHP settings but will 
>investigate.

Then use get_magic_quotes_gpc() to check the setting and use
stripslashes() on your input data if necessary to get the raw values.

>> Oh my, you should not be doing this. If $_POST['sender'] contains a line
>> feed, anyone can use your server to send spam or anything they want:
>> 
>> http://en.wikipedia.org/wiki/E-mail_injection
>
>Thank you for that warning. The 'From input' is a radio button choice so 
>can not have a line-feed.

It can. It doesn't matter if it's a radio button, checkbox or a hidden
field. _Everything_ can be manipulated! I won't even have to use my own
form to send arbitrary data to your script - there are tools and browser
extensions available which allow exactly that.

>Also the HTML form is behind .htaccess, not 
>indexed and available only to me and the musical director.

This is no reason to not do it right! Maybe you want to use the same
script again in some other public project later or the number of people
which are allowed to use it increases. Just because a sloppily written
scripts works for now doesn't mean it will still work in a year or so.

Do it right, always! Even in an intranet or a protected area. And do it
right from the beginning. Bad habits are hard to break.

>HOWEVER having 
>read the article I will change over to Zend_Mail ASAP!

PHPMailer might be an option as well.

Micha
0
Michael
8/18/2010 1:24:01 PM
Many thanks to all who helped.

FWIW working, more secure script follows.

<?php
set_include_path(get_include_path() . PATH_SEPARATOR . '/home/cantabi1/
library');
include_once 'Zend/Mail.php';

if (get_magic_quotes_gpc()) {
$sender =stripslashes( $_POST['sender']);
$body = stripslashes($_POST['body']);
$subject = stripslashes($_POST['subject']);
}
else {
$sender = $_POST['sender'];
$body = $_POST['body'];
$subject = $_POST['subject']; 
}

// now get mail recipients
include("/home/cantabi1/admin_connect.php");
$sql = "SELECT `memberName`, `email`\n"
        . "FROM `member`\n"
        . "WHERE active = 1 \n";

$result = mysql_query($sql, $conn) or die(mysql_error());

// and generate mail for each active member

while ($row = mysql_fetch_assoc($result)) {
    $to = $row['email'];
    $message = "Dear " . $row['memberName'] . ",\n\n$body";
    
    $mail = new Zend_Mail();

	$mail->setFrom($sender);
	$mail->addTo($to);
	$mail->setSubject($subject);
	$mail->setBodyText($message);
	$mail->addHeader('X-mailer', 'PHP '.phpversion());

    if ($mail->send()) {
        echo "mail sent to " . $row['memberName'] . "<br/><br/>";
    }
    else {
        echo "error in sending mail to " . $row['memberName'] . "<br/><br/
>";
    }
} //endwhile

?>
0
frderek (43)
8/18/2010 8:54:58 PM
El 18/08/2010 13:18, Derek Turner escribió/wrote:
> On Wed, 18 Aug 2010 11:43:13 +0200, Álvaro G. Vicario wrote:
>> It can be easy to fix... or not. Your server has the Magic Quotes
>> feature enabled:
>>
>> http://es2.php.net/magic_quotes
>>
>> You can disable them as explained on the link.
>>
> I don't think I can: I don't think I can change any PHP settings but will
> investigate.

Even the crappiest cheap hosting plans allow some sort of customization 
so you probably have an expensive enterprise plan ;-P


>> Oh my, you should not be doing this. If $_POST['sender'] contains a line
>> feed, anyone can use your server to send spam or anything they want:
>>
>> http://en.wikipedia.org/wiki/E-mail_injection
>
> Thank you for that warning. The 'From input' is a radio button choice so
> can not have a line-feed. Also the HTML form is behind .htaccess, not
> indexed and available only to me and the musical director. HOWEVER having
> read the article I will change over to Zend_Mail ASAP!

mail() is fine for quick stuff, just make sure you validate whatever 
goes in the $header parameter.



-- 
-- http://alvaro.es - Álvaro G. Vicario - Burgos, Spain
-- Mi sitio sobre programación web: http://borrame.com
-- Mi web de humor satinado: http://www.demogracia.com
--
0
8/19/2010 6:25:55 AM
On Thu, 19 Aug 2010 08:25:55 +0200, "�lvaro G. Vicario"
<alvaro.NOSPAMTHANX@demogracia.com.invalid> wrote:

>> I don't think I can: I don't think I can change any PHP settings but will
>> investigate.
>
>Even the crappiest cheap hosting plans allow some sort of customization 

For magic quotes?  I doubt it.
-- 
Geoff Berrow (Put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs www.4theweb.co.uk/rfdmaker

0
Geoff
8/19/2010 7:37:10 AM
El 19/08/2010 9:37, Geoff Berrow escribi�/wrote:
> On Thu, 19 Aug 2010 08:25:55 +0200, "�lvaro G. Vicario"
> <alvaro.NOSPAMTHANX@demogracia.com.invalid>  wrote:
>
>>> I don't think I can: I don't think I can change any PHP settings but will
>>> investigate.
>>
>> Even the crappiest cheap hosting plans allow some sort of customization
>
> For magic quotes?  I doubt it.

I meant crappy as in "cheap", not as in "GoDaddy".


-- 
-- http://alvaro.es - �lvaro G. Vicario - Burgos, Spain
-- Mi sitio sobre programaci�n web: http://borrame.com
-- Mi web de humor satinado: http://www.demogracia.com
--
0
8/19/2010 10:47:58 AM
Reply:

Similar Artilces:

'is not' or '!='
A newbie question to you; what is the difference between statements like: if x is not None: and if x != None: Without any context, which one should be preferred? IMHO, the latter is more readable. On 2014-08-18 21:35, ElChino wrote: > A newbie question to you; what is the difference between statements > like: > if x is not None: > and > if x != None: > > Without any context, which one should be preferred? > IMHO, the latter is more readable. > "x == y" tells you whether x and y refer to objects that are equal. "x is y" tells you whether x and y actually refer to the same object. In the case of singletons like None (there's only one None object), it's better to use "is". "ElChino" <elchino@cnn.cn>: > A newbie question to you; what is the difference between statements > like: > if x is not None: > and > if x != None: Do the following: take two $10 bills. Hold one bill in the left hand, hold the other bill in the right hand. Now, the bill in the left hand "is not" the bill in the right hand. However, the bill in the left hand "==" the bill in the right hand. > Without any context, which one should be preferred? > IMHO, the latter is more readable. In almost all cases, both tests would result in the same behavior. However, the "is not" test is conceptually the correct one since you want...

'^=' and '~='?
Hello, What is the difference between '^=' and '~='? Thanks, Duckhye ...

Failed opening required 'PEAR.php' (include_path='F:\www\include') in F:\Program Files\PHP\PEAR\Text\CAPTCHA.php on line 22
Hi, Guys=EF=BC=8Cwhen I run my site ,I got some errors: Warning: require_once(PEAR.php) [function.require-once]: failed to open stream: No such file or directory in F:\Program Files\PHP\PEAR \Text\CAPTCHA.php on line 22 Fatal error: require_once() [function.require]: Failed opening required 'PEAR.php' (include_path=3D'F:\www\include') in F:\Program Files \PHP\PEAR\Text\CAPTCHA.php on line 22 It appears that it cann't find the pear.php ,but i checked my dir,and this file was there,and also I have my php.ini file checked,the include_path=3Dinclude_path=3D".;F:\Program Files\PHP\pear;F:\www \include" ,it looks all right,was there anything I have missed in the config file?Or something wrong ? Wish somebody can help me out. Thanks, Mikay >Warning: require_once(PEAR.php) [function.require-once]: failed to >open stream: No such file or directory in F:\Program Files\PHP\PEAR >\Text\CAPTCHA.php on line 22 >Fatal error: require_once() [function.require]: Failed opening >required 'PEAR.php' (include_path='F:\www\include') in F:\Program Files >\PHP\PEAR\Text\CAPTCHA.php on line 22 So where is the pear.php file? >It appears that it cann't find the pear.php ,but i checked my dir,and >this file was there,and also I have my php.ini file checked,the >include_path=include_path=".;F:\Program Files\PHP\pear;F:\www >\include" ,it looks all right,was there anything I have missed in the >config...

to get my ''PLP''
I tried to install the MATLAB in my computer but idon't have my personal license password.i would like how to get my PLP? buy it Hi, http://www.mathworks.com/support/solutions/data/1-16LU2.html J�r�me ...

get(get(gca,'Children'),'xdata')
hi everybody i use get and gca to find the points of a plot by below m-file : syms x y B=0.3;d=1;m1=0.5;m2=1-m1; u=x-m1*x/(x^2+y^2)-m2*(x-B*m1*x/(x^2+y^2)-d)/((x-B*m1*x/(x^2+y^2)-d)^2+(y-B*m1*y/(x^2+y^2))^2); v=y-m1*y/(x^2+y^2)-m2*(y-B*m1*y/(x^2+y^2))/((x-B*m1*x/(x^2+y^2)-d)^2+(y-B*m1*y/(x^2+y^2))^2); k11=diff(u,x); k12=diff(u,y); k21=diff(v,x); k22=diff(v,y); det=k11*k22-k12*k21; subplot(2,1,1); ezplot(det,[-2,2],[-2,2]); t=get(get(gca,'Children'),'xdata') my problem is this for some value of B (for example B=2) it give the xdata of plot in form of array [1,n] .it is ok u...

'''''''''''''The Running Update/Append Queries Using VBA code Ordeal''''''''''''''
Hello fellow programmers, I am trying to run an append/update query from code, a command button on a form initiates the queries. the format i am using is; _____________________________________________________ SELECT "criteria" FROM "criteria" WHERE "criteria" UPDATE/APPEND "field selections" RecordSource "qryExample" = above text strings" _______________________________________________________________________ When i am running a SELECT query in this manner it works fine with no problems, and accepts the values of specified linked form fields. This never works when doing an APPEND/UPDATE query. It can never find the values of linked form fields, Access always asks for the parameter value of the field(s) in question, or Access comes up with an error 3323 - No recordset. I am sure there are other people that have had this problem. What is the difference between Select queries and append/update queries? the append/update queries never seem to be able to find values in linked form fields. Can anyone shed any light on this or point to a knowledgebase Item, or even recommend a book focusing on this subject, I will go and buy it now. I have been for up 2 nights trying to acomplish this and now considering suicide, please help. Thanks In advance, Aaron. I know of two ways you can accomplish this. 1. You can create the SQL script for you append or update query and run the script with DoCmd.RunSQL. 2. You can create a...

How do I get rid of Mail's 'suggestions'
Actually, not me, my mother. She once typed my email address wrongly into Mail's 'To' field. Now, if she starts to type my address in that field (I'm trying to get her to use the address book instead), the programme brings up a list of everything she's ever typed there starting with the letter 'S', with the incorrect address at the top of the list. She forgets that this address is wrong, selects it, and wonders why her email bounces. Where are these 'suggestions' stored? Is there a preference I can disable or a file a can trash to get rid of them, or, at le...

Controlling the text in plot 'xyz' title 'text'
Hi Can somebody help me out? I want to change the text fonts which appear in keys for every line, in command: plot "file" title "xyz" How to use desired font size for xyz above? Thanks -- Your's truly Masroor Bangesh help title: gnuplot> help title The `set title` command produces a plot title that is centered at the top of the plot. `set title` is a special case of `set label`. Syntax: set title {"<title-text>"} {offset <offset>} {"<font>{,<size>}"} {{textcolor | tc} {lt <line_type> | default}} {{no}enhanced} show title If <offset> is specified the title is moved by the given offset where <offset> is specified by either x,y or x,y,z, and may be preceded by `first`, `second`, `graph`, `screen`, or `character` to select the coordinate system. See `coordinates` for details. By default, the `character` coordinate system is used. For example, "`set title 0,-1`" will change only the y offset of the title, moving the title down by roughly the height of one character. <font> is used to specify the font with which the title is to be written; the units of the font <size> depend upon which terminal is used. `textcolor lt <n>` sets the text color to that of line type <n>. `noenhanced` requests that the title not be processed by the enhanced text mode parser, even if...

getting rid of '{}'
Hello, I am using the 'list' data structure to build up a SIP INVITE message. When I do that, the final message that is built has lotsa '{' braces in it. How do I get rid of them? A workaround could be to use 'lreplace', but it needs me to enter the exact position/index value of the braces (which I can get using lsearch). I just wanted to know if there is a cleaner solution. Best Regards, Anuj Mistry. 42 % string map {\{ "" \} ""} "{this is {an example {of nested braces}}}" this is an example of nested braces anuj wrote: > Hello, > > I am using the 'list' data structure to build up a SIP INVITE message. > When I do that, the final message that is built has lotsa '{' braces in > it. How do I get rid of them? > > A workaround could be to use 'lreplace', but it needs me to enter the > exact position/index value of the braces (which I can get using > lsearch). > > I just wanted to know if there is a cleaner solution. You need to provide us an example of what the data and what the commands you are using to get these "unwanted braces". Also provide us with what you want to have at the end. Unless a SIP INVITE message is a Tcl List, there is a good change you should not be using list commands, but rather string commands to build up the message. anuj wrote: > Hello, > > I am using the 'list' data structure to build up a SIP INVIT...

How to get rid of '../..'
Hi, How can I get rid of '../..' in file name?.. For example, I need to get absolute file name from string '../../usr/bin/'. I find one solution with sed and I want to find maybe more elegant solution or just another way how I can make it. Sapfeer <Sapfeer@gmail.com> writes: >Hi, >How can I get rid of '../..' in file name?.. For example, I need to >get absolute file name from string '../../usr/bin/'. I find one >solution with sed and I want to find maybe more elegant solution or >just another way how I can make it. In POSIX shell synta...

'''''''''''''The Running Update/Append Queries Using VBA code Ordeal'''''''''''''' #2
Hi, Thanks for ur help there HJ. I know how to do the tasks you specified there. I would like for the update query to use field values from some of the fields on the form (frmInvoices) such as InvoiceNumber, DateFrom, DateTo. My problem is that an append/update query can't find the values in the open Form (frmInvoices) when I specify them as; [Forms]![frmInvoices]![InvoiceNumber] a select query has no problem finding the field values on a form. please help. Aaron Hi Aaron, Could you post the entire code that you are having trouble with? Now it is not possible to see what goes wrong. HJ "Aaron" <aaron@rapid-motion.co.uk> wrote in message news:260d7f40.0408120245.2f3d01f8@posting.google.com... > Hi, > > Thanks for ur help there HJ. > > I know how to do the tasks you specified there. > > I would like for the update query to use field values from some of the > fields on the form (frmInvoices) such as InvoiceNumber, DateFrom, > DateTo. My problem is that an append/update query can't find the > values in the open Form (frmInvoices) when I specify them as; > > [Forms]![frmInvoices]![InvoiceNumber] > > a select query has no problem finding the field values on a form. > > please help. > > Aaron First off, if you are not always using all the parameters specified in your form, then you have to add parameters to your query on the fly. Also, you can't just do something like qdf.SQL = "SE...

if str_mo not in ('','.') and str_da not in ('','.') and str_yy not in ('','.') Any shorter ?
Hi, there. =20 I'm just curious if it ever dawned on anybody how to abbreviate this line : if str_mo not in ('','.') and str_da not in ('','.') and str_yy not in ('','.')=20 =20 Igor Kurbeko Clinical Programmer Analyst 678 336 4328 ikurbeko@atherogenics.com =20 no brain no pain =20 how about: if not (str_mo in ('','.') or str_da in ('','.') or str_yy in ('','.')) OR if not (missing(str_mo) or missing(str_da) or missing(str_yy)) Eric On 22 Oct 03 21:13:37 GMT, ikurbeko@ATHER...

How to browse all PropertyName for 'get' and 'set' function'?
hello all: Is there a way that I could browse all PropertyName for function 'get' and 'save'. For example: I want to know screen size then I use scrsz = get(0,'ScreenSize'); However, sometimes I don't know the correct propertyName(here is 'ScreenSize') for the function get or set. Thank you -Daniel Mark set(0) or h=handle(0); Then double click 'h' in workspace browser. Stuart "Daniel Mark" <danielmarkhot@Hotmail.com> wrote in message news:eee5db3.-1@webx.raydaftYaTP... > hello all: > > Is there a way that I could br...

A function with 'and' , 'not' , 'null' , 'car' and 'cdr'
What's this ? (defun enigma (x) (and (not (null x)) (or (null (car x)) (enigma (cdr x))))) "I suppose I should learn Lisp, but it seems so foreign." - Paul Graham, Nov 1983 On Wed, Oct 07 2015, CAI GENGYANG wrote: > What's this ? > > > (defun enigma (x) > (and (not (null x)) > (or (null (car x)) > (enigma (cdr x))))) Bad taste? It returns T if the list X contains nil as an element. It would be clearer to write (some #'null x). Helmut CAI GENGYANG ...

error: expected '=', ',', ';', 'asm' or '__attrib
Hi I'm trying to compile an ADC Driver & come acrosss the following error. I've no experience writing drivers before, and hence have no clue how to fix it. Hope someone out there has encountered the problem & suggesst a fix for the same. The Error is I get is : qadc.c: At top level: qadc.c:97: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'qadc_read' make: *** [qadc.o] Error 1 [root@localhost qadc]# ########################################################################### ADC Driver Code ##...

error: expected '=', ',', ';', 'asm' or '__attrib
Hi I'm trying to compile an ADC Driver & come acrosss the following error. I've no experience writing drivers before, and hence have no clue how to fix it. Hope someone out there has encountered the problem & suggesst a fix for the same. The Error is I get is : qadc.c: At top level: qadc.c:97: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'qadc_read' make: *** [qadc.o] Error 1 [root@localhost qadc]# ########################################################################### ADC Driver Code ########################################################################### #define MODULE #define __KERNEL__ #include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> /* printk */ #include <linux/fs.h> / #include <linux/errno.h> /* error codes */ #include <linux/types.h> /* size_t */ #include <linux/proc_fs.h> /* proc file system */ #include <linux/fcntl.h> #include <asm/system.h> /* cli, flags */ #include <asm/uaccess.h> /* copy from/to user */ /*Registers to get qadc access*/ volatile unsigned short * qadcmcr = (unsigned short *)0x40190000; volatile unsigned short * qacr0 = (unsigned short *)0x4019000a; volatile unsigned short * qacr1 = (unsigned short *)0x4019000c; volatile unsigned short * qacr2 = (unsigned short *)0x4019000e; volatile unsigned short * qasr0 = (unsigned short *)0x40190010; volatile unsigned short * qasr1...

'<?' versus '<?php'
Hi folks, I recently ran into a PHP5 install that rejects the idiom, <? // code ? > and in fact renders that in the output that is sent to the browser. Yikes! The sysadmins could not say why this was but suggested it was a PHP5 thing. So my question to you: is <?php going to become required? And if it is will we not be allowed to echo by the shorthand <?php=$foo?> as we used to <?=$bar?> ? As that was broken too. Thanks for any advice, JG jerrygarciuh wrote: > Hi folks, > > I recently ran into a PHP5 install that rejects the idiom, <? // code ? >> and in fact renders that in the output that is sent to the browser. > Yikes! > > The sysadmins could not say why this was but suggested it was a PHP5 > thing. > > So my question to you: is <?php going to become required? And if it > is will we not be allowed to echo by the shorthand <?php=$foo?> as we > used to <?=$bar?> ? As that was broken too. > > Thanks for any advice, > > JG > This is PHP short_open_tag setting in your php.ini file. In PHP5 it is set to off. Off is recommended because the short tag can cause problems with xml, which uses the same tags. It also means you can't use the <?= syntax. On Apache, you can override this in your .htaccess file, if the host allows it. -- ================== Remove the "x" from my email address Jerry Stuckle JDS Computer Training Corp. jstucklex@attg...

'hi' i am the guy who hopes to 'get'
hi i am a puget sound 'front' welfare recipient i hope 'to get' so i bitch and moan and make a nuisance of myself i wish i could provide value but i can't so all i do is moan and whine On Sun, 27 Jul 2003 21:41:56 -0700, GreyCloud <cumulus@mist.com> wrote: >asso wrote: >> hi =20 >> i am a puget sound 'front' welfare recipient how sad. best to leave town, forever =20 >> i hope 'to get' ....there are Gift taxes =20 >> so i bitch and moan and make a nuisance of myself I'm not the only soul accused of hit-n-...

'[OFF]' as in 'offensive'???
Hi, given that 'off-topicness' is indicated as '[OT]' and taking a look at those postings that started the threads indicated as '[OFF]' (which may both be seen as being somewhat offensive) may lead to the conclusion that '[OFF]' stands for offensiveness. I don't think that this is the intended meaning so what actually *does* '[OFF]' mean? I never came across that abbreviation before (although I have been around on the USENET for quite some time) but maybe it is worth knowing? Josef 'Jupp' Schugt NOTE: mails >100 KiB are ignored -- German edition of comp.lang.ruby FAQ - http://oss.erdfunkstelle.de/ruby/ Aurox Linux - http://qurl.net/7q | http://qurl.net/7r - Firefox Thunderbird - http://qurl.net/7s | http://qurl.net/7t - Liferea Enigmail - http://qurl.net/7u | http://qurl.net/7v - GnuPG [Josef 'Jupp' Schugt <jupp@gmx.de>, 2004-12-10 23.20 CET] > I don't think that this is the intended meaning so what actually *does* > '[OFF]' mean? Off-topic. ...

'a'..'z'
Is it possible to achieve something like this? switch (mystring.charAt(0)) { case 'a'..'z': // do something break; } "cruster" <cruster@gmail.com> wrote in message news:1151319731.988814.326200@m73g2000cwd.googlegroups.com... > Is it possible to achieve something like this? > > switch (mystring.charAt(0)) { > case 'a'..'z': > // do something > break; > } > There are times when an if statement may be more appropriate ;) Sorry - java is not VB :) -- LTP :) cruster schreef: > Is it possible to achieve somethi...

Override 'and' and 'or'
Is it possible to override 'and' and/or 'or'? I cannot find a special method for it... __and__ and __rand__ and __or__ and __ror__ are for binary manipulation... any proposals? Have marvelous sunday, Marco Dekker <m.aschwanden@gmail.com> wrote: > Is it possible to override 'and' and/or 'or'? I cannot find a special > method for it... __and__ and __rand__ and __or__ and __ror__ are for > binary manipulation... any proposals? If you want to customize the truth value testing you have to implement __nonzero__ " __nonzero__( self) Call...

logical to 'on' / 'off'
Hi, is there a function implemented doing this conversion? my Problem is, that I want to use the following code: set(handles.edit_curr_trq_sl,'Enable',get(hObject,'Value')) where get(hObject,'Value') gives the state of a checkbox thank you! function [str]=tf2oo(logic) switch logic case 0 str='off'; case 1 str='on'; end%switch end%function tf2oo() while i do not know a built in function, I use my own:) meisterbartsch wrote: > > > function [str]=tf2oo(logic) > switch logic > case 0 > str='off'; &g...

Re: '^=' and '~='?
Duckhye, According to the doc ( http://xrl.us/befwjx ) they, and one other set of characters, and the mnemonic 'NE' all represent 'NOT EQUAL'. Art ------- On Wed, 11 Feb 2009 16:52:40 -0600, Duck-Hye Yang <dyang@CHAPINHALL.ORG> wrote: >Hello, >What is the difference between '^=' and '~='? > >Thanks, >Duckhye ...

replacement for '{' and '}' ?
I am still playing around with what kind of syntax I would like to mark up my documents. Are there equivalent long substitutes for { and } when they are not used to describe arguments to functions? Something like \begin{group} and \end{group}. In other words, if I could force myself to write, say, \begin{group} \it ... \end{group} instead of {\it ... }, then I believe I could identify from the markup context what is an argument that belongs to a just invoked macro and what is text. {Of course, in this context, \textit{...} would be better.} No more ambiguity whether a in \myfunction{a} is an argument or just text. Is there a way to make latex barf when it sees an ordinary '{' in text, rather than \begin{group}, but not barf when I want it (to denote macro arguments)? Regards, /iaw On Aug 16, 6:01=A0pm, "ivo...@gmail.com" <ivo...@gmail.com> wrote: > Is there a way to make latex barf when it sees an ordinary '{' in > text, rather than \begin{group}, but not barf when I want it (to > denote macro arguments)? What do you mean exactly? I don't understand. Do you have in mind your- to-be-new-syntax or just regular latex? Cheers, Tomek ivowel@gmail.com wrote: > I am still playing around with what kind of syntax I would like to > mark up my documents. > > Are there equivalent long substitutes for { and } when they are not > used to describe arguments to functions? Something like \begin{group} > and \end{gr...

Web resources about - Getting rid of 'escape' backslashes in text - comp.lang.php

Resources last updated: 3/23/2016 4:19:58 PM