Wrox Programmer Forums
|
Beginning PHP Beginning-level PHP discussions. More advanced coders should post to the Pro PHP forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning PHP section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 22nd, 2004, 07:39 AM
Authorized User
 
Join Date: Jul 2004
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Default

yes thanks, i now know that you use <BR> if you are going to use the r=text as html, and /r/n (it worked) if it is in text to be sent or used BUT NOT on screen there and then.

Now struggling with "if $var contains "Yes"
i had tried if ($Var = 'Yes') which seems to be what i was supposed to do.

 
Old July 22nd, 2004, 07:55 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 256
Thanks: 0
Thanked 0 Times in 0 Posts
Default

The "=" sign is an assignment operator, $Var = 'Yes' sets $Var to equal 'Yes' (even in an if declaration: this is so you can do things like if($result=mysql_query....), which will fail if the actual query fails, since mysql_query will evaluate to false).

To test whether $Var is equal to 'Yes' use "==" the equivalence operator. i.e.
if($Var == 'Yes'){

Furthermore, you could use the identicality operator, as in:

if($Var ==== '1'){

Which tests for data type as well, so the above test will fail unless $Var is a 1-character string containing the character 1.

Dan
 
Old July 23rd, 2004, 07:58 AM
Authorized User
 
Join Date: Jul 2004
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Dan

Thanks a lot - script is now running 100% the way I want.
You can try it at http://www.tdoc.org.uk/Gen_NDGH_IL_IL000635.htm
Just emails me tho...


 
Old August 7th, 2004, 10:44 AM
Authorized User
 
Join Date: Jul 2004
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Default

hi

here's some output - between the **** lines

why is my text suddenly broken up with unwanted new lines inserted.

the code creating is last.

regards

****************************
Re: Your Job No: 01/TDOC
Your Reference: 00000004
Our Reference: longer fi
lename

Our Response is:
longer filename

To import into TDOC, use atta
ched Gen_Response_01/TDOC_00000004_CG.TGN
This email was generated by the T
DOC PHP Response despatcher
*********************************

    $email_content ='';
    $email_content .= "Re: Your Job No: $F_jobno\r\n" ; // jobno being replied to
    $email_content .= "Your Reference: $F_docno\r\n" ; // docno being replied to
    $email_content .= "Our Reference: $F_REFBACK\r\n" ; // entered reference
    $email_content .= "\r\n" ;
    $email_content .= "Our Response is:\r\n" ;
    $email_content .= "$F_RESPONSE\r\n" ; // entered response
    $email_content .= "\r\n" ;
    $email_content .= "To import into TDOC, use attached $att_name\r\n" ;
    $email_content .= "This email was generated by the TDOC PHP Response despatcher" ;

    // send response
    $mime = new MIME_mail($F_responder, $F_requester, $title, $email_content );
    $mime->attach(stripslashes($att_content), "", "", BASE64, "", $att_name);
    $mime->send_mail();







Similar Threads
Thread Thread Starter Forum Replies Last Post
Please help the newbie!! shelly.aix Visual Basic 2008 Essentials 2 December 16th, 2008 07:35 AM
Newbie help... mkruger XSLT 7 October 24th, 2007 02:33 AM
Newbie here jmac731976 HTML Code Clinic 13 August 29th, 2007 03:54 PM
Newbie please help indyanguy XSLT 1 September 2nd, 2005 09:18 AM
Newbie Help! TheShadow Javascript 1 March 21st, 2005 03:42 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.