Re: [PHP] webform spam prevention

2013-04-04 Thread Terry Ally (Gmail)
I am running captcha but the problem that I am having is that fly-by-night
SEO marketeers are using the form to send marketing messages anyway. We get
so many spam messages that I put up in red letters on the form that we do
not want cold-calling SEO marketing messages. Since that message there has
been a significant reduction in emails from legitimate SEO companies.

However there is an upsurge in fly-by-night individuals who are all using
Gmail addresses and originating in the USA. It seems as though someone is
selling them a database of websites to contact.

I wish there was a way of dealing with these people who evidently cannot
read. Is there a technological solution?




On 4 April 2013 17:28, Maciek Sokolewicz tula...@php.net wrote:

 On 4-4-2013 14:27, tamouse mailing lists wrote:

 On Apr 4, 2013 3:57 AM, Ashley Sheridan a...@ashleysheridan.co.uk
 wrote:


 One type I've seen (and use myself) which is gaining traction is that of

 asking for a human type of response to a question, or have them perform a
 simple mathematical problem, where the numbers are replaced with something
 else.



 Those can be great. The sticky part seems to be i18n and common user
 experience to answer the question, but this seem much easier to work with
 then throwing something horrible at your users.


 Still, questions like Does the sun rise in the morning or evening? or
 Is the sky usually blue or red? should be answerable by pretty much any
 human capable of understanding at least very basic things. I'm pretty sure
 that even if you have a severely reduced mental capacity, you can still
 answer these types of questions. And if you can't, you usually are in the
 wrong place anyway.

 - Tul

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




-- 
*Terry Ally*
Twitter.com/terryally
Facebook.com/terryally
~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~
To print or not to print this email is the environmentally-searching
question!
Which has the highest ecological cost? A sheet of paper or constantly
switching on your computer and connecting to the Internet to read your
email?


Re: [PHP] Re: Open form in new window

2013-03-04 Thread Terry Ally (Gmail)
You could echo HTML code e.g.

form action=result.php method=post
Number: input id=quantity type=text /
*button type=button onclick=OpenWindow()Submit/button*
/form

or include it as one of your form attributes:

*form action=demo_form.asp method=get target=_blank*
  First name: input type=text name=fnamebr
  Last name: input type=text name=lnamebr
  input type=submit value=Submit
/form


On 4 March 2013 07:16, Maciek Sokolewicz maciek.sokolew...@gmail.comwrote:

 On 4-3-2013 6:44, John Taylor-Johnston wrote:

 I have many different submit button.
 input value=Update type=submit
 input name=DPRmode value=Enter Data type=submit

 When php processes value=Enter Data, I would like to open a new
 window, but only if I click this one.

 Possible? I knw ther is an HTML target= thingy. Can PHP do anything
 magic?

  No, it can't. PHP is a *serverside* language, while opening a new window
 is fully *clientside*. You could, after recieving the form submission, send
 back a redirect which opens in a new window; but far easier would be to use
 javascript which would open a new window on submission instead.

 PHP is definitly the wrong choice for things like opening browser windows.

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




-- 
*Terry Ally*
Twitter.com/terryally
Facebook.com/terryally
~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~
To print or not to print this email is the environmentally-searching
question!
Which has the highest ecological cost? A sheet of paper or constantly
switching on your computer and connecting to the Internet to read your
email?


Re: [PHP] Re: Open form in new window

2013-03-04 Thread Terry Ally (Gmail)
I was using an example and NOT intended to show ASP.



On 4 March 2013 08:35, Maciek Sokolewicz maciek.sokolew...@gmail.comwrote:

 On 4 March 2013 09:32, Terry Ally (Gmail) terrya...@gmail.com wrote:
  You could echo HTML code e.g.
 Which is still purely HTML and has nothing whatsoever to do with PHP.

 
  form action=result.php method=post
  Number: input id=quantity type=text /
  button type=button onclick=OpenWindow()Submit/button
  /form
 
  or include it as one of your form attributes:
 
  form action=demo_form.asp method=get target=_blank
