[PHP-DB] HTML Entity Decode

2008-03-26 Thread VanBuskirk, Patricia
I found the following function at http://us.php.net/html_entity_decode.  This 
looks exactly like what I need to filter out information in a text field that's 
been copied from Word.  The endash or #8211 is not being accepted and my 
processing page is halting.  My question to you is where in my page do I call 
this function and how .. where do I get $number?


In answer to laurynas dot butkus at gmail dot com and [EMAIL PROTECTED] and 
their great code2utf-function I added the functionality for entries between 
[128, 160[ that are not ASCii, but equal for all major western encodings like 
ISO8859-X and UTF-8 that has been mentioned before.

Now, the following function should in fact convert any number (table-entry) 
into an UTF-8-character. Thus, the return-value  code2utf( number )  equals 
the character that is represented by the XML-entity  #number;  (exceptions: 
#129, #141, #143, #144, #157).

To give an example, the function may be useful for creating a UTF-8-compatible 
html_entity_decode-function  or  determining the entry-position of 
UTF-8-characters in order to find the correct entity-replacement or similar.

    function code2utf($number)
    {
        if ($number  0)
            return FALSE;
        
        if ($number  128)
            return chr($number);
        
        // Removing / Replacing Windows Illegals Characters
        if ($number  160)
        {
                if ($number==128) $number=8364;
            elseif ($number==129) $number=160; // (Rayo:) #129 using no 
relevant sign, thus, mapped to the saved-space #160
            elseif ($number==130) $number=8218;
            elseif ($number==131) $number=402;
            elseif ($number==132) $number=8222;
            elseif ($number==133) $number=8230;
            elseif ($number==134) $number=8224;
            elseif ($number==135) $number=8225;
            elseif ($number==136) $number=710;
            elseif ($number==137) $number=8240;
            elseif ($number==138) $number=352;
            elseif ($number==139) $number=8249;
            elseif ($number==140) $number=338;
            elseif ($number==141) $number=160; // (Rayo:) #129 using no 
relevant sign, thus, mapped to the saved-space #160
            elseif ($number==142) $number=381;
            elseif ($number==143) $number=160; // (Rayo:) #129 using no 
relevant sign, thus, mapped to the saved-space #160
            elseif ($number==144) $number=160; // (Rayo:) #129 using no 
relevant sign, thus, mapped to the saved-space #160
            elseif ($number==145) $number=8216;
            elseif ($number==146) $number=8217;
            elseif ($number==147) $number=8220;
            elseif ($number==148) $number=8221;
            elseif ($number==149) $number=8226;
            elseif ($number==150) $number=8211;
            elseif ($number==151) $number=8212;
            elseif ($number==152) $number=732;
            elseif ($number==153) $number=8482;
            elseif ($number==154) $number=353;
            elseif ($number==155) $number=8250;
            elseif ($number==156) $number=339;
            elseif ($number==157) $number=160; // (Rayo:) #129 using no 
relevant sign, thus, mapped to the saved-space #160
            elseif ($number==158) $number=382;
            elseif ($number==159) $number=376;
        } //if
        
        if ($number  2048)
            return chr(($number  6) + 192) . chr(($number  63) + 128);
        if ($number  65536)
            return chr(($number  12) + 224) . chr((($number  6)  63) + 
128) . chr(($number  63) + 128);
        if ($number  2097152)
            return chr(($number  18) + 240) . chr((($number  12)  63) + 
128) . chr((($number  6)  63) + 128) . chr(($number  63) + 128);
        
        
        return FALSE;
    } //code2utf() 

Trish
~
Patricia Van Buskirk
Florida State University, Office of Telecommunications
644 W. Call Street
Tallahassee, FL  32306-1120
(850) 644-9247
~
Life may not be the party we hoped for, but while we're still here we may as 
well dance.'' Life may not be the party we hoped for, but while we're still 
here we may as well dance.' ' Life may not be the party we hoped for, but while 
we're still here we may as well dance.'



Trish
~
Patricia Van Buskirk
Florida State University, Office of Telecommunications
644 W. Call Street
Tallahassee, FL  32306-1120
(850) 644-9247
~
Life may not be the party we hoped for, but while we're still here we may as 
well dance.'' Life may not be the party we hoped for, but while we're still 
here we may as well dance.' ' Life may not be the party we hoped for, but while 
we're still here we may as well dance.'


--
PHP Database Mailing List (http://www.php.net/)
To 

[PHP-DB] ini_set ...

2008-03-21 Thread VanBuskirk, Patricia
I have the line ini_set('display_errors', 'on'); in my code, but it is
not working.  Does it need to be the first command on the page?

Trish

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



RE: [PHP-DB] ini_set ...

2008-03-21 Thread VanBuskirk, Patricia
I have full access to the php.ini file, which is what I do now to
test... go there, change the file, restart the IIS service, etc.  I read
somewhere recently where they used this line in their code, and I
thought how convenient that would be ... just haven't been able to get
it to work.  I will try true instead of on and see if that works.
Does it go back to the default on it's own, or do I need to hard-code
that in the page when I'm done?

 

Thanks Isaak!

 

 

From: Isaak Malik [mailto:[EMAIL PROTECTED] 
Sent: Friday, March 21, 2008 10:16 AM
To: VanBuskirk, Patricia
Subject: Re: [PHP-DB] ini_set ...

 

 

On Fri, Mar 21, 2008 at 3:11 PM, VanBuskirk, Patricia
[EMAIL PROTECTED] wrote:

I have the line ini_set('display_errors', 'on'); in my code, but it is
not working.  Does it need to be the first command on the page?

Trish

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


You can call this function anywhere in your file, I'm using:
ini_set('display_errors', 'True');

without a problem.

If you're on a shared hosting environment it's possible that the
adminstrators have disabled this function or feature.
-- 
Isaak Malik
Web Developer
[EMAIL PROTECTED] 



RE: [PHP-DB] str_replace removing unwanted characters...

2008-03-01 Thread VanBuskirk, Patricia
Thanks again Daniel ... I'll look into the html_entity_decode and see
what I can figure out.  You have a great weekend too!

-Original Message-
From: Daniel Brown [mailto:[EMAIL PROTECTED] 
Sent: Saturday, March 01, 2008 7:06 PM
To: VanBuskirk, Patricia
Subject: Re: [PHP-DB] str_replace removing unwanted characters...


Replying back on-list, Patricia, so you can get some feedback from
the talented people here, as well.

On Sat, Mar 1, 2008 at 6:30 PM, VanBuskirk, Patricia
[EMAIL PROTECTED] wrote:
 Thanks Daniel!  I appreciate your help!!  I've fixed the mismatched
  search items and got the slashes out.

  I think I've narrowed down what was being causing that particular
order
  to kick back.  I copied and pasted the text from the database to
  dreamweaver.  Where it said  For 1 month - a recording and in two
  other cases, the dashes were showing as ndash; in the code.  When
I
  removing those particular dashes, the order went through.  She said
she
  copied and pasted that text, so I guess that code was copied in.  How
  can I check for freaky things like that?

That would be something best handled by built-in functions such as
html_entity_decode();.  Encapsulated in a mysql_real_escape_string()
function return, it should be safe, but for readability,
compatibility, and other-ability (whatever that may be), you may still
want to read up more on the HTML-translation family here:
http://www.php.net/manual/en/function.html-entity-decode.php

Any other questions, please don't hesitate to ask.  Have a great
weekend!

-- 
/Dan

Daniel P. Brown
Senior Unix Geek
? while(1) { $me = $mind--; sleep(86400); } ?

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



[PHP-DB] str_replace removing unwanted characters...

2008-02-29 Thread VanBuskirk, Patricia
Someone from this list (sorry I cannot remember the name), a while back, gave 
me the following function to use to get rid of unwanted characters coming in on 
forms:

function convert_smart_quotes($string) 
{
 $search = array(chr(145),
 chr(146),
 chr(147),
 chr(148),
 chr(151),
 #,
 ;,
 [,
 ],
 {,
 ,
 ,
 =,
 URL=http://;);
  $replace = array(',
   ',
   '',
   '',
   -,
   number,
   ,,
   ,
   ,
   ,
   ,
   ,
   ,
   equals,
   );
  return str_replace($search, $replace, $string); }

This has been working pretty good, however every once in a while something 
won't go through, such as the following text recently (between the dashed 
lines). It sent a confirmation email with no order number and did not make a 
record in the database:


Attn Jean Spence

Order to remove 644-8502, add a daytime voice mail tree to Help Desk ACD, 
Upgrade 644-4357 Supervisor Set.  A detailed flowchart will be emailed to Jean 
Spence and Mark Purvis.

This ENTIRE order MUST be coordinated with Mark Purvis

1. Steps to remove 4-8502
NOTES: 4-8502 will need a LEN. OTC will do this in-house
For 1 month - a recording which states that the number has changed to 644-HELP- 
that's 644-4357 and then transfer the call to 4-4357
For 1 month - a recording which states that the number has changed to 644-HELP- 
that's 644-4357- NO transfer.
Cancel 644-8502

2. New  VM Tree Greeting 1- Need NEW DN for this!!!  (Please coordinate with 
Suzanne for recordings).

3. Change call queue time

Any questions, please contact me.
Thanks!
Suzanne


When I re-entered the order using the following text (between the starred 
lines), the order went through:

***
Attn Jean Spence

Order to remove 644-8502, add a daytime voice mail tree to Help Desk ACD, 
Upgrade 644-4357 Supervisor Set. A detailed flowchart will be emailed to Jean 
Spence and Mark Purvis.

This ENTIRE order MUST be coordinated with Mark Purvis

see email for details
***



Also, we are getting back for example I\'m hoping...  Somehow the slashes are 
coming through in the field and in the emails.  I am not even sure what is 
putting them in, as I don't see that in the replace function.  

Trish
~
Patricia Van Buskirk
Florida State University, Office of Telecommunications
644 W. Call Street
Tallahassee, FL  32306-1120
(850) 644-9247
~

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



[PHP-DB] Formatting in Text Area

2008-02-01 Thread VanBuskirk, Patricia
I have a customer description text area field on my form which feeds through 
php to FMP, and spits out a confirmation page and email.  The issue I am having 
is this ... as the customer types, the text wraps.  Many put their own hard 
returns and spaces in to organize their description.  It seems I can't get it 
to do both the wrap and show the actual formatting entered.  If I format the 
field as physical wrap, the lines run off the page on the 
confirmation/printout.  If I format it as virtual, then the hard returns, etc 
get lost.  I have also tried using PRE on the confirmation page and email and 
that doesn't work either.

Hmmm... scratching head!

Trish
~
Patricia Van Buskirk
Florida State University, Office of Telecommunications
644 W. Call Street
Tallahassee, FL  32306-1120
(850) 644-9247
~

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



[PHP-DB] Formatting in Text Area

2008-02-01 Thread VanBuskirk, Patricia
Sorry, I had sent this first to my FileMaker list, but then realized it
was probably more html/php related than database related.  FMP is for
FileMaker Pro.

Can you give me an example of your suggestion?  I am still quite new at
php and learn much better by example.

Thanks Evert!

Trish

-Original Message-
From: Evert Lammerts [mailto:[EMAIL PROTECTED] 
Sent: Friday, February 01, 2008 8:21 AM
To: VanBuskirk, Patricia
Cc: php-db@lists.php.net
Subject: Re: [PHP-DB] Formatting in Text Area

VanBuskirk, Patricia wrote:
 I have a customer description text area field on my form which feeds
through php to FMP,
What's FMP? Is that what links this email to the db-list?
  and spits out a confirmation page and email.  The issue I am having
is this ... as the customer types, the text wraps.  Many put their own
hard returns and spaces in to organize their description.  It seems I
can't get it to do both the wrap and show the actual formatting entered.
If I format the field as physical wrap, the lines run off the page on
the confirmation/printout.  If I format it as virtual, then the hard
returns, etc get lost.  I have also tried using PRE on the
confirmation page and email and that doesn't work either.
   
Line wrapping in a text area is a property of the text area, not of the 
text, as opposite to line breaks and hard returns. This is why you won't

find line break characters at the place the text used to wrap in the 
text area.

What you can do of course is to add a div (or whatever container you 
feel like) of the same width / height as the text area to the 
confirmation page and replace \l\r with br 's.

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



[PHP-DB] Sending value to another page...

2007-11-29 Thread VanBuskirk, Patricia
I am trying to send an order number from a confirmation page to another
form and insert it into the order number field on the new form.  Can
anyone tell me what I am doing wrong??!!

 

Here's the portion of my code that has the link (it passes
http://www2.otc.fsu.edu/Forms/TEST/cellreg.php?'OrderNumber'=TEST222808)
:

 

?php

 

if(isset($_POST['Cellular_Service'])) {

 

echo (table width='100%' border='3' cellpadding='0'
cellspacing='0' bordercolor='#99' bgcolor='#CC'

  tr class='style5'

td align='center'bfont size='3'In order to complete your
cellular phone request, you are REQUIRED to REGISTER the cell phone(s)
with the FSU employees through their FSUID. Please go to the a
href=\http://www2.otc.fsu.edu/Forms/TEST/cellreg.php?'OrderNumber'=.$o
rder['Order_Number'].\Cell Phone Registration Form/a to complete
your order. Thank you! /font/b/td

  /tr

/tablebr);

}

?

 

Here's the page it goes to (it puts nothing in the Order Number field):

 

HTML

HEAD

TITLECell Phone Registration/TITLE

LINK href=tsr.css rel=stylesheet type=text/css

/HEAD

BODY class=style13

TABLE width=500 border=0 cellpadding=5 cellspacing=0

FORM action=thankyou.php method=post name=cellform

TR class=style13

  TD height=57 colspan=4 align=center
valign=topH2IMG src=images/OTC.jpg width=300 height=75/H2

  H2Cell Phone Information/H2/TD

/TR

TR valign=bottom class=style13

  TD align=centerINPUT type=text name=OrderNumber
value=?php echo (['OrderNumber']); ? size=15 //TD

TD align=centerINPUT type=text name=FSUID value=
size=20 //TD

TD align=centerINPUT type=text name=UserName
value= size=25 //TD

TD align=centerINPUT type=text name=PhoneNumber
value= size=15 //TD

  /TR

TR class=style13

  TD align=center valign=topOrder # /TD

TD align=center valign=topFSUID/TD

TD align=center valign=topUser Name/TD

TD align=center valign=topPhone #/TD

  /TR

TR

TD colspan=4 align=centernbsp;

INPUT
type=submit name=new_record value=Add Line /nbsp;nbsp;

  INPUT type=reset name=clear
value=Clear //TD

/TR

/FORM

/TABLE

 

/BODY

/HTML



RE: [PHP-DB] Sending value to another page...

2007-11-29 Thread VanBuskirk, Patricia
Thanks Jason!

I took them out, and it comes through as 
http://www2.otc.fsu.edu/Forms/TEST/cellreg.php?OrderNumber=TEST223008;
now, but still nothing shows up in the field for order number on the
receiving page (cellreg.php).  Did I echo that properly?  Do I need to
turn sessions on?

Trish

-Original Message-
From: Jason Gerfen [mailto:[EMAIL PROTECTED] 
Sent: Thursday, November 29, 2007 1:38 PM
Cc: php-db@lists.php.net
Subject: Re: [PHP-DB] Sending value to another page...

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

VanBuskirk, Patricia wrote:
 I am trying to send an order number from a confirmation page to
another
 form and insert it into the order number field on the new form.  Can
 anyone tell me what I am doing wrong??!!
 
  
 
 Here's the portion of my code that has the link (it passes

http://www2.otc.fsu.edu/Forms/TEST/cellreg.php?'OrderNumber'=TEST222808)
 :
 
It should be
http://www2.otc.fsu.edu/Forms/TEST/cellreg.php?OrderNumber=TEST222808

Notice the missing single quotes? If you encapsulate a global $_GET var
php will not look at anything between '' it will skip that and search
for an varname=value or ?varname=value string. Then $_GET['varname']
will contain something.

  
 
 ?php
 
  
 
 if(isset($_POST['Cellular_Service'])) {
 
  
 
 echo (table width='100%' border='3' cellpadding='0'
 cellspacing='0' bordercolor='#99' bgcolor='#CC'
 
   tr class='style5'
 
 td align='center'bfont size='3'In order to complete your
 cellular phone request, you are REQUIRED to REGISTER the cell phone(s)
 with the FSU employees through their FSUID. Please go to the a

href=\http://www2.otc.fsu.edu/Forms/TEST/cellreg.php?'OrderNumber'=.$o
 rder['Order_Number'].\Cell Phone Registration Form/a to complete
 your order. Thank you! /font/b/td
 
   /tr
 
 /tablebr);
 
 }
 
 ?
 
  
 
 Here's the page it goes to (it puts nothing in the Order Number
field):
 
  
 
 HTML
 
 HEAD
 
 TITLECell Phone Registration/TITLE
 
 LINK href=tsr.css rel=stylesheet type=text/css
 
 /HEAD
 
 BODY class=style13
 
 TABLE width=500 border=0 cellpadding=5 cellspacing=0
 
 FORM action=thankyou.php method=post name=cellform
 
 TR class=style13
 
   TD height=57 colspan=4 align=center
 valign=topH2IMG src=images/OTC.jpg width=300
height=75/H2
 
   H2Cell Phone Information/H2/TD
 
 /TR
 
 TR valign=bottom class=style13
 
   TD align=centerINPUT type=text name=OrderNumber
 value=?php echo (['OrderNumber']); ? size=15 //TD
 
 TD align=centerINPUT type=text name=FSUID
value=
 size=20 //TD
 
 TD align=centerINPUT type=text name=UserName
 value= size=25 //TD
 
 TD align=centerINPUT type=text name=PhoneNumber
 value= size=15 //TD
 
   /TR
 
 TR class=style13
 
   TD align=center valign=topOrder # /TD
 
 TD align=center valign=topFSUID/TD
 
 TD align=center valign=topUser Name/TD
 
 TD align=center valign=topPhone #/TD
 
   /TR
 
 TR
 
 TD colspan=4 align=centernbsp;
 
 INPUT
 type=submit name=new_record value=Add Line /nbsp;nbsp;
 
   INPUT type=reset name=clear
 value=Clear //TD
 
 /TR
 
 /FORM
 
 /TABLE
 
  
 
 /BODY
 
 /HTML
 
 


- --
Jason Gerfen

I practice my religion
 while stepping on your
 toes...
~The Ditty Bops
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.7 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHTwb+5vk8bwKVAaIRAs6cAJ9fy+tyXH74q2mlwmm5o6Pn1HEBjQCdHMOs
Sxf5BdnaJOAmun2XG2LEbW8=
=w5lq
-END PGP SIGNATURE-

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

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



RE: [PHP-DB] Sending value to another page...

2007-11-29 Thread VanBuskirk, Patricia
Nevermind my last post ... I figured it out!!  I needed to add $_GET to
the variable and it plopped it right in!

Thanks again!


-Original Message-
From: Jason Gerfen [mailto:[EMAIL PROTECTED] 
Sent: Thursday, November 29, 2007 1:38 PM
Cc: php-db@lists.php.net
Subject: Re: [PHP-DB] Sending value to another page...

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

VanBuskirk, Patricia wrote:
 I am trying to send an order number from a confirmation page to
another
 form and insert it into the order number field on the new form.  Can
 anyone tell me what I am doing wrong??!!
 
  
 
 Here's the portion of my code that has the link (it passes

http://www2.otc.fsu.edu/Forms/TEST/cellreg.php?'OrderNumber'=TEST222808)
 :
 
It should be
http://www2.otc.fsu.edu/Forms/TEST/cellreg.php?OrderNumber=TEST222808

Notice the missing single quotes? If you encapsulate a global $_GET var
php will not look at anything between '' it will skip that and search
for an varname=value or ?varname=value string. Then $_GET['varname']
will contain something.

  
 
 ?php
 
  
 
 if(isset($_POST['Cellular_Service'])) {
 
  
 
 echo (table width='100%' border='3' cellpadding='0'
 cellspacing='0' bordercolor='#99' bgcolor='#CC'
 
   tr class='style5'
 
 td align='center'bfont size='3'In order to complete your
 cellular phone request, you are REQUIRED to REGISTER the cell phone(s)
 with the FSU employees through their FSUID. Please go to the a

href=\http://www2.otc.fsu.edu/Forms/TEST/cellreg.php?'OrderNumber'=.$o
 rder['Order_Number'].\Cell Phone Registration Form/a to complete
 your order. Thank you! /font/b/td
 
   /tr
 
 /tablebr);
 
 }
 
 ?
 
  
 
 Here's the page it goes to (it puts nothing in the Order Number
field):
 
  
 
 HTML
 
 HEAD
 
 TITLECell Phone Registration/TITLE
 
 LINK href=tsr.css rel=stylesheet type=text/css
 
 /HEAD
 
 BODY class=style13
 
 TABLE width=500 border=0 cellpadding=5 cellspacing=0
 
 FORM action=thankyou.php method=post name=cellform
 
 TR class=style13
 
   TD height=57 colspan=4 align=center
 valign=topH2IMG src=images/OTC.jpg width=300
height=75/H2
 
   H2Cell Phone Information/H2/TD
 
 /TR
 
 TR valign=bottom class=style13
 
   TD align=centerINPUT type=text name=OrderNumber
 value=?php echo (['OrderNumber']); ? size=15 //TD
 
 TD align=centerINPUT type=text name=FSUID
value=
 size=20 //TD
 
 TD align=centerINPUT type=text name=UserName
 value= size=25 //TD
 
 TD align=centerINPUT type=text name=PhoneNumber
 value= size=15 //TD
 
   /TR
 
 TR class=style13
 
   TD align=center valign=topOrder # /TD
 
 TD align=center valign=topFSUID/TD
 
 TD align=center valign=topUser Name/TD
 
 TD align=center valign=topPhone #/TD
 
   /TR
 
 TR
 
 TD colspan=4 align=centernbsp;
 
 INPUT
 type=submit name=new_record value=Add Line /nbsp;nbsp;
 
   INPUT type=reset name=clear
 value=Clear //TD
 
 /TR
 
 /FORM
 
 /TABLE
 
  
 
 /BODY
 
 /HTML
 
 


- --
Jason Gerfen

I practice my religion
 while stepping on your
 toes...
~The Ditty Bops
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.7 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHTwb+5vk8bwKVAaIRAs6cAJ9fy+tyXH74q2mlwmm5o6Pn1HEBjQCdHMOs
Sxf5BdnaJOAmun2XG2LEbW8=
=w5lq
-END PGP SIGNATURE-

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

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



RE: [PHP-DB] Sending value to another page...

2007-11-29 Thread VanBuskirk, Patricia
Thanks all for your support!!

-Original Message-
From: Dee Ayy [mailto:[EMAIL PROTECTED] 
Sent: Thursday, November 29, 2007 1:48 PM
To: php-db@lists.php.net
Subject: Re: [PHP-DB] Sending value to another page...

I just tested ?'OrderNumber'=TEST222808
and it works with and without quotes.

The problem is you have
echo (['OrderNumber'])
when you need
echo $_GET['OrderNumber'];
or possibly
echo ($_GET['OrderNumber']);

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

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



[PHP-DB] Script works on one server and not another...

2007-11-16 Thread VanBuskirk, Patricia
I have the following multipage example script I am practicing with that
came from the php cookbook.  It works great on my other business's web
server, but when I upload it here at this job, it goes to a blank page
after clicking next on stage 1.  Sounds like a php.ini setting, but
I cannot figure out which one.

?php
// Turn on sessions
session_start();

// Figure out what stage to use
if (($_SERVER['REQUEST_METHOD'] == 'GET') || (! isset($_POST['stage'])))
{
$stage = 1;
} else {
$stage - (int) $_POST['stage'];
}

// Save any submitted data
if ($stage  1) {
foreach ($_POST as $key = $value) {
$_SESSION[$key] = $value;
}
}

if ($stage == 1) { ?
form action='?php echo $_SERVER['SCRIPT_NAME'] ?' method='post'

Name: input type='text' name='name' / br/
Age:  input type='text' name='age' / br/

input type='hidden' name='stage' value='?php echo $stage + 1 ?'/
input type='submit' value='Next' /
/form

?php } else if ($stage == 2) { ?

form action='?php echo $_SERVER['SCRIPT_NAME'] ?' method='post'
Favorite Color: input type='text' name='color' / br/
Favorite Food: input type='text' name='food' / br/

input type='hidden' name='stage' value='?php echo $stage + 1 ?'/
input type='submit' value='Done' /
/form

?php } else if ($stage == 3) { ?

Hello ?php echo $_SESSION['name'] ?.
You are ?php echo $_SESSION['age'] ? years old.
Your favorite color is ?php echo $_SESSION['color'] ?
and your favorite food is ?php echo $_SESSION['food'] ?.

?php } ?

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



[PHP-DB] Interactive Order Form

2007-11-09 Thread VanBuskirk, Patricia
Happy Friday All!

We presently have an order form online (using php5) that feeds into a
FileMaker 9 database.  What we are trying to do is:

If someone clicks on cell phone (checkbox), a new box of fields shows
under it requiring additional info that feeds into a new table in the
database (one order number to many cell phones).  Once they fill in that
data (action:add/chg/delete, user name, cell number, userid, etc), there
should be a button for more lines that they can click that will give
them another line to enter info on.  Once that info is entered and they
are done, those fields of info go to the other table, while the original
form info goes to the orders table.

I am at the point in programming php where I know something CAN be done
... but HOW to do it can be the puzzler!  Any assistance or examples
would be greatly appreciated.  I can send the form and processing page
to anyone offlist if requested.

Thanks!

Trish

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



RE: [PHP-DB] php maximum characters in text field

2007-10-18 Thread VanBuskirk, Patricia
I have always called them curly quotes and when I Googled curly quotes
in php, I came up with the script I sent yesterday.  But, I think you
are right.


-Original Message-
From: Niel Archer [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, October 17, 2007 5:39 PM
To: php-db@lists.php.net
Subject: Re: [PHP-DB] php maximum characters in text field

Hi

 Does anyone know how to look for a Curly quote or typographer's
quotation mark.

Do you mean the equivalent of the left and right double quote entities
in HTML (or 66's and 99's as we called them at school)?


--
Niel Archer

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

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



[PHP-DB] email HTML code showing in Eudora

2007-10-18 Thread VanBuskirk, Patricia
I have the following code that so for works perfect for all email
programs EXCEPT Eudora.  With Eudora, the entire code after the first
?, starting at --PHP-alt just pops into the body of the email.
Anyone know of a fix for Eudora that will still allow the rest of the
world to see it correctly?

?php
//define the receiver of the email
$to = '[EMAIL PROTECTED]';
//define the subject of the email
$subject = 'Test HTML email'; 
//create a boundary string. It must be unique 
//so we use the MD5 algorithm to generate a random hash
$random_hash = md5(date('r', time())); 
//define the headers we want passed. Note that they are separated with
\r\n
$headers = From: [EMAIL PROTECTED]:
[EMAIL PROTECTED];
//add boundary string and mime type specification
$headers .= \r\nContent-Type: multipart/alternative;
boundary=\PHP-alt-.$random_hash.\; 
//define the body of the message.
ob_start(); //Turn on output buffering
?
--PHP-alt-?php echo $random_hash; ?  
Content-Type: text/plain; charset=iso-8859-1 
Content-Transfer-Encoding: 7bit

Hello World!!! 
This is simple text email message. 

--PHP-alt-?php echo $random_hash; ?  
Content-Type: text/html; charset=iso-8859-1 
Content-Transfer-Encoding: 7bit

h2Hello World!/h2
pThis is something with bHTML/b formatting./p 

--PHP-alt-?php echo $random_hash; ?--
?
//copy current buffer contents into $message variable and delete current
output buffer
$message = ob_get_clean();
//send the email
$mail_sent = @mail( $to, $subject, $message, $headers );
//if the message is sent successfully print Mail sent. Otherwise print
Mail failed 
echo $mail_sent ? Mail sent : Mail failed;
?

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



RE: [PHP-DB] php maximum characters in text field

2007-10-17 Thread VanBuskirk, Patricia
Does anyone know how to look for a Curly quote or typographer's quotation 
mark.  They are being submitted on our form under customer description.  I 
have created a function that replaces a regular straight quotation mark ($title 
= str_replace(', , $title);), but do not know what to put in as the look 
for for the curly mark!

-Original Message-
From: Instruct ICC [mailto:[EMAIL PROTECTED] 
Sent: Monday, October 15, 2007 3:29 PM
To: php-db@lists.php.net
Subject: RE: [PHP-DB] php maximum characters in text field


Do you see those apostrophes in that text?

They need to be properly escaped.

 Date: Mon, 15 Oct 2007 15:09:52 -0400
 From: [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]; [EMAIL PROTECTED]; php-db@lists.php.net
 Subject: RE: [PHP-DB] php maximum characters in text field
 
 Here is the exact text he submitted:
 
 Please initiate phone lines in the following locations in the Leon
 County Civic Center to support our home Men's and Women's Basketball
 games. Meeting room B: activate 4 lines on the North Wall and 4 lines on
 the South Wall - all lines should have long distance with credit card
 only. Courtside: 1 - Please re-activate saved phone number 224-8790
 along the West side press row. Please include long distance on the
 phone. 2 - Please activate the ISDN line on the East side scorer's
 table. 3 - Please re-activate the saved phone number 224-1155 on the
 East side scorer's table. Work room: Please activate 2 lines in the work
 room, one for telephone and one for fax. - Both with long distance
 capability Please call, e-mail or fax the telephone numbers associated
 with each location to Stuart Pearce at 644-4694 (office), 645-3278
 (fax), [EMAIL PROTECTED] Thank you, Stuart Pearce


_
Help yourself to FREE treats served up daily at the Messenger Café. Stop by 
today.
http://www.cafemessenger.com/info/info_sweetstuff2.html?ocid=TXT_TAGLM_OctWLtagline

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



RE: [PHP-DB] php maximum characters in text field

2007-10-17 Thread VanBuskirk, Patricia
I was able to copy and paste from the customer's email exactly what they
were trying to submit.  When I back-spaced out their single quote and
put in my own, it worked fine.  That's how I narrowed it down to that
particular character.  With much help from a coworker, I was able to
implement some functions, and call them BEFORE php tries to create the
new record in the database.  That was my biggest problem ... I put the
cleanup code in the wrong place, after the new record command.  However,
here's what the function looks like (it also gets out ~'s:

function convert_smart_quotes($string) 
{
 $search = array(chr(145),
   chr(146),
   chr(147),
   chr(148),
   chr(151));
  $replace = array(',
   ',
 '',
 '',
 '-');
  return str_replace($search, $replace, $string); }


-Original Message-
From: Instruct ICC [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, October 17, 2007 1:54 PM
To: php-db@lists.php.net
Subject: RE: [PHP-DB] php maximum characters in text field


 Does anyone know how to look for a Curly quote or typographer's
quotation mark. They are being submitted on our form under customer
description. I have created a function that replaces a regular straight
quotation mark ($title = str_replace(', , $title);), but do not know
what to put in as the look for for the curly mark!

How do you know they are submitting ?
Can you copy  from that source, then paste it into your str_replace
function?

Or since it seems to be a two-byte character (I didn't see it at
asciitable.com):
Maybe you need http://php.he.net/manual/en/ref.mbstring.php
mb_ereg_replace

_
Peek-a-boo FREE Tricks  Treats for You!
http://www.reallivemoms.com?ocid=TXT_TAGHMloc=us
-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

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



RE: [PHP-DB] php maximum characters in text field

2007-10-15 Thread VanBuskirk, Patricia
I am starting to believe it is NOT the character length that is causing the 
problem.  We have received other orders with more in it than that, and they 
came in ok.  I think there may be something in the input that php does not 
like.  I've been searching for code that will clean up input, possibly 
preg_replace?


-Original Message-
From: Instruct ICC [mailto:[EMAIL PROTECTED] 
Sent: Monday, October 15, 2007 10:37 AM
To: php-db@lists.php.net
Subject: RE: [PHP-DB] php maximum characters in text field


 varchar maxs out at 255 characters
 just for clarification, mysql varchar easily can hold more than 255
 characters 
 (I remember it was the case in ancient 3.x times) 
 only if one wants to store newlines he must use type text
 
 just my 2 cent

News to me, so I check the docs.
http://dev.mysql.com/doc/refman/5.0/en/char.html

Apparently varchar can easily hold more than 255 chars IF YOU USE VERSION 
5.0.3 OR LATER.
Values in VARCHAR columns are variable-length
strings. The length can be specified as a value from 0 to 255
before MySQL 5.0.3, and 0 to 65,535 in 5.0.3 and later versions.

We assume the OP is using form method=post if he is checking the $_POST 
variable.  Good catch (OKi98) if he is not.

_
Windows Live Hotmail and Microsoft Office Outlook - together at last.  Get it 
now.
http://office.microsoft.com/en-us/outlook/HA102225181033.aspx?pid=CL100626971033

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



RE: [PHP-DB] php maximum characters in text field

2007-10-15 Thread VanBuskirk, Patricia
It isn't sending to MySql, we use FileMaker Pro 9. A new record did not get 
made in the d'base... the confirmation email went out, but wherever info was 
supposed to kick back from the d'base (ie. Order number), it showed an 
undefined variable error.

-Original Message-
From: Instruct ICC [mailto:[EMAIL PROTECTED] 
Sent: Monday, October 15, 2007 1:05 PM
To: php-db@lists.php.net
Subject: RE: [PHP-DB] php maximum characters in text field


 I am starting to believe it is NOT the character length that is causing the 
 problem. We have received other orders with more in it than that, and they 
 came in ok. I think there may be something in the input that php does not 
 like. I've been searching for code that will clean up input, possibly 
 preg_replace?

Was the order received, but the text was shorter than expected?
Or was the order not received at all?

Check your mysql query log.  It may show failed queries where bad characters 
made the query fail, perhaps using ' or ?
Use mysql_real_escape_string.
_
Climb to the top of the charts!  Play Star Shuffle:  the word scramble 
challenge with star power.
http://club.live.com/star_shuffle.aspx?icid=starshuffle_wlmailtextlink_oct
-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

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



RE: [PHP-DB] php maximum characters in text field

2007-10-12 Thread VanBuskirk, Patricia
The info he was trying to submit was 883 characters, including spaces
(counted in Word).  Many times, people have very detailed descriptions
they need to send in.  Can you think of a way to work around this
limitation?  Also, what happened when he tried to submit is he got an
email back with Undefined variable errors wherever the database was
supposed to send back info, and no record was created.

 

From: Bastien Koert [mailto:[EMAIL PROTECTED] 
Sent: Friday, October 12, 2007 11:12 AM
To: VanBuskirk, Patricia; php-db@lists.php.net
Subject: RE: [PHP-DB] php maximum characters in text field

 

Unless you are using a text field (which holds 64K [mysql]) a normal
varchar maxs out at 255 characters
 
Post is limited by the php.ini file amounts (usually in the megabyte
range).
 
what is the size of the post?
 
Bastien

 Date: Fri, 12 Oct 2007 10:41:15 -0400
 From: [EMAIL PROTECTED]
 To: php-db@lists.php.net
 Subject: [PHP-DB] php maximum characters in text field
 
 Is there a maximum number of character $_POST will/can return from a
 text field. I have an online form that was driving me nuts trying to
 troubleshoot, as most orders were coming in fine, but this one would
 not. I narrowed down to the length of the customer description field
 which has no limits on the form or in the database. I was told there
 was a limit to how much $_POST could return. Can someone advise?
 
 
 
 Thanks!
 
 Trish
 





Express yourself with free Messenger emoticons. Get them today!
http://www.freemessengeremoticons.ca/?icid=EMENCA122 



[PHP-DB] php maximum characters in text field

2007-10-12 Thread VanBuskirk, Patricia
Is there a maximum number of character $_POST will/can return from a
text field.  I have an online form that was driving me nuts trying to
troubleshoot, as most orders were coming in fine, but this one would
not.  I narrowed down to the length of the customer description field
which has no limits on the form or in the database.  I was told there
was a limit to how much $_POST could return.  Can someone advise?

 

Thanks!

Trish



RE: [PHP-DB] php maximum characters in text field

2007-10-12 Thread VanBuskirk, Patricia
The field on the form is as such: TEXTAREA name=Customer_Description
cols=100 rows=10 tabindex=44/TEXTAREA

The confirmation page is:  ?php echo ($_POST['Customer_Description']);
?

 

From: Bastien Koert [mailto:[EMAIL PROTECTED] 
Sent: Friday, October 12, 2007 11:26 AM
To: VanBuskirk, Patricia; php-db@lists.php.net
Subject: RE: [PHP-DB] php maximum characters in text field

 

And how is the table / field of interest configured? 833 will obviously
not fit into a 255 varchar field...
 
Bastien





Subject: RE: [PHP-DB] php maximum characters in text field
Date: Fri, 12 Oct 2007 11:24:14 -0400
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]; php-db@lists.php.net

The info he was trying to submit was 883 characters, including spaces
(counted in Word).  Many times, people have very detailed descriptions
they need to send in.  Can you think of a way to work around this
limitation?  Also, what happened when he tried to submit is he got an
email back with Undefined variable errors wherever the database was
supposed to send back info, and no record was created.

 

From: Bastien Koert [mailto:[EMAIL PROTECTED] 
Sent: Friday, October 12, 2007 11:12 AM
To: VanBuskirk, Patricia; php-db@lists.php.net
Subject: RE: [PHP-DB] php maximum characters in text field

 

Unless you are using a text field (which holds 64K [mysql]) a normal
varchar maxs out at 255 characters
 
Post is limited by the php.ini file amounts (usually in the megabyte
range).
 
what is the size of the post?
 
Bastien

 Date: Fri, 12 Oct 2007 10:41:15 -0400
 From: [EMAIL PROTECTED]
 To: php-db@lists.php.net
 Subject: [PHP-DB] php maximum characters in text field
 
 Is there a maximum number of character $_POST will/can return from a
 text field. I have an online form that was driving me nuts trying to
 troubleshoot, as most orders were coming in fine, but this one would
 not. I narrowed down to the length of the customer description field
 which has no limits on the form or in the database. I was told there
 was a limit to how much $_POST could return. Can someone advise?
 
 
 
 Thanks!
 
 Trish
 



Express yourself with free Messenger emoticons. Get them today!
http://www.freemessengeremoticons.ca/?icid=EMENCA122 

 



R U Ready for Windows Live Messenger Beta 8.5? Try it today!
http://entertainment.sympatico.msn.ca/WindowsLiveMessenger 



[PHP-DB] FW: Kesalahan posting: Don Komo

2007-10-12 Thread VanBuskirk, Patricia
Why do I get this everytime I post?

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Friday, October 12, 2007 11:26 AM
To: VanBuskirk, Patricia
Subject: Kesalahan posting: Don Komo

  Anda tidak memiliki izin untuk memposting ke grup donkomo. Anda
mungkin harus bergabung ke grup agar dibolehkan memposting atau grup ini
mungkin tidak dapat terbuka untuk memposting. 

 Kunjungi http://groups.google.com/group/donkomo/about?hl=id untuk
bergabung atau mempelajari lebih lanjut tentang siapa yang dibolehkan
memposting ke grup. 

 Bantuan untuk menggunakan Google Groups juga tersedia di:
 http://groups.google.com/support?hl=id
---BeginMessage---
The info he was trying to submit was 883 characters, including spaces
(counted in Word).  Many times, people have very detailed descriptions
they need to send in.  Can you think of a way to work around this
limitation?  Also, what happened when he tried to submit is he got an
email back with Undefined variable errors wherever the database was
supposed to send back info, and no record was created.

 

From: Bastien Koert [mailto:[EMAIL PROTECTED] 
Sent: Friday, October 12, 2007 11:12 AM
To: VanBuskirk, Patricia; php-db@lists.php.net
Subject: RE: [PHP-DB] php maximum characters in text field

 

Unless you are using a text field (which holds 64K [mysql]) a normal
varchar maxs out at 255 characters
 
Post is limited by the php.ini file amounts (usually in the megabyte
range).
 
what is the size of the post?
 
Bastien

 Date: Fri, 12 Oct 2007 10:41:15 -0400
 From: [EMAIL PROTECTED]
 To: php-db@lists.php.net
 Subject: [PHP-DB] php maximum characters in text field
 
 Is there a maximum number of character $_POST will/can return from a
 text field. I have an online form that was driving me nuts trying to
 troubleshoot, as most orders were coming in fine, but this one would
 not. I narrowed down to the length of the customer description field
 which has no limits on the form or in the database. I was told there
 was a limit to how much $_POST could return. Can someone advise?
 
 
 
 Thanks!
 
 Trish
 





Express yourself with free Messenger emoticons. Get them today!
http://www.freemessengeremoticons.ca/?icid=EMENCA122 


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