php-general Digest 16 Jul 2007 03:46:23 -0000 Issue 4905
Topics (messages 258877 through 258888):
Re: SMS questions
258877 by: Steve Perkins
Persistent Objects
258878 by: Wesley Acheson
258879 by: Nathan Nobbe
258883 by: Wesley Acheson
258884 by: Nathan Nobbe
258887 by: Sancar Saran
Re: I am lost
258880 by: Richard Davey
Re: problem with array
258881 by: Al
258882 by: Jim Lucas
Re: text field truncation with sql server
258885 by: Bruce Cowin
Re: Announcing Xaja, a PHP Reverse Ajax framework
258886 by: Sancar Saran
PHP mail with attachment
258888 by: Vanessa Vega
Administrivia:
To subscribe to the digest, e-mail:
[EMAIL PROTECTED]
To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]
To post to the list, e-mail:
[EMAIL PROTECTED]
----------------------------------------------------------------------
--- Begin Message ---
Sorry, www.textit.biz
Cheers
-----Original Message-----
From: Dan [mailto:[EMAIL PROTECTED]
Sent: 13 July 2007 17:52
To: [EMAIL PROTECTED]
Subject: Re: [PHP] SMS questions
Might want to retry that link, it's broken.
- Dan
""Steve Perkins"" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Richard makes some good points.
>
> Further to the original posting though, I have a friend who works with
> this SMS stuff, and out of interest asked him about it. Here is his
> (slightly
> scary) response, might be of some use ...
>
> His website is www.textit,biz
>
>
>
> -----Original Message-----
> From: Shaun M. Nixon
> Sent: 13 July 2007 09:17
> To: Steve Perkins [mailto:[EMAIL PROTECTED]
> Subject: FW: [PHP] SMS questions
>
> Hi Steve
>
> Hope you're doing fine.
>
> It is possible. In short, you have seen how a SMS message is sent
> using a operators Name label i.e. the Messages says who it's from e.g.
> TEXT IT, but you are unable to reply because the Sender is 'Text it'
> and not a mobile number. Well in the same mechanism, you can send a
> mobile phone number as the Label. Thus allowing you to send someone a
> message as if it came from someone else. I guess this is what is
> being asked / wanted - spoofing a Mobile.
>
> It is illegal to do this without consent and you must audit / prove
> ownership / identity of the phone regarding the use / service (highly
> regulated) - it also carries great risk to the provider (e.g. 2
> Million fine from ICTICS), hence most companies reluctance etc.
>
> I believe Skype have recently introduced this service (but it's
> expensive) if Brian wants to try it out. We can do the same if
> required, as too relay all reply messages via email / texts if needed.
>
> Kind Regards
> Shaun Nixon
> Principal Consultant
>
> W: www.textit.biz
>
>
>
> -----Original Message-----
> From: Steve Perkins [mailto:[EMAIL PROTECTED]
> Sent: 13 July 2007 01:05
> To: Shaun M. Nixon
> Subject: FW: [PHP] SMS questions
>
> I saw this and I though of you Shaun. You have any answers ?
> Cheers
>
>
> -----Original Message-----
> From: Brian Dunning [mailto:[EMAIL PROTECTED]
> Sent: 13 July 2007 00:40
> To: [EMAIL PROTECTED]
> Subject: [PHP] SMS questions
>
> Hi all - I've been looking at a number of the commercial service
> providers for bulk SMS messaging, most of whom have PHP APIs. But
> since they are selling something they don't answer my question....
>
> Is there any (legal, legitimate) way to send an SMS message that can
> be replied to the desired SMS cell number? Like, if I use PHP to send
> an SMS to Bob, can I make it appear to come from Jim's cell phone so
> that Bob can reply directly to Jim normally? The services all require
> Jim to log into their web site to read any replies.
>
> --
> PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:
> http://www.php.net/unsub.php
--
PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:
http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Hi,
At work we use Java so one thing is annoying me. Is there really no
way to create a persistent object in PHP? As far as my understanding
goes each object will be recreated on each and every request.
The reason I was asking is I wanted to create a form object that would
be used as follows.
which would require recreating the from stuff three times at least
Once for a JS file. Once for a HTML output. And once for Server side
validation)
Please note that the following is just an example off the top of my
head the code to do this hasn't been written yet and the exact
implemantation may be different. It would be much better to only
create the object once.
<?php
...
Other stuff goes here.
...
//Create a new form
formReg = new Form ("registration");
regStyle = new RenderStyle(HTML_AND_JAVASCRIPT_TABLELESS);
formReg->setRenderStyle();
/**
* Set the username field and its Validation
*/
fieldUsername = new Field("username");
fieldUsername->setLabel("User Name");
fieldUsername->setType(FIELD_TEXT);
fieldUsername->setCompulsary(true);
fieldUsername->setUnique(true);
fieldUsername->setMinLength(6);
fieldUsername->setMaxLength(20);
fieldUsername->setMaxLengthError(fieldUsername->getMinLengthError());
fieldUsername->setValidCharachters(CHARACHTERS_A-Z_1-9);
formReg->addField(fieldUsername)
.....
//OTHER FIELD STUFF HERE
.....
//Adds the link to a generated JS file at the top;
if (frmReg->needsJSCode == true) {
output->add(formReg->getJSValidationURL)
}
....
//CONTINUE WITH THE REST OF THE HTML PAGE
....
//Insert the form into the HTML
output->add(fromReg->getForm(regForm));
?>
In the custom JS file we need;
<?php
frmReg->getValidationAsJavascript()
?>
Then after this in the page that receives the form submission we again
need to get the validation rules which means recreating the the form
object at least three times. This time to validate serverside.
<?php
session_start() {
....
if (!frmReg->validates) {
$_SESSION[VALIDATION_ERROR] = frmReg->getValidationError();
$_SESSION[ERROR_FIELD] = frmReg->getValidationField();
...
//logging goes here
...
HttpResponse::redirect ( REGISTRATION_URL) ;
....
} else {
...
// Attempt to save to the DB
// Redirect on error
// log a successfull registration
...
require_once (REGISTRAION_SUCCESS_PAGE);
}
?>
--- End Message ---
--- Begin Message ---
Wesley,
I too have come from a Java [ and c++ ] background to PHP. fear not; you
can create persistent objects PHP.
although there is no JVM to handle this automatically
object can be persisted by storing their references. the
most natural place to store them is in the session. and if i understand the
advice i was given a few weeks ago
this is *the PHP way* to do it since PHP was written as an implementation of
the *shared nothing paradigm *(did i say that correctly?).
Also, note that there are many ways the session can be stored. PHP stores
the session on disk naively, but
this behavior can be overridden. Sessions often times are stored in a
database instead. And my thinking, though
im sure someone would love to correct me, is that sessions can be stored in
memory via a technology like
memcached.
-nathan
On 7/15/07, Wesley Acheson <[EMAIL PROTECTED]> wrote:
Hi,
At work we use Java so one thing is annoying me. Is there really no
way to create a persistent object in PHP? As far as my understanding
goes each object will be recreated on each and every request.
The reason I was asking is I wanted to create a form object that would
be used as follows.
which would require recreating the from stuff three times at least
Once for a JS file. Once for a HTML output. And once for Server side
validation)
Please note that the following is just an example off the top of my
head the code to do this hasn't been written yet and the exact
implemantation may be different. It would be much better to only
create the object once.
<?php
...
Other stuff goes here.
...
//Create a new form
formReg = new Form ("registration");
regStyle = new RenderStyle(HTML_AND_JAVASCRIPT_TABLELESS);
formReg->setRenderStyle();
/**
* Set the username field and its Validation
*/
fieldUsername = new Field("username");
fieldUsername->setLabel("User Name");
fieldUsername->setType(FIELD_TEXT);
fieldUsername->setCompulsary(true);
fieldUsername->setUnique(true);
fieldUsername->setMinLength(6);
fieldUsername->setMaxLength(20);
fieldUsername->setMaxLengthError(fieldUsername->getMinLengthError());
fieldUsername->setValidCharachters(CHARACHTERS_A-Z_1-9);
formReg->addField(fieldUsername)
.....
//OTHER FIELD STUFF HERE
.....
//Adds the link to a generated JS file at the top;
if (frmReg->needsJSCode == true) {
output->add(formReg->getJSValidationURL)
}
....
//CONTINUE WITH THE REST OF THE HTML PAGE
....
//Insert the form into the HTML
output->add(fromReg->getForm(regForm));
?>
In the custom JS file we need;
<?php
frmReg->getValidationAsJavascript()
?>
Then after this in the page that receives the form submission we again
need to get the validation rules which means recreating the the form
object at least three times. This time to validate serverside.
<?php
session_start() {
....
if (!frmReg->validates) {
$_SESSION[VALIDATION_ERROR] = frmReg->getValidationError();
$_SESSION[ERROR_FIELD] = frmReg->getValidationField();
...
//logging goes here
...
HttpResponse::redirect ( REGISTRATION_URL) ;
....
} else {
...
// Attempt to save to the DB
// Redirect on error
// log a successfull registration
...
require_once (REGISTRAION_SUCCESS_PAGE);
}
?>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Thanks Nathan,
I guess that your answer raises a couple of questions.
1. Does the answer below mean no global persistant objects?
(Application scope) I guess that it does.
2. Is this an un-PHP way of doing things?
3. Is what I'm trying to do even worthwhile or should I just create
each form and its validation rules by hand? (My gut feeling is that
its still worth doing as it centralizes form processing and reduces
redundancy on a code level)
4. Which would be more expensive recreating the object each time? Or
fetching it from the session each time? (I know that this probably
doesn't have a definative answer)
Anyway my feeling is it probably shouldn't go in the session as its
not a client object.
Comments are welcome.
Regards,
Wesley
On 7/15/07, Nathan Nobbe <[EMAIL PROTECTED]> wrote:
Wesley,
I too have come from a Java [ and c++ ] background to PHP. fear not; you
can create persistent objects PHP.
although there is no JVM to handle this automatically object can be
persisted by storing their references. the
most natural place to store them is in the session. and if i understand the
advice i was given a few weeks ago
this is the PHP way to do it since PHP was written as an implementation of
the shared nothing paradigm (did i say that correctly?).
Also, note that there are many ways the session can be stored. PHP stores
the session on disk naively, but
this behavior can be overridden. Sessions often times are stored in a
database instead. And my thinking, though
im sure someone would love to correct me, is that sessions can be stored in
memory via a technology like
memcached.
-nathan
On 7/15/07, Wesley Acheson <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> At work we use Java so one thing is annoying me. Is there really no
> way to create a persistent object in PHP? As far as my understanding
> goes each object will be recreated on each and every request.
>
> The reason I was asking is I wanted to create a form object that would
> be used as follows.
>
> which would require recreating the from stuff three times at least
> Once for a JS file. Once for a HTML output. And once for Server side
> validation)
>
> Please note that the following is just an example off the top of my
> head the code to do this hasn't been written yet and the exact
> implemantation may be different. It would be much better to only
> create the object once.
>
> <?php
> ...
> Other stuff goes here.
> ...
> //Create a new form
> formReg = new Form ("registration");
>
> regStyle = new
RenderStyle(HTML_AND_JAVASCRIPT_TABLELESS);
> formReg->setRenderStyle();
>
> /**
> * Set the username field and its Validation
> */
> fieldUsername = new Field("username");
> fieldUsername->setLabel("User Name");
> fieldUsername->setType(FIELD_TEXT);
> fieldUsername->setCompulsary(true);
> fieldUsername->setUnique(true);
> fieldUsername->setMinLength(6);
> fieldUsername->setMaxLength(20);
>
fieldUsername->setMaxLengthError(fieldUsername->getMinLengthError());
> fieldUsername->setValidCharachters(CHARACHTERS_A-Z_1-9);
>
> formReg->addField(fieldUsername)
> .....
> //OTHER FIELD STUFF HERE
> .....
>
> //Adds the link to a generated JS file at the top;
> if (frmReg->needsJSCode == true) {
> output->add(formReg->getJSValidationURL)
> }
> ....
> //CONTINUE WITH THE REST OF THE HTML PAGE
> ....
>
> //Insert the form into the HTML
> output->add(fromReg->getForm(regForm));
> ?>
>
> In the custom JS file we need;
> <?php
> frmReg->getValidationAsJavascript()
> ?>
>
> Then after this in the page that receives the form submission we again
> need to get the validation rules which means recreating the the form
> object at least three times. This time to validate serverside.
>
> <?php
> session_start() {
> ....
> if (!frmReg->validates) {
> $_SESSION[VALIDATION_ERROR] = frmReg->getValidationError();
> $_SESSION[ERROR_FIELD] = frmReg->getValidationField();
> ...
> //logging goes here
> ...
> HttpResponse::redirect ( REGISTRATION_URL) ;
> ....
> } else {
> ...
> // Attempt to save to the DB
> // Redirect on error
>
> // log a successfull registration
> ...
> require_once (REGISTRAION_SUCCESS_PAGE);
> }
>
> ?>
--- End Message ---
--- Begin Message ---
Wesley,
1. Does the answer below mean no global persistant objects?
(Application scope) I guess that it does.
No. Files, a database or memory (memcached) can be used to facilitate
application variables.
However, I've been told this is taboo in PHP. Coming from Java I'm sure
youve heard as I
have, that the lack for native support of application variables is a
weakness in PHP, however it
appears that it has actually been designed without support for application
variables *on purpose*.
If you look at *shared nothing* on
wikipedia<http://en.wikipedia.org/wiki/Shared_nothing_architecture>,
youll find a a decent overview.
I also found some articles on the Zend website that essentially say an
$_APPLICATION array
was purposely not implemented.
If i understand correctly there is a trade off between a centrally managed
state and a shared nothing
approach. Shared nothing systems will have redundant data, but less load
trying to grant exclusive access to a shared central state. Shared nothing
systems
introduce additional complexity in order to keep exclusive copies of central
state in sync.
2. Is this an un-PHP way of doing things?
If youre talking about application variables then, apparently.
3. Is what I'm trying to do even worthwhile or should I just create
each form and its validation rules by hand? (My gut feeling is that
its still worth doing as it centralizes form processing and reduces
redundancy on a code level)
dont let PHPs lack of managing persistent objects dissaude you
from good programming practices. code duplication is often a poor
technique,
although there are times when it can be rationalized. in your paritcular
situation,
implementing form validation, you may want to study up on the strategy
pattern,
if you dont already know about it. there is a decent example on
phppatterns.com <http://www.phppatterns.com/docs/design/strategy_pattern>
which demonstrates strategy using form validation as an example
(although the example is in php4 :<)
4. Which would be more expensive recreating the object each time? Or
fetching it from the session each time? (I know that this probably
doesn't have a definative answer)
i think there are quite a few variables in this question. primarily it
depends on what the
obect does. for an object that needs to query the database to initialize
its state it is almost
certainly less expensive to cache the instance in memory. but if it is
simply built w/ the values
of user input in a web form it may not offer noticeable savings. object
persistence is a
trade off between time and space, persisting the objects will take more
space. of course if
those objects represent data from a database or some other source where the
data they represent
can change, there is additional complexity involved making sure their
internal values are changed
when the data they represent changes.
all of this really comes down to design decisions. if youre new to PHP i
would recommend focusing
on learing the language, applying what you know from java to your object
design and move to a
caching model once youre a little more comfortable [thats basically the path
ive taken w/ the language]
-nathan
4. Which would be more expensive recreating the object each time? Or
fetching it from the session each time? (I know that this probably
doesn't have a definative answer)
Anyway my feeling is it probably shouldn't go in the session as its
not a client object.
Comments are welcome.
Regards,
Wesley
On 7/15/07, Nathan Nobbe <[EMAIL PROTECTED]> wrote:
> Wesley,
>
> I too have come from a Java [ and c++ ] background to PHP. fear not;
you
> can create persistent objects PHP.
> although there is no JVM to handle this automatically object can be
> persisted by storing their references. the
> most natural place to store them is in the session. and if i understand
the
> advice i was given a few weeks ago
> this is the PHP way to do it since PHP was written as an implementation
of
> the shared nothing paradigm (did i say that correctly?).
> Also, note that there are many ways the session can be stored. PHP
stores
> the session on disk naively, but
> this behavior can be overridden. Sessions often times are stored in a
> database instead. And my thinking, though
> im sure someone would love to correct me, is that sessions can be stored
in
> memory via a technology like
> memcached.
>
> -nathan
>
>
> On 7/15/07, Wesley Acheson <[EMAIL PROTECTED]> wrote:
> >
> > Hi,
> >
> > At work we use Java so one thing is annoying me. Is there really no
> > way to create a persistent object in PHP? As far as my understanding
> > goes each object will be recreated on each and every request.
> >
> > The reason I was asking is I wanted to create a form object that would
> > be used as follows.
> >
> > which would require recreating the from stuff three times at least
> > Once for a JS file. Once for a HTML output. And once for Server side
> > validation)
> >
> > Please note that the following is just an example off the top of my
> > head the code to do this hasn't been written yet and the exact
> > implemantation may be different. It would be much better to only
> > create the object once.
> >
> > <?php
> > ...
> > Other stuff goes here.
> > ...
> > //Create a new form
> > formReg = new Form ("registration");
> >
> > regStyle = new
> RenderStyle(HTML_AND_JAVASCRIPT_TABLELESS);
> > formReg->setRenderStyle();
> >
> > /**
> > * Set the username field and its Validation
> > */
> > fieldUsername = new Field("username");
> > fieldUsername->setLabel("User Name");
> > fieldUsername->setType(FIELD_TEXT);
> > fieldUsername->setCompulsary(true);
> > fieldUsername->setUnique(true);
> > fieldUsername->setMinLength(6);
> > fieldUsername->setMaxLength(20);
> >
> fieldUsername->setMaxLengthError(fieldUsername->getMinLengthError());
> > fieldUsername->setValidCharachters(CHARACHTERS_A-Z_1-9);
> >
> > formReg->addField(fieldUsername)
> > .....
> > //OTHER FIELD STUFF HERE
> > .....
> >
> > //Adds the link to a generated JS file at the top;
> > if (frmReg->needsJSCode == true) {
> > output->add(formReg->getJSValidationURL)
> > }
> > ....
> > //CONTINUE WITH THE REST OF THE HTML PAGE
> > ....
> >
> > //Insert the form into the HTML
> > output->add(fromReg->getForm(regForm));
> > ?>
> >
> > In the custom JS file we need;
> > <?php
> > frmReg->getValidationAsJavascript()
> > ?>
> >
> > Then after this in the page that receives the form submission we again
> > need to get the validation rules which means recreating the the form
> > object at least three times. This time to validate serverside.
> >
> > <?php
> > session_start() {
> > ....
> > if (!frmReg->validates) {
> > $_SESSION[VALIDATION_ERROR] = frmReg->getValidationError();
> > $_SESSION[ERROR_FIELD] = frmReg->getValidationField();
> > ...
> > //logging goes here
> > ...
> > HttpResponse::redirect ( REGISTRATION_URL) ;
> > ....
> > } else {
> > ...
> > // Attempt to save to the DB
> > // Redirect on error
> >
> > // log a successfull registration
> > ...
> > require_once (REGISTRAION_SUCCESS_PAGE);
> > }
> >
> > ?>
--- End Message ---
--- Begin Message ---
On Sunday 15 July 2007 19:58:09 Wesley Acheson wrote:
> Hi,
>
> At work we use Java so one thing is annoying me. Is there really no
> way to create a persistent object in PHP? As far as my understanding
> goes each object will be recreated on each and every request.
>
> The reason I was asking is I wanted to create a form object that would
> be used as follows.
>
> which would require recreating the from stuff three times at least
> Once for a JS file. Once for a HTML output. And once for Server side
> validation)
>
> Please note that the following is just an example off the top of my
> head the code to do this hasn't been written yet and the exact
> implemantation may be different. It would be much better to only
> create the object once.
>
Hi,
Normally you have to recrate your objects in every request. IN php universe
everything was each request.
Unless you do someting manually.
Best way was shared memory storages, like memcached. you can use Memcached to
store your objects (I'm note sure to store object in real or serialized).
If you havent access memcached in your hosting you may try serialized object
in sql or flat file.
Also you can store our session with memcached or sql too. Also there where
another shared memory storage around there (I forgot its name, plesae search
archives of the list) It has much more capabilites than memcached and it has
no packages (a bit difficult the install).
Also if you have any php opcode chace please use it was very helpfull
(especially APC)
Regards
Sancar
--- End Message ---
--- Begin Message ---
Hi Grant,
Saturday, July 14, 2007, 8:07:43 PM, you wrote:
> Previously I had PHP on my older computer using IIS 5.1 it worked fine. But
> I'm on my new computer using IIS 7 and features like include or completely
> normal scripts that use to work no longer work. I have try to see if it's
> the web server and some of the times for the exception of the include
> function it is. How would I fix my main server IIS 7, is the new PHP 5.2
> fully compatible with it? If not when will a fully functional PHP be
> available for work with IIS 7. In my php.ini file I began by using the
> recommended file and slightly modifying it enabling gd2, openssl and mysql.
PHP 5.2 works fine on IIS7. You didn't say which version of PHP you
had before you installed 5.2, but given you said that 'normal scripts
no longer work', I'll bet it wasn't 5.2, probably even PHP 4. Meaning
the changes you are seeing are because of the upgrade in PHP, not IIS.
Without you confirming though, who knows.
Cheers,
Rich
--
Zend Certified Engineer
http://www.corephp.co.uk
"Never trust a computer you can't throw out of a window"
--- End Message ---
--- Begin Message ---
Do a print_r($result); and you'll see the problem.
Ross wrote:
I am using postcode anywhere for a 'where's my nearest' function.
All the geographical info is contained in an array, which when dumped looks
like this
var_dump ($result);
array(1) { [0]=> array(13) { ["origin_postcode"]=> string(7) "EH2 2BE"
["destination_postcode"]=> string(6) "EH2 2BE" ["distance"]=> string(3)
"0.0" ["id"]=> string(1) "1" ["description"]=> string(8) "good man"
["grid_east_m"]=> string(6) "326513" ["grid_north_m"]=> string(6) "675115"
["longitude"]=> string(17) "-3.17731851516552" ["latitude"]=> string(16)
"55.9634587262473" ["os_reference"]=> string(14) "NT 26513 75115"
["wgs84_longitude"]=> string(17) "-3.17876048499117" ["wgs84_latitude"]=>
string(16) "55.9634451567764" ["name"]=> string(12) "Jim Smith" } }
however, when I try and echo out a single index by name I get an undefined
index.
echo $result["description"];
I can't seem to extract the bits I want from it.
Thanks,
R.
--- End Message ---
--- Begin Message ---
Ross wrote:
I am using postcode anywhere for a 'where's my nearest' function.
All the geographical info is contained in an array, which when dumped looks
like this
var_dump ($result);
array(1) { [0]=> array(13) { ["origin_postcode"]=> string(7) "EH2 2BE"
["destination_postcode"]=> string(6) "EH2 2BE" ["distance"]=> string(3)
"0.0" ["id"]=> string(1) "1" ["description"]=> string(8) "good man"
["grid_east_m"]=> string(6) "326513" ["grid_north_m"]=> string(6) "675115"
["longitude"]=> string(17) "-3.17731851516552" ["latitude"]=> string(16)
"55.9634587262473" ["os_reference"]=> string(14) "NT 26513 75115"
["wgs84_longitude"]=> string(17) "-3.17876048499117" ["wgs84_latitude"]=>
string(16) "55.9634451567764" ["name"]=> string(12) "Jim Smith" } }
however, when I try and echo out a single index by name I get an undefined
index.
echo $result["description"];
I can't seem to extract the bits I want from it.
Thanks,
R.
Access this like this
echo $result[0]['description'];
notice the sub-array...
--
Jim Lucas
"Some men are born to greatness, some achieve greatness,
and some have greatness thrust upon them."
Twelfth Night, Act II, Scene V
by William Shakespeare
--- End Message ---
--- Begin Message ---
Thanks Richard for pointing me in the right direction. Yes, it is mssql I'm
using. And changing the mssql.textlimit and mssql.textsize in the php.ini file
fixed my problem.
You suggested not using all those echo statements. What do you suggest I use
instead?
Thanks again!
Regards,
Bruce
>>> "Richard Lynch" <[EMAIL PROTECTED]> 13/07/2007 5:58 p.m. >>>
What is the 3981st character?
Does your database driver, whatever it is, which you've told us is not
PDO, have any kind of limit in the buffer size of query data
back/forth?
What driver ARE you using?
I see mssql in the code, so assume that's it, right?...
Does it happen on every record at 3980?
If you don't know, add more records with enough length to find out.
PS
Using all those echo statements probably a pretty bad habit to get
into, and you probably should be using htmlentities() on each element,
before you do the nl2br...
If the 3981st character happens to be a '<' that would explain why you
aren't seeing our data... Use "View Source" in your browser if you
don't understand the preceding sentence. :-)
On Thu, July 12, 2007 11:37 pm, Bruce Cowin wrote:
> I have a simple page that displays a record from the sql server
> database. One of the fields is a text field and keeps getting
> truncated at 3980 characters. I searched and saw someone had reported
> this as a PDO bug so I'm not using PDO anymore, but I'm still getting
> the truncation. Anyone know about this or have a work around? Here
> is the code. It's the body field that is a text field. I've checked
> the field in the database and it definitely has more data than is
> displayed.
>
> $cn = mssql_connect($myserver, $myuser, $mypwd);
> mssql_select_db($mydb, $cn);
> $result = mssql_query("select * from emails where id =
> $emailid",
> $cn);
> $row = mssql_fetch_array($result, MSSQL_ASSOC);
>
> echo "<ul>";
> echo "<li><b>Id:</b> " . $row['id'] . "</li>";
> echo "<li><b>From:</b> " . $row['mailfrom'] . "</li>";
> echo "<li><b>To:</b> " . $row['mailto'] . "</li>";
> echo "<li><b>Cc:</b> " . $row['mailcc'] . "</li>";
> echo "<li><b>Subject:</b> " . $row['subject'] . "</li>";
> echo "<li><b>Date:</b> " . $row['sentdate'] . "</li>";
> echo "<li><b>Body:</b><br> " . nl2br($row['body']) . "</li>";
> echo "</ul>";
>
> Thanks for any help.
>
> Regards,
>
> Bruce
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?
--- End Message ---
--- Begin Message ---
On Saturday 14 July 2007 15:01:13 David Négrier wrote:
Hi
I just watching your screen cast, it has very good ideas. I wonder does any
other language has same kind of aproach.
Later or sooner this kind of aproach become must in web business.
Regards
Sancar.
> Indeed, Xaja relies on the keeping of an open connexion between the server
> and the browser.
> In fact, it uses, the Comet approach (which is a pain to implement in
> Javascript because the IE code and the Firefox code are completely
> different).
> (more information here:
> http://www.thecodingmachine.com/cmsDoc/xaja/trunk/architecture.html)
>
> The whole idea behind Xaja is to built a complete framework on top of the
> Comet-like javascript library that will enable the developer to write as
> few Javascript as possible. So, indeed, through the "XajaController"
> object, we are implementing a "data driven programming" library on top of
> the classical request/response HTTP protocol.
>
> Regarding performances: Indeed, since a connexion is kept open for each
> browser, this consumes a few connexions on the server (that's not a big
> problem). Each process also takes some memory. Xaja is still in an early
> stage of development and I haven't had the opportunity to run a full
> performance test, but basically, right now, I can tell that a simple
> applications takes 5 Mo of RAM per client. Which means that for 100
> concurrent users, you need 500 Mo of RAM on your server. Now, the vast
> majority of the servers have less than 100 concurrent users, and at this
> early point in the development cycle of Xaja, I wouldn't recommend
> installing Xaja on a server that has more than 100 concurrent users! ;)
>
> Regards,
> David.
--- End Message ---
--- Begin Message ---
Hello to everyone!..I had problems with attaching a document to an email
using PHP..can somebody share some ideas on how to properly do it?
Thanks in advance!
Vanessa
--- End Message ---