First name: input type=text name=fnamebr
Last name: input type=text name=lnamebr
input type=submit value=Submit
  /form
 Again, pure HTML, and no PHP involved. Specifically, the (asp??) page
 called in the form action handler will never even be aware of the fact
 that the page was opened in a new window, or at least was supposed to.




-- 
*Terry Ally*
Twitter.com/terryally
Facebook.com/terryally
~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~
To print or not to print this email is the environmentally-searching
question!
Which has the highest ecological cost? A sheet of paper or constantly
switching on your computer and connecting to the Internet to read your
email?


Re: [PHP] Date comparison going wrong, wrong, wrong

2012-11-20 Thread Terry Ally (Gmail)
Dear Duken,

Many thanks for the solution. It worked!

And thanks to everyone else who pitched in with various solutions.

Regards
Terry

On 12 November 2012 10:06, Duken Marga dukenma...@gmail.com wrote:

 Try this:

 $todaydate = strtotime(date(D, M jS, Y g:i:s a));
 $showenddate = strtotime(date(D, M jS, Y g:i:s a,
 strtotime($showsRecord['end_date'])));


 if ($todaydate  $showenddate):
 echo The date of the show has not yet arrived;
 else:
 echo The show has ended;
 endif;

 You must convert both $todaydate and $showendate with strtotime()
 function, then you can compare them.

 On Mon, Nov 12, 2012 at 1:30 AM, Terry Ally (Gmail) 
 terrya...@gmail.comwrote:

 Hi all,

 I am having a problem with comparing time. I am using the following:

 $todaydate = date(D, M jS, Y g:i:s a);
 $showenddate = date(D, M jS, Y g:i:s a,
 strtotime($showsRecord['end_date']));

 if ($todaydate  $showenddate):
 echo The date of the show has not yet arrived;
 else:
 echo The show has ended;
 endif;

 The problem that I am encountering is that PHP is rendering the reverse of
 the equation. For example:

 If today's date is *11 Nov 2012* and the show's end date is *18 Nov 2012*,
 the message that I am getting is *the show has ended* which is wrong. A

 test example is at http://www.lakesidesurrey.co.uk/test.php.

 You can also me what I am doing wrong?

 Thanks
 Terry




 --
 Duken Marga





-- 
*Terry Ally*
Twitter.com/terryally
Facebook.com/terryally
~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~
To print or not to print this email is the environmentally-searching
question!
Which has the highest ecological cost? A sheet of paper or constantly
switching on your computer and connecting to the Internet to read your
email?


Re: [PHP] Date comparison going wrong, wrong, wrong

2012-11-20 Thread Terry Ally (Gmail)
It's a nice shortcut Jim. Never considered that.

Thanks.

On 20 November 2012 21:03, Jim Lucas li...@cmsws.com wrote:

 On 11/12/2012 02:06 AM, Duken Marga wrote:

 Try this:

 $todaydate = strtotime(date(D, M jS, Y g:i:s a));
 $showenddate = strtotime(date(D, M jS, Y g:i:s a,
 strtotime($showsRecord['end_**date'])));


 Won't this give you the same results without the extra conversion steps?

 $todaydate = date(U);

 $showenddate = strtotime($showsRecord['end_**date']);


 if ($todaydate  $showenddate):
  echo The date of the show has not yet arrived;
 else:
  echo The show has ended;
 endif;

 You must convert both $todaydate and $showendate with strtotime()
 function,
 then you can compare them.

 On Mon, Nov 12, 2012 at 1:30 AM, Terry Ally (Gmail)terrya...@gmail.com*
 *wrote:

  Hi all,

 I am having a problem with comparing time. I am using the following:

 $todaydate = date(D, M jS, Y g:i:s a);
 $showenddate = date(D, M jS, Y g:i:s a,
 strtotime($showsRecord['end_**date']));

 if ($todaydate  $showenddate):
  echo The date of the show has not yet arrived;
 else:
  echo The show has ended;
 endif;

 The problem that I am encountering is that PHP is rendering the reverse
 of
 the equation. For example:

 If today's date is *11 Nov 2012* and the show's end date is *18 Nov
 2012*,
 the message that I am getting is *the show has ended* which is wrong. A
 test example is at 
 http://www.lakesidesurrey.co.**uk/test.phphttp://www.lakesidesurrey.co.uk/test.php
 .

 You can also me what I am doing wrong?

 Thanks
 Terry






 --
 Jim Lucas

 http://www.cmsws.com/
 http://www.cmsws.com/examples/




