> i have a textarea in a form which gets inserted into a table in my
> database (mySQL). When displaying this text back to the screen, how do
> i retain the line breaks etc. that were in the original input?
I bet if you searched for "textarea" and "line breaks" you'd of found the
nl2br() function.
/**
* converts line break and spaces to page break
*
* @access public
*/
function nlbr($string) {
return preg_replace("/(\r\n|\n|\r)/", "\n", $string);
}
here is one i use , what i'm still trying to work out , its a way
I hang my head in shame... yes. As a matter of fact, I did on my second
skim through my PHP ref. manual... thanks for the pointer just the same.
- charles
On Tuesday, March 25, 2003, at 05:38 PM, CPT John W. Holmes wrote:
i have a textarea in a form which gets inserted into a table in my
databa
Daniel-
I just tried this, didn't seem to make a difference.
Thanks for the reply!
Bryan
On Tue, 25 Mar 2003, daniel wrote:
|hi , i have had similar issues its worked by doing a ob_flush before flush
|then u want a sleep statement so maybe try
|
|ob_flush();
|flush();
|sleep(2);
|
|??
I am using php 4.2.2 with Apache 2.0 on Red Hat 8.0
When I attempt to dynamically aggregate two objects using the
aggregate() call, I get the following message:
Fatal error: Call to undefined function: aggregate()
the man page for aggregate() lists the following info:
aggregate
(PHP 4 >= 4.2.0)
> /**
> * converts line break and spaces to page break
> *
> * @access public
> */
>
> function nlbr($string) {
> return preg_replace("/(\r\n|\n|\r)/", "\n", $string);
> }
ummm www.php.net/nl2br() ??
Start a new thread for your question, don't hijack someone else's thread.
---John H
how do i surpress an error message for a foreach statement?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Get rid of the error
Quoting shaun <[EMAIL PROTECTED]>:
### how do i surpress an error message for a foreach statement?
###
###
###
### --
### PHP General Mailing List (http://www.php.net/)
### To unsubscribe, visit: http://www.php.net/unsub.php
###
###
--
Richard Whitney *
Transcend D
You don't.
>From http://www.php.net/manual/en/control-structures.foreach.php
"Note: foreach does not support the ability to suppress error messages using
'@'."
You should check the validity of your argument before passing it to foreach
if(is_array($array)){
foreach($array as $key=>$val){
umm nl2br doesnt work most the time ,
"nl2br -- Inserts HTML line breaks before all newlines in a string "
sorry to give a wrong example this is for splitting your content into
paragraphs obviously where there is a break in the content like so
efwojeiowerjwetwpjwewoj
eioptejoiejiojtei
it won
i have this little function that I wrote to do just that.
function alternate(&$a, $b)
{
return($a = ($a?$a:$b) );
}
just call it like this
alternate($myArr, array());
foreach($myArr AS $k => $v)
{
do something here
}
Jim
- Original Message -
From: "Jennifer Goodie" <[EMAIL PROTECTED
ScriptAlias /php/ "c:/php/"
AddType application/x-httpd-php .php
Action application/x-httpd-php "/php/php.exe"
i'm using apache 2.0 as my web server. and i'm about to ask these question, where am
i going to put these three lines? under what line in httpd.conf?
ikhwan
> Is there a way to disable the call back function set by "ob_start"?
> I tried:
> ob_end_flush();
> ob_end_clean();
> ob_implicit_flush(true);
>
> Nothing seams to work. I can't detect the call back function and I
can't
> prevent it either. The call back function is called no matter what!
>
> Mi
> It is considered more secure to declare the variable explicitly.
>
> $var = $_GET["var"];
Ummm... that's the same result as having register_globals on
(basically). You're not helping anything and it's certainly not any more
"secure".
---John W. Holmes...
PHP Architect - A monthly magazine for
> Why is it that when I send call this function:
> function GetNextDate($whichfriday, $month = "", $frequency = 1,
$basedate
> = "")
>
> with this line:
> GetNextDate("4", "2003-03", "5");
>
> that $frequency ends up ""? Whether I set it myself when I call the
> function, or I leave it blank and
Hello, there.
(Sorry to bother you if this kind of message already posted, but I cannot find
the answer)
My system hosts customers using Apache Virtual Host.
If a customer has www.a.com, image.a.com ,
DocumentRoot of http://www.a.com is /usr/local/apache/htdocs/
and http://image.a.com is /home/
> I have a text file with a series of project variables.
>
> For example
> $var1="";
> $var2="";
> $template="blue";
> $anothervar="foo";
>
> Let say I need to change $template="blue"; to $template="red";. How
can I
> do
> that keeping the rest of the file intact?
You have to write the w
> I've been making a web ap PHP based, but I fear the number of arrays
it
> has
> is too big. Is there any way to benchmark a script, or are there any
> recomendations or standards about how much time execution takes and
how
> many
> resources it takes?
The benchmarking is just a matter of subtrac
No, it is more secure. The problem with register_globals is that ALL
variables become global - not just the ones you want to be. Example:
if(something) $authorized = true;
if($authorized){
...do something requiring security...
}
A hacker could easily go to script.php?authorized=1, and gain acce
> How do I subtract the difference of months between two dates?
>
> For instance, if one date is 2003-12 and the other is 2002-08, I need
to
> know that there are 16 months between them. If one date is 2003-04 and
the
> other is 2003-01, I need to know that there are 3 months between them.
How
> c
Okay, true. But they key here is the "act accordingly", meaning you
sanitize and validate the variable before using it anywhere.
Sometimes the way it's represented is that just using $_GET['var'] is
going to make things more secure than using $var, which is not the case
unless you know what exact
Actually, I think you may have misunderstood. On Mozilla (Mac), Netscape (Mac) and
Safari the script works exactly as I have intended: sending the "Content-Type:
application/octet-stream" header causes the file to download; sending the
"Content-Type: video/quicktime" causes the file to be playe
I'm using the following code to try to open a stream to access my email:
$user_id = "userid";
$password = "password";
$inbox = @imap_open("{mail.host.com:143}INBOX", $user_id, $password);
I've verified the correct username, password, hostname combination by setting up an
IMAP account thr
On Tue, 25 Mar 2003 21:18:48 +1000, Inpho <[EMAIL PROTECTED]> wrote:
Hey All,
I'm still a newB in php and mysql so I'm asking for your patience up
front.
i want to get a list of results from an array, which I can do with:
$result=mysql_query("select * from mvlogtbl",$db);
while ($row=mysql_fet
session_start();
should be on the first line in the script.
regds,
-Original Message-
From: Iggy [mailto:[EMAIL PROTECTED]
Sent: Tuesday, March 25, 2003 20:08
To: [EMAIL PROTECTED]
Subject: session id
can somebody tell me why I am getting this:
Warning: session_start() [function.session
On Mon, 24 Mar 2003 22:10:28 -0800, Webdev <[EMAIL PROTECTED]> wrote:
somehow when I have try to develop an application where I read five or
six
values into an individual arrays the array who carries the emails has the
email and an additional empty field after the email somehow complex
well
Yes, It is necessary because script executes & ends for every request.
Variables can be made persistent by using cookie/sessions but mysql
connection is a resource which can not be saved & restored as session
variable.
For efficient use of resources, you may use mysql_pconnect() (only when php
is
> What i want to be able to do is determine if a certain
> user has watched a movie.
If you want to check the log to see if a single user has
viewed a particular movie, then include the user and movie
in the select statement:
select uid, mvid from mvlogtbl where uid = $userID and mvid
= $movi
Hi,
Total newbie on reg exps, and even worse with preg!!!
I get the following error:
Parse error: parse error, expecting `T_VARIABLE' or `'$'' in
/usr/local/apache/htdocs/lib/lib_string.inc on line 218
Using this code:
$str =
preg_replace("!([[:alnum:]]+)://([^[:space:]]*)([[:alnum:]#?/&=])!ei
On Wednesday 26 March 2003 13:59, Justin French wrote:
> Parse error: parse error, expecting `T_VARIABLE' or `'$'' in
> /usr/local/apache/htdocs/lib/lib_string.inc on line 218
>
> Using this code:
> $str =
> preg_replace("!([[:alnum:]]+)://([^[:space:]]*)([[:alnum:]#?/&=])!ei", " href=\"{$1}://{$2
what that guy said, or use ereg_replace instead of preg_...
From: Jason Wong <[EMAIL PROTECTED]>
Reply-To: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: Re: [PHP] help with preg_replace please
Date: Wed, 26 Mar 2003 14:08:44 +0800
On Wednesday 26 March 2003 13:59, Justin French wrote:
> Pa
101 - 131 of 131 matches
Mail list logo