-- 
*Terry Ally*
Twitter.com/terryally
Facebook.com/terryally
~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~
To print or not to print this email is the environmentally-searching
question!
Which has the highest ecological cost? A sheet of paper or constantly
switching on your computer and connecting to the Internet to read your
email?


Re: [PHP] Date comparison going wrong, wrong, wrong

2012-11-11 Thread Terry Ally (Gmail)
Hi Shiplu and Stuart,

Comparing timestamps was my first option. I've reinstated it. Have a look
at http://www.lakesidesurrey.co.uk/test.php (show_source included) and you
will see that PHP is still outputting the wrong thing.

I just can't figure out what's wrong.

Terry

On 11 November 2012 18:48, shiplu shiplu@gmail.com wrote:

 You can always use timestamp which is integer.

 $todaydate = time();
 $showenddate = strtotime($showsRecord['end_date']);


 On Mon, Nov 12, 2012 at 12:30 AM, Terry Ally (Gmail) 
 terrya...@gmail.comwrote:

 Hi all,

 I am having a problem with comparing time. I am using the following:

 $todaydate = date(D, M jS, Y g:i:s a);
 $showenddate = date(D, M jS, Y g:i:s a,
 strtotime($showsRecord['end_date']));

 if ($todaydate  $showenddate):
 echo The date of the show has not yet arrived;
 else:
 echo The show has ended;
 endif;

 The problem that I am encountering is that PHP is rendering the reverse of
 the equation. For example:

 If today's date is *11 Nov 2012* and the show's end date is *18 Nov 2012*,
 the message that I am getting is *the show has ended* which is wrong. A

 test example is at http://www.lakesidesurrey.co.uk/test.php.

 You can also me what I am doing wrong?

 Thanks
 Terry




 --
 Shiplu.Mokadd.im
 ImgSign.com | A dynamic signature machine
 Innovation distinguishes between follower and leader




-- 
*Terry Ally*
Twitter.com/terryally
Facebook.com/terryally
~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~
To print or not to print this email is the environmentally-searching
question!
Which has the highest ecological cost? A sheet of paper or constantly
switching on your computer and connecting to the Internet to read your
email?


Re: [PHP] Date comparison going wrong, wrong, wrong

2012-11-11 Thread Terry Ally (Gmail)
Stuart,

I reversed it as you suggested and every future show is displaying as
having ended.

Terry

On 11 November 2012 19:11, Stuart Dallas stu...@3ft9.com wrote:

 Please include the list when replying.

 On 11 Nov 2012, at 19:08, Terry Ally (Gmail) terrya...@gmail.com
 wrote:

  What I want is the reverse.
 
  I want that if people attempt to access the show page after the show has
 ended that it triggers an error which takes it to another page. The actual
 conditional statement is as follows (which I will replace with timestamp):
 
$todaydate = date(D, M jS, Y g:i:s a);
$showenddate = date(D, M jS, Y g:i:s a,
 strtotime($showsRecord['end_date']));
  if ($todaydate  $showenddate) {
header( 'Location: eventdetails_error.php' ) ;
}

 This is what you have:

 if ($todaydate  $showenddate):
 echo The date of the show has not yet arrivedbr;
 else:
 echo The show has endedbr;
 endif;

 That says: if the current time is later than the end date of the show,
 tell them the date of the show hasn't arrived yet.

 What you mean is: if the current time is later than the end of the show,
 tell them the show has ended.

 if ($todaydate  $showenddate):
 echo The date of the show has not yet arrivedbr;
 else:
 echo The show has endedbr;
 endif;

 It's a simple logic error.

 -Stuart

 --
 Stuart Dallas
 3ft9 Ltd
 http://3ft9.com/

  On 11 November 2012 19:04, Stuart Dallas stu...@3ft9.com wrote:
  On 11 Nov 2012, at 19:00, Terry Ally (Gmail) terrya...@gmail.com
 wrote:
 
   Hi Shiplu and Stuart,
  
   Comparing timestamps was my first option. I've reinstated it. Have a
 look
   at http://www.lakesidesurrey.co.uk/test.php (show_source included)
 and you
   will see that PHP is still outputting the wrong thing.
  
   I just can't figure out what's wrong.
 
  Your comparison is backwards:
 
  if ($todaydate  $showenddate):
 
  should be
 
  if ($todaydate  $showenddate):
 
  -Stuart
 
  --
  Stuart Dallas
  3ft9 Ltd
  http://3ft9.com/
 
   On 11 November 2012 18:48, shiplu shiplu@gmail.com wrote:
  
   You can always use timestamp which is integer.
  
   $todaydate = time();
   $showenddate = strtotime($showsRecord['end_date']);
  
  
   On Mon, Nov 12, 2012 at 12:30 AM, Terry Ally (Gmail) 
 terrya...@gmail.comwrote:
  
   Hi all,
  
   I am having a problem with comparing time. I am using the following:
  
   $todaydate = date(D, M jS, Y g:i:s a);
   $showenddate = date(D, M jS, Y g:i:s a,
   strtotime($showsRecord['end_date']));
  
   if ($todaydate  $showenddate):
  echo The date of the show has not yet arrived;
   else:
  echo The show has ended;
   endif;
  
   The problem that I am encountering is that PHP is rendering the
 reverse of
   the equation. For example:
  
   If today's date is *11 Nov 2012* and the show's end date is *18 Nov
 2012*,
   the message that I am getting is *the show has ended* which is
 wrong. A
  
   test example is at http://www.lakesidesurrey.co.uk/test.php.
  
   You can also me what I am doing wrong?
  
   Thanks
   Terry
  
  
  
  
   --
   Shiplu.Mokadd.im
   ImgSign.com | A dynamic signature machine
   Innovation distinguishes between follower and leader
  
  
  
  
   --
   *Terry Ally*
   Twitter.com/terryally
   Facebook.com/terryally
   ~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~
   To print or not to print this email is the environmentally-searching
   question!
   Which has the highest ecological cost? A sheet of paper or constantly
   switching on your computer and connecting to the Internet to read your
   email?
 
 
 
 
  --
  Terry Ally
  Twitter.com/terryally
  Facebook.com/terryally
  ~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~
  To print or not to print this email is the environmentally-searching
 question!
  Which has the highest ecological cost? A sheet of paper or constantly
 switching on your computer and connecting to the Internet to read your
 email?
 




-- 
*Terry Ally*
Twitter.com/terryally
Facebook.com/terryally
~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~
To print or not to print this email is the environmentally-searching
question!
Which has the highest ecological cost? A sheet of paper or constantly
switching on your computer and connecting to the Internet to read your
email?


Re: [PHP] Calculating driving distance between UK postcodes

2012-05-04 Thread Terry Ally (Gmail)
Google works in Javascript extensively - not a language with which I
have in-depth experience hence my reason for asking for PHP solution.

For example the following will get me a JSON output with the distance in
Kms and time. I don't know how to get PHP to read this information and
extract just the distance. I need the distance so that I can calculate cost
of a trip.

form id=google action=
http://maps.googleapis.com/maps/api/distancematrix/json; method=get
input type=text name=origins value= /
input type=text name=destinations value= /
input type=hidden name=sensor value=false
input type=hidden name=submitted value=1
bra type=submit
onClick=document.getElementById('google').submit()strongstrongGet
Distance/strong/strong/a
/form





On 4 May 2012 15:08, David OBrien dgobr...@gmail.com wrote:

 Google is still your friend

 On Fri, May 4, 2012 at 9:36 AM, Terry Ally (Gmail) terrya...@gmail.comwrote:

 Does anyone have a working/example PHP script that calculates driving
 distances between UK postcodes that they can share?

 Thanks

 --
 *Terry Ally*

 Twitter.com/terryally
 Facebook.com/terryally
 ~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~
 To print or not to print this email is the environmentally-searching
 question!
 Which has the highest ecological cost? A sheet of paper or constantly
 switching on your computer and connecting to the Internet to read your
 email?



 http://stackoverflow.com/questions/2296087/using-php-and-google-maps-api-to-work-out-distance-between-2-post-codes-uk




-- 
*Terry Ally*
Twitter.com/terryally
Facebook.com/terryally
~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~
To print or not to print this email is the environmentally-searching
question!
Which has the highest ecological cost? A sheet of paper or constantly
switching on your computer and connecting to the Internet to read your
email?


Re: [PHP] date conversion/extraction issues

2012-05-03 Thread Terry Ally (Gmail)
Haluk,

After you retrieve the date from the database you still have to convert it
from a string to time and then to a date. Try:

?php echo date(l j M Y, , strtotime($row['PDate'])) ; ?


Terry

On 2 May 2012 22:36, Haluk Karamete halukkaram...@gmail.com wrote:

 This is my code and the output is right after that...

 $PDate = $row['PDate'];
 //row is tapping into ms-sql date field.
 //and the ms-sql data field has a value like this for the PDate;
 //07/12/2001
 $PDate = $PDate-date;
 echo h1[, $PDate , ]/h1;
 echo h1[, var_dump($row['PDate']) , ]/h1;
 echo h1[, serialize($row['PDate']) , ]/h1hr;
 the output is as follows. And my question is embedded in the output.

 []  ??? WHY IS THIS BLANK? WHY IS THIS NOT 2001-12-07 00:00:00?

 [object(DateTime)#3 (3) { [date]= string(19) 2001-12-07 00:00:00
 [timezone_type]= int(3) [timezone]= string(19)
 America/Los_Angeles } ]

 [O:8:DateTime:3:{s:4:date;s:19:2001-12-07

 00:00:00;s:13:timezone_type;i:3;s:8:timezone;s:19:America/Los_Angeles;}]

 if I were to directly insert the $row['date']  ms-sql value into mysq,
 I get this error;
 Catchable fatal error: Object of class DateTime could not be converted
 to string in sql.php on line 379

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




-- 
*Terry Ally*
Twitter.com/terryally
Facebook.com/terryally
~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~
To print or not to print this email is the environmentally-searching
question!
Which has the highest ecological cost? A sheet of paper or constantly
switching on your computer and connecting to the Internet to read your
email?


Re: [PHP] Retrieve pages from an ASP driven site

2012-05-03 Thread Terry Ally (Gmail)
Tom,

Here is how you would paginate in PHP.

//
// Number of records to show per page:
$display = 4;
// Determine how many records there are.
if (isset($_GET['np'])) {
$num_pages = $_GET['np'];
} else {
$query = SELECT * FROM mytable;
$query_result = mysql_query ($query) or die (mysql_error());
$num_records = @mysql_num_rows ($query_result);
 if ($num_records  $display) {
$num_pages = ceil ($num_records/$display);
} else {
$num_pages = 1;
}
}
 // Determine where in the database to start returning results.
if (isset($_GET['s'])) {
$start = $_GET['s'];
} else {
$start = 0;
}


// Number of records to show per page:
$display = 4;
// Determine how many records there are.
if (isset($_GET['np'])) {
$num_pages = $_GET['np'];
} else {
$query3 = SELECT * FROM mytable;
$query_result = mysql_query ($query3) or die (mysql_error());
$num_records = @mysql_num_rows ($query_result);
 if ($num_records  $display) {
$num_pages = ceil ($num_records/$display);
} else {
$num_pages = 1;
}
}
 // Determine where in the database to start returning results.
if (isset($_GET['s'])) {
$start = $_GET['s'];
} else {
$start = 0;
}
//




On 3 May 2012 05:37, EPA WC epawc...@gmail.com wrote:

 Hi List,

 I am trying to write a crawler to go through web pages at
 http://www.freebookspot.es/CompactDefault.aspx?Keyword=. But I am not
 quite familiar with how asp uses _doPostBack function with the next
 button below the book list to advance to the next page. I hope someone
 who knows ASP well can help out here. I need to know how to retrieve
 next page with PHP code.

 Kind regards,
 Tom

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




-- 
*Terry Ally*
Twitter.com/terryally
Facebook.com/terryally
~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~
To print or not to print this email is the environmentally-searching
question!
Which has the highest ecological cost? A sheet of paper or constantly
switching on your computer and connecting to the Internet to read your
email?


Re: [PHP] PHP Mailto() - Google now displaying HTML as Plain Text

2012-05-03 Thread Terry Ally (Gmail)
Hi all,

This question is now closed.

There is nothing wrong with my script.

It was an error by Google when they switched over to the new-look email and
have since rectified the issue and all is back to normal.

Thanks to all who have responded.

Terry



On 3 May 2012 21:05, Gerardo Benitez gerardobeni...@gmail.com wrote:

 Do you know if the mailto script allow set headers?

 Probably you must set a html header, something like this
 $headers .= 'Content-type: text/html; charset=iso-8859-1' . \r\n;


 Regards,
 Gerardo.

 On Tue, May 1, 2012 at 5:14 PM, Marco Behnke ma...@behnke.biz wrote:

 
 
  Am 29.04.2012 22:31, schrieb Terry Ally (Gmail):
 
  Hi all,
 
  I have been using a mailto() script for the last three years and from
  April
  25, 2012 incoming HTML email in Goggle mail is displaying as Plain Text.
   Something clearly changed with Google. Perhaps there is some change I
  need
  to make with my script??
 
  $message .= pbMessage:/b**blockquote  .$m./blockquote/p;
 
 
  As far as I can see your main html tags are missing?
 
  $message = 'htmlbody' . $message . '/body/html';
 
 
  --
  Marco Behnke
  Dipl. Informatiker (FH), SAE Audio Engineer
  Zend Certified Engineer PHP 5.3
 
  Tel.: 0174 / 9722336
  e-Mail: ma...@behnke.biz
 
  Softwaretechnik Behnke
  Heinrich-Heine-Str. 7D
  21218 Seevetal
 
  http://www.behnke.biz
 
 
 


 --
 Gerardo Benitez
 -
 Programador Web Freelance




-- 
*Terry Ally*
Twitter.com/terryally
Facebook.com/terryally
~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~
To print or not to print this email is the environmentally-searching
question!
Which has the highest ecological cost? A sheet of paper or constantly
switching on your computer and connecting to the Internet to read your
email?


Re: [PHP] PHP Database Problems

2012-05-02 Thread Terry Ally (Gmail)
Dear Ethan,

It would be useful to see what code you are using.

The syntax is:

UPDATE table_name
SET column1=value, column2=value2,...
WHERE some_column=some_value


The data that you are required to enter is for Intake3. I am assuming that
the only change is the History and/or Phone that you need to update since
the Site, MedRec, Fname, Lname, Height and Sex should remain the same.
Therefore I imagine the code should be something like


mysql_query(UPDATE  Intake3  SET History='Has been convinced by his
friends that he is obese. Normal BMI = 23', Phone='325 563-4178'
WHERE MedRec='1' LIMIT 1);


Having said that I notice that you have two primary keys in Intake3. Not
aware that a table can carry two.

Terry

On 2 May 2012 19:53, Ethan Rosenberg eth...@earthlink.net wrote:

  have a database

 mysql describe Intake3;
 ++-+--**+-+-+---+
 | Field  | Type| Null | Key | Default | Extra |
 ++-+--**+-+-+---+
 | Site   | varchar(6)  | NO   | PRI | |   |
 | MedRec | int(6)  | NO   | PRI | NULL|   |
 | Fname  | varchar(15) | YES  | | NULL|   |
 | Lname  | varchar(30) | YES  | | NULL|   |
 | Phone  | varchar(30) | YES  | | NULL|   |
 | Height | int(4)  | YES  | | NULL|   |
 | Sex| char(7) | YES  | | NULL|   |
 | Hx | text| YES  | | NULL|   |
 ++-+--**+-+-+---+
 8 rows in set (0.00 sec)

 mysql describe Visit3;
 ++--+-**-+-+-+**+
 | Field  | Type | Null | Key | Default | Extra  |
 ++--+-**-+-+-+**+
 | Indx   | int(4)   | NO   | PRI | NULL| auto_increment |
 | Site   | varchar(6)   | YES  | | NULL||
 | MedRec | int(6)   | YES  | | NULL||
 | Notes  | text | YES  | | NULL||
 | Weight | int(4)   | YES  | | NULL||
 | BMI| decimal(3,1) | YES  | | NULL||
 | Date   | date | YES  | | NULL||
 ++--+-**-+-+-+**+

 and a program to enter and extract data.

 I can easily extract data from the database. However, if I try to enter
 data, it goes into the incorrect record.  Following are some screenshots.
  The program is attached.  [pardon the comical names.  This is a test, and
 any resemblance to true names is not intentional]

 Let us say that I wish to deal with Medical Record 1:


 This it data from Intake3:
 Site Medical Record First Name Last Name Phone Height Sex History
 AA 1 David Dummy 845 365-1456 66 Male c/o obesity. Various treatments
 w/o success

 This is data from Visit3:
 Index Site Medical Record Notes Weight BMI Date
 2322 AA 1 Second Visit. 170 27.4 2010-01-20
 2326 AA 1 Third visit. Small progress, but pt is very happy. 165 26.6
 2010-02-01


 I then request to enter additional data:

 Site Medical Record First Name Last Name Phone Height Sex History
 AA 10003 Stupid Fool 325 563-4178 65 Male Has been convinced by his
 friends that he is obese. Normal BMI = 23.
 Index Site Medical Record Notes Weight BMI Date

 Notice that it is entered into record 10003

 The data is First Try

 Index Site Medical Record Notes Weight BMI Date
 2590 AA 10003 First Try 189 31.4 02 May 2012

 Help and advice, please.

 Thanks.

 Ethan


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




-- 
*Terry Ally*
Twitter.com/terryally
Facebook.com/terryally
~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~
To print or not to print this email is the environmentally-searching
question!
Which has the highest ecological cost? A sheet of paper or constantly
switching on your computer and connecting to the Internet to read your
email?


[PHP] PHP Mailto() - Google now displaying HTML as Plain Text

2012-04-29 Thread Terry Ally (Gmail)
Hi all,

I have been using a mailto() script for the last three years and from April
25, 2012 incoming HTML email in Goggle mail is displaying as Plain Text.
 Something clearly changed with Google. Perhaps there is some change I need
to make with my script??

// First set up some variables for recipient, subject, and date/time received
$to = $sendto;  // Recipient
$subject = Message received via XX website;  // Subject
$oh = (int) date (Z) / 3600;  // time offset to GMT
$date = date(d M Y g:i:s a , mktime (date (H) - $oh)).  GMT; //
Date and time in the form -mm-dd hh:mm:ss


// Set up conditionals for optional fields
$addr1 = $_POST['addr1'];
$addr2 = $_POST['addr2'];
$city = $_POST['city'];
$country = $_POST['country'];
$postalcode = $_POST['postalcode'];

// Compose body of email
$message = pFollowing is a message received for .$recipient. 
sent via XX website on .$date./p;
$message .= pbFrom:/b .$n. (.$email.)/p;

if (($addr1)  (! $addr2)) {
$message .=  pbAddress:/b .$addr1./p;
} elseif (($addr1)  ($addr2)) {
$message .=  pbAddress:/b .$addr1., .$addr2./p;
} else {
$message .=  pbAddress:/b None provided/p;}

if ($city) {
$message .= pbCity:/b .$city./p;
} else { }

if (($country)  (! $postalcode)) {
$message .= pbCountry:/b .$country./p;
} elseif($country  $postalcode) {
$message .= pbCountry:/b .$country. .$postalcode./p;
} else { }

$message .= pbMessage:/bblockquote .$m./blockquote/p;

// To send HTML mail, the Content-type header must be set
$headers  = 'From: '.$n.''.$email . \r\n ;
$headers .= 'Reply-To: '.$email . \r\n;
$headers .= 'cc: XXX ' . \r\n;
$headers .= 'Bcc: XXX ' . \r\n;

// Additional headers
$headers .= 'MIME-Version: 1.0' . \r\n;
$headers .= 'Content-type: text/html; charset=iso-8859-1' . \r\n;
$headers .= 'X-Mailer: PHP/' . phpversion();


// send email
mail($to, $subject, $message, $headers);


Thanks
-- 
*Terry Ally*