[PHP] Facing some problem with mySQL Installation

2002-07-24 Thread Manisha

I know I should not ask this question - but as I am not getting prompt 
reply from mysql mailing list posting it here too - Just in case anybody 
knows about it


I am trying to install the mySQL on our remote server thr putty (SSH). 
Following are the set of commands given by me,

I have downloaded mysql-3.23 for BSDi.

1)put into /usr/home/mysql-src directory and given following 2 commands 
going into
shell>cd  /usr/home/mysql-src
shell>gunzip mysql-.tar.gz
shell>tar xvf mysql-.tar

This is creating the directory mysql-
2)Config -

shell>cd  /usr/home/mysql-src/mysql-
shell>./configure -basedir=/usr/home/mysql -with-low-memory

This command is giving me problem - saying - at the end
shell>Starting mysqld daemon with database from 
/usr/home/mysql-src/mysql-/data
rm /tmp/mysql.sock - Operation not permitted
mysqld end


Can anybody help me in this matter - What is the meaning of it ?

Thanks in advance and regards
Manisha


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




[PHP] Re: Sessions don't work?

2002-07-24 Thread Lord Loh.

>From the PHP docs...
=


Hello visitor, you have seen this page  times.;

 is necessary to preserve the session id
# in the case that the user has disabled cookies
?>

To continue, click here




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




RE: [PHP] mail() function

2002-07-24 Thread Peter

1) read the manual
2) make sure you have sendmail installed
3) make sure sendmail is working
4) look at php.ini it has it all in there you just have to uncomment it and
maybe change the location for sendmail

> -Original Message-
> From: wm [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, 25 July 2002 3:55 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] mail() function
>
>
> hi all,
>
> what has to be configured, and how, on a bsd server to allow the mail()
> function to work in php? using sendmail?
>
> thanks,
>
> wm
>
>
> --
> 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




[PHP] mail() function

2002-07-24 Thread wm

hi all,

what has to be configured, and how, on a bsd server to allow the mail()
function to work in php? using sendmail?

thanks,

wm


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




[PHP] install issues on Solaris

2002-07-24 Thread Peter

hi there,

some of you may remember my post from yesterday ( titled  install to unix
... hastles )
as I said in that one I was using Solaris 9 ( the newest ver of the Solaris
OS ) i have since gone back to Solaris 8 and am having the same problem when
I go to do the "make" looking through the ./configure output i discovered it
can find "unix.h" but when I do the make (and inparticular when it goes
through the Zend Makefile ) it cannot find it.. any one got any clues or
suggestions?  ( Solaris does come with an old ver (4.0.6 I think) on a
companion CD but I wanna try and figure this one out as it's a newer ver of
php (4.2.1) )

any help would be apreciated... I can attach soft copies of both the make
and the configure screen outputs for any that are interested...

Cheers

Peter
"the only dumb question is the one that wasn't asked"



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




Re: [PHP] Php and Apache

2002-07-24 Thread S.Murali Krishna

On Wed, 24 Jul 2002, Varsha Agarwal wrote:

>Hi,
>I have istalled php from the red hat cd at the time i
>installed red hat itself. I downloaded apache and
>installed it. Can anyone tell me how to configure php
>on apache server? I mean what do I do next to run php
>scripts? I am totally new to all this. Please help.
>-Varsha

If you installed php from redhat CD, then why not apache.
The Apache rpm in redhat 7.3 comes as precompiled 
support for Dynamic shared object so there is no need for doing
anything except install your Apache and Php from rpms as it is.

Then keep your php files in /var/www/html/ or whatever 
you configured for  Directive in Apache.

If you don't have apache you can download it from redhat site.
---
  S.Murali Krishnan
  Internet: [EMAIL PROTECTED]
---



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




Re: [PHP] Newman's PHP sessions management.

2002-07-24 Thread Justin French

session_name()

JF


on 25/07/02 2:41 PM, Philip J. Newman ([EMAIL PROTECTED]) wrote:

> One question.
> 
> When i start a new session i get the veriable PHPSESSID=what ever added to
> links that I want PHPSESSID to be called sid.  How can i do this?
> 
> ---
> Philip J. Newman.
> PhilipNZ.com Design Solutions
> http://www.philipnz.com/
> [EMAIL PROTECTED]
> 
> Mob: +64 (25) 6144012.
> Tele: +64 (25) 6144012.
> 
> Personal Site:
> Philip J. Newman
> Internet Developer
> http://www.philipsdomain.com/
> [EMAIL PROTECTED]
> 
> 
> 


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




Re: [PHP] newline problem

2002-07-24 Thread Justin French

A new line is NOT a  or  in HTML.

Assuming this output is for HTML (browser) purposes, the browser will ignore
newlines.

second linethird line'; // works for HTML
?>
Will print...

this is first line
second line
third line

... to the browser.



If you have a $string with \n's in it, you can convert these to 's
with the function nl2br():

's for HTML output
$string_html = nl2br($string);


// newlines done with hitting return will work in email and txt files
$string = 'this is first line
second line
third line';

// convert \n's to 's for HTML output
$string_html = nl2br($string);

?>


Think about it -- this HTML...


something
something
something


... will output somethingsomethingsomething to the browser, because browsers
ignore newlines, tabs, and other whitespace in text.  On the other hand,
this HTML...


something
something
something


... would achieve three separate lines, so you need to do the same thing
when echoing.


HTH

Justin French


on 25/07/02 2:11 PM, Wormy . ([EMAIL PROTECTED]) wrote:

> Dear all,
> this sounds like a silly problem but i really dunno how to fix it!
> 
> In the php manual on php.net said we can use an embedded newline just
> by writing the string on different line by pressing "enter" key. This
> doesn't work for me. Another thing is \n also work. For example:
> 
>  echo ' You can also have embedded newlines in strings,
> like this way.';
> echo 'I am trying to include at this point: \n a newline';
> ?>
> 
> the output i get is:
> "You can also have embedded newlines in strings, like this way.I am trying
> to include at this point: \n a newline"
> 
> Am I doing anything wrong? Thanks!
> 
> Ser Yee
> 
> _
> Join the world’s largest e-mail service with MSN Hotmail.
> http://www.hotmail.com
> 


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




Re: [PHP] Password Generator Script

2002-07-24 Thread Richard Baskett

Credits are with the file.  Cheers!

Rick

"Finish each day and be done with it. You have done what you could; some
blunders and absurdities have crept in; forget them as soon as you can.
Tomorrow is a new day; you shall begin it serenely and with too high a
spirit to be encumbered with your old nonsense." - Ralph Waldo Emerson

> From: Monty <[EMAIL PROTECTED]>
> Date: Thu, 25 Jul 2002 00:49:17 -0400
> To: [EMAIL PROTECTED]
> Subject: [PHP] Password Generator Script
> 
> Can anyone recommend where I could find a decent script that automatically
> generates passwords? I don't care if they are readable or just random
> letters, numbers.
> 
> Thanks!
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 



‹QÛ<íW{ÚF¿Aâ;Ì!¤Ø  Cȝ
áÒ*Ê£Ò5:å¡J¢“±ìÆö’õúIóÝû›µ
æÂ)U•ô¤Ê#›ÙyÏ">ºñ*ýU°:úQà
gì8xžNvÏÆÎðÈ9Ÿœœd¡VۋÜ4í+7ñeü»T>'J۞¶š5~ь±¦Ùڒzg©ÐV;
d¦Õíî°B™gaä›í§•U×÷_dñ\¨ÔºÏË­æJ…‰¦‚Ìßfõ‘QWí¾]
”XÌÚFw^ 
©sñüâòՓó§SztÖ>s—n˜<¸¼{PZ:0¦ßvnÅ÷{Ÿñúp2¼^ÿã“ñ¨®ÿÿŠzo5wùaòaR©hî‘pSáOhä8£ž3îN[M7ӁTzŸÅð_ìÅa¹
Yæ÷Ï^zîRÆÒÏ"Wõ=ۅlòEê©p¥C™LˆŒÝ÷"%·8“î(áúî<wÈ´Ë˔‰Ž6$’e¦AO&ÑÆî“”ðÉR±È"
´‘­]ô
-qàZŠD(WZáx™‚ÓÕ¼Y1¯"Šó©¼Ä‚»Ya’j^•Z†Wa²Ÿˆ¡édãˆié9T¢jU¶Øg³"Ð6™ ÌÊ&•‹ƒe¨ÄÄãeDbx-Ðõ0(Ñ£}ÊyyVš½KÄ

~ð%²Kô¶þÄìKÙG`B“6Y.®ÑŠŸ&íìJÖ]!Íæйªp×é–
O‹C!=·8×ó°ÉŒCIœù<ÒIEr>!¸eZ[   ¦W¢™›}ðS™’yµéšOÛÇímš+¡3•Tw¬±rñ% A¦³zžE•‚³‹î«K¶
ìjUVþ}”e9ÞV%
²:ál8Å

[PHP] Password Generator Script

2002-07-24 Thread Monty

Can anyone recommend where I could find a decent script that automatically
generates passwords? I don't care if they are readable or just random
letters, numbers. 

Thanks!


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




Re: [PHP] Newman's PHP sessions management.

2002-07-24 Thread Richard Baskett

You can either change it in your php.ini file or using the session_name()
function

Rick

"The greater danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it." - Michelangelo

> From: "Philip J. Newman" <[EMAIL PROTECTED]>
> Date: Thu, 25 Jul 2002 16:41:07 +1200
> To: <[EMAIL PROTECTED]>
> Subject: [PHP] Newman's PHP sessions management.
> 
> One question.
> 
> When i start a new session i get the veriable PHPSESSID=what ever added to
> links that I want PHPSESSID to be called sid.  How can i do this?
> 
> ---
> Philip J. Newman.
> PhilipNZ.com Design Solutions
> http://www.philipnz.com/
> [EMAIL PROTECTED]
> 
> Mob: +64 (25) 6144012.
> Tele: +64 (25) 6144012.
> 
> Personal Site:
> Philip J. Newman
> Internet Developer
> http://www.philipsdomain.com/
> [EMAIL PROTECTED]
> 
> 
> 
> 
> -- 
> 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




[PHP] Newman's PHP sessions management.

2002-07-24 Thread Philip J. Newman

One question.

When i start a new session i get the veriable PHPSESSID=what ever added to
links that I want PHPSESSID to be called sid.  How can i do this?

---
Philip J. Newman.
PhilipNZ.com Design Solutions
http://www.philipnz.com/
[EMAIL PROTECTED]

Mob: +64 (25) 6144012.
Tele: +64 (25) 6144012.

Personal Site:
Philip J. Newman
Internet Developer
http://www.philipsdomain.com/
[EMAIL PROTECTED]




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




Re: [PHP] CRLF Injection in mail()

2002-07-24 Thread Analysis & Solutions

John:

On Fri, Jul 19, 2002 at 11:19:59PM -0400, John Holmes wrote:
> Maybe I'm behind the times, but I just found out about this one today.
> Basically if a user can take your form that sends an email, and send a
> value like "This is my subject\nBcc: [EMAIL PROTECTED]" for the subject,
> then they will get Bcc'd on every email your script later sends.

Well, as mentioned by others, not every email, just the one being sent at
that time.  But, more importantly, folks can put in other people's
addresses into the Bcc and spam them all using your resources.  This has
already been exploited on some web to mail forms.

My email form functions check user input for unwanted characters,
including \r and \n via ereg.  If any are found, they're removed and the
form is redisplayed saying they can't use such characters.

Later,

--Dan

-- 
   PHP classes that make web design easier
SQL Solution  |   Layout Solution   |  Form Solution
sqlsolution.info  | layoutsolution.info |  formsolution.info
 T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
 4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409

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




Re: [PHP] Grab value of mail headers

2002-07-24 Thread Michael Sims

On Thu, 25 Jul 2002 05:47:57 +0200, you wrote:

>Bonus points if you could tell me a way to parse the entire headers
>into something useful like a set of key, value pairs using the header
>name as key and the value as value. 

$lines = split("\r?\n",$headerstring);

foreach($lines as $line) {
  if(preg_match("/^([^:]+):\s*(.*)$/",$line,$matches)) {
$headers[$matches[1]] = $matches[2];
  }
}

I think IMAP headers are split on newlines only, but I don't know if
some Windoze servers (such as Exchange) put CRLF in there or not.  The
regex above should work, assuming that everything before the first
colon is the header name and everything after it is the value.  I
haven't read the RFC in detail so there may be a better pattern to
match against than the one above.  That is assuming that the above
pattern works, I haven't tested it.  HTH.

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




Re: [PHP] POST question

2002-07-24 Thread Analysis & Solutions

Jadiel:

On Sat, Jul 20, 2002 at 12:58:25AM -0500, Jadiel Flores wrote:

> header("Location: computer.php");

Do note, proper syntax uses complete URI's, not just the page name.  Also, 
you can do this with single quotes.

  header('Location: http://www.foo.org/computer.php');

Enjoy,

--Dan

-- 
   PHP classes that make web design easier
SQL Solution  |   Layout Solution   |  Form Solution
sqlsolution.info  | layoutsolution.info |  formsolution.info
 T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
 4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409

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




Re: [PHP] Grab value of mail headers

2002-07-24 Thread Jason Wong

On Thursday 25 July 2002 11:47, Nicklas af Ekenstam wrote:
> Hi
>
> Could someone please enlighten me on a good way to grab the value for
> a given mail header once I've fetched the entire headers to a string
> using php:s imap_fetchheader() function?
>
> For an example I would like to look for a header called List-Id which
> may look like this:
>
> List-Id: 
>
> And grab the value -  - into a variable to
> use later on in my script.

You can preg_match(). Or you can probably use explode() with ': ' as the 
separator.

> Bonus points if you could tell me a way to parse the entire headers
> into something useful like a set of key, value pairs using the header
> name as key and the value as value.

Once you've got one header working use a loop.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
We must believe that it is the darkest before the dawn of a beautiful
new world.  We will see it when we believe it.
-- Saul Alinsky
*/


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




Re: [PHP] vertical word match SOLUTION

2002-07-24 Thread Analysis & Solutions

Hi Joe:

On Fri, Jul 19, 2002 at 12:50:53PM -0500, 'Joe Rice' wrote:
> 
> $answer = "hello\na\np\np\nl\ne\n"; /*from textarea in form*/
> /* replace all whitespace and newlines with nothing */
> $tempanswer = preg_replace("/\s*|\n*/","",$answer);

Easier:

 $tempanswer = preg_replace('/\s/', '', $answer);

The \s includes all white space, including line breaks.  You don't need
the *'s in there because all of them get replaced anyway.

--Dan

-- 
   PHP classes that make web design easier
SQL Solution  |   Layout Solution   |  Form Solution
sqlsolution.info  | layoutsolution.info |  formsolution.info
 T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
 4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409

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




Re: [PHP] newline problem

2002-07-24 Thread Jason Wong

On Thursday 25 July 2002 12:11, Wormy . wrote:
> Dear all,
>  this sounds like a silly problem but i really dunno how to fix it!
>
>  In the php manual on php.net said we can use an embedded newline just
> by writing the string on different line by pressing "enter" key. This
> doesn't work for me. Another thing is \n also work. For example:
>
>echo ' You can also have embedded newlines in strings,
>   like this way.';
>   echo 'I am trying to include at this point: \n a newline';
> ?>
>
> the output i get is:
> "You can also have embedded newlines in strings, like this way.I am trying
> to include at this point: \n a newline"
>
> Am I doing anything wrong? Thanks!

Stuff like \n are only interpreted if they are enclosed in double-quotes:

"This works\n"
'This does not work\n'

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
Iron Law of Distribution:
Them that has, gets.
*/


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




Re: [PHP] modify an element of a HTML tag within a string

2002-07-24 Thread Analysis & Solutions

Hi Justin:

On Fri, Jul 19, 2002 at 01:50:08PM +1000, Justin French wrote:
> 
> 1. look for a given tag eg DIV
> 2. capture the tag (everything from '')
> 3. look for a given attribute (eg ID="foo", ID=foo, ID='foo' -- all valid
> ways)
> 4. capture it
> 5. be given the opportunity to manipulate the attribute's value, delete it,
> etc
> 6. place captured tag (complete with modifed elements) back into the string
> in it's original position
> 7. return to step 1, looking for the next occurence of a DIV tag

This can be done with preg_replace() and a function.  Here are some 
variations on such an expression / function combo.

 middle  end';

function alter($var) {
   return "_$var" . '_';
}


# To grab all attributes...
$Out = preg_replace('/((]*))/i', '\\2' . alter("\\3"), $Val);
# \\1 contains whole match
# \\2 contains tag type
# \\3 contains attributes

echo htmlspecialchars($Out);

echo '';

# To grab just the id attribute...
$Out = preg_replace('/((

Of course, be a good hacker and modify it to suit your actual needs. :)

Enjoy,

--Dan

-- 
   PHP classes that make web design easier
SQL Solution  |   Layout Solution   |  Form Solution
sqlsolution.info  | layoutsolution.info |  formsolution.info
 T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
 4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409

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




[PHP] newline problem

2002-07-24 Thread Wormy .

Dear all,
 this sounds like a silly problem but i really dunno how to fix it!

 In the php manual on php.net said we can use an embedded newline just 
by writing the string on different line by pressing "enter" key. This 
doesn't work for me. Another thing is \n also work. For example:



the output i get is:
"You can also have embedded newlines in strings, like this way.I am trying 
to include at this point: \n a newline"

Am I doing anything wrong? Thanks!

Ser Yee

_
Join the world’s largest e-mail service with MSN Hotmail. 
http://www.hotmail.com


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




[PHP] Grab value of mail headers

2002-07-24 Thread Nicklas af Ekenstam

Hi

Could someone please enlighten me on a good way to grab the value for
a given mail header once I've fetched the entire headers to a string
using php:s imap_fetchheader() function?

For an example I would like to look for a header called List-Id which
may look like this:

List-Id: 

And grab the value -  - into a variable to
use later on in my script.

Bonus points if you could tell me a way to parse the entire headers
into something useful like a set of key, value pairs using the header
name as key and the value as value. 

Tia,
Nicklas

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




Re: [PHP] web page function

2002-07-24 Thread Tech Support

Hi Steve,

try this:

if (basename($SCRIPT_NAME) == "index.php")
print "some silly message";


Jim Grill
Support
Web-1 Hosting
http://www.web-1hosting.net
- Original Message -
From: "Steve Minter" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, July 24, 2002 9:50 PM
Subject: [PHP] web page function


I am tring to refer to a web page using a function. What function refers to
a web page?
example: if (page=index.php)
{
print $something
}

What function should "page" be?

Thanks

Steve




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




Re: [PHP] web page function

2002-07-24 Thread David Buerer

Try This

if(strtoupper($REQUEST_URI)=='INDEX.PHP')
{
  ...statements...
}
- Original Message -
From: "Steve Minter" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, July 24, 2002 7:50 PM
Subject: [PHP] web page function


I am tring to refer to a web page using a function. What function refers to
a web page?
example: if (page=index.php)
{
print $something
}

What function should "page" be?

Thanks

Steve



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




[PHP] web page function

2002-07-24 Thread Steve Minter

I am tring to refer to a web page using a function. What function refers to a web 
page? 
example: if (page=index.php)
{
print $something
}

What function should "page" be?

Thanks

Steve 



Re: Re[2]: [PHP] HTTP_POST_FILES undefined - What happen?

2002-07-24 Thread Rija

Thanks all,

This is the correct script :

Function verify($file) {
GLOBAL $HTTP_POST_FILES ;
echo $HTTP_POST_FILES['file']['type'] ;

echo $HTTP_POST_FILES['file']['name'] ;

echo $HTTP_POST_FILES['file']['size'] ;

...

}

I forgot to put the GLOBAL in the front of the function. Now, my script work
well.



Ravelomanana Rija
[EMAIL PROTECTED]
BP 1528 Port Vila
Vanuatu
- Original Message -
From: "Tom Rogers" <[EMAIL PROTECTED]>
To: "Tom Rogers" <[EMAIL PROTECTED]>
Cc: "Rija" <[EMAIL PROTECTED]>; "PHP-General" <[EMAIL PROTECTED]>
Sent: Thursday, July 25, 2002 12:19 PM
Subject: Re[2]: [PHP] HTTP_POST_FILES undefined - What happen?


> Hi,
>
> Thursday, July 25, 2002, 11:15:33 AM, you wrote:
> TR> Hi,
>
> TR> Thursday, July 25, 2002, 10:39:08 AM, you wrote:
> R>> Hi all,
>
> R>> Thought I turned on register_globals on in the php.ini, my server
didn't know the HTTP_POST_FILES.
>
> R>> echo $HTTP_POST_FILES[$file]['type'] ;
>
> R>> echo $HTTP_POST_FILES[$file]['name'] ;
>
> R>> echo $HTTP_POST_FILES[$file]['size'] ;
>
> R>> I've always get these messages:
>
> R>> PHP Warning: Undefined variable: HTTP_POST_FILES in
c:\inetpub\wwwroot\ohabolana\scripts\sary_vaovao.inc on line 4 PHP Warning:
Undefined variable: HTTP_POST_FILES in
> R>> c:\inetpub\wwwroot\ohabolana\scripts\sary_vaovao.inc on line 5 PHP
Warning: Undefined variable: HTTP_POST_FILES in
c:\inetpub\wwwroot\ohabolana\scripts\sary_vaovao.inc on line 6
>
> R>> Any suggestions ?
>
> R>> Ravelomanana Rija
> R>> [EMAIL PROTECTED]
> R>> BP 1528 Port Vila
> R>> Vanuatu
>
> TR> If they are being used in a function you will need to do:
> TR> function whatever(){
> TR> global $HTTP_POST_VARS;
> TR> .
> TR> .
> TR> .
> TR> }
>
> TR> Just a guess :)
>
>
> TR> --
> TR> Best regards,
> TR> Tom
>
>
>
> sorry that should have been
> global $HTTP_POST_FILES;
>
> --
> Best regards,
> Tom
>
>
> --
> 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




RE: [PHP] datetime field - still a newbie

2002-07-24 Thread David Freeman

 > I have a datetime field in one of my mysql tables...when 
 > displaying some of
 > my records I want to display the date in the aforementioned 
 > datetime field,
 > but if the date is today I want to display "today" instead.  
 > If the date is
 > yesterday I want it to display that  so I how do I 
 > compare the date in
 > my record to todays date? Thanks

First up, extract your date as part of your query in a standard format -
if you're looking to do date manipulations you're probably going to be
benefit from extracting it as a unix timestamp.

Once you've got your date information, along with whatever else you're
extracting, you can then process it in php.

You'll most likely have some sort of while() loop to increment through
your query data.

While you're incrementing through you can do an test the date
information against "today" and "yesterday".  Have a read of the php
manual for date() and mktime() as you'll almost certainly need to use
these two functions.

Basically what you'll need to do is test to see if the date information
from your database query is the same as your date information based on
working out what "today" or "yesterday" are when expressed in the same
format as the date information from your database.

The rest is pretty much display stuff - substitute date information for
appropriate words as required.

Hope that heads you in the right direction.

CYA, Dave




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




Re: [PHP] Strange problem with objects

2002-07-24 Thread Evan

Never mind, I just found and exceptable work around.
$GLOBALS["session"] & $GLOBALS["document"] contain the objects.

(and after all that typing :)

-Evan

On Wed, Jul 24, 2002 at 10:21:32PM -0400, Evan said:


> Hey all,
> 
> I'm having a strange problem with objects that I'm hoping someone out there can 
> help me track down. I'll give a run down of the setup here, please note that 
> register_globals is off.
> 
> A page creates two objects.
> 
> $document - this is always a new object and uses the ob_ functions to control 
> the output. ob_start is called with a customer callback that writes the output 
> to a file based on $_SERVER variables.
> 
> $session - this is an object that gets serialized whenever a request finishes 
> and unserialized when the request begins.
> 
> Each object uses register_shutdown_function(array($this, "desconstructor")) to 
> set a hook to clean up after itself which works without problems.
> 
> The following is then set.
> $document->session =& $session;
> $session->document =& $document;
> 
> Everything works fine through out the page all properties of the session can be 
> accessed and set via $session->whatever or $document->session->whatever and vice 
> versa for the $document object.
> 
> The problem arises when the $document->deconstructor function is called. As 
> described above the ob_ callback fires and properly writes the captured output 
> to a file then calls ob_end_clean() to dump the buffer and returns nothing, then 
> right after the deconstructor function is called which does the following:
> include("a header file.php");
> include("the temp file from ob_");
> include("a footer file.php");
> unlink("the temp file from ob_");
> 
> Now this works beautifully, except that some of the object properties get 
> destoryed. For instance since the includes are called from 
> $document->deconstructor it makes sense that $this should reference the document 
> object and that $this->session should reference the session object, but the 
> following happens. In the file I have this:
> 
> $this is a 
> $tihs->session is a session)?>
> 
> Which returns:
> 
> $this is a rj_document
> $this->session is a
> 
> 
> Now I thought that it might be because the session object is destroyed before 
> the document object fires its deconstructor call so when the objects are 
> associated I changed the document line to be:
> $document->session = $session
> But I get the same results.
> 
> 
> Anyone have any insight?
> 
> 
> Thanks,
> Evan
> 
> -- 
> 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




[PHP] Strange problem with objects

2002-07-24 Thread Evan

Hey all,

I'm having a strange problem with objects that I'm hoping someone out there can 
help me track down. I'll give a run down of the setup here, please note that 
register_globals is off.

A page creates two objects.

$document - this is always a new object and uses the ob_ functions to control 
the output. ob_start is called with a customer callback that writes the output 
to a file based on $_SERVER variables.

$session - this is an object that gets serialized whenever a request finishes 
and unserialized when the request begins.

Each object uses register_shutdown_function(array($this, "desconstructor")) to 
set a hook to clean up after itself which works without problems.

The following is then set.
$document->session =& $session;
$session->document =& $document;

Everything works fine through out the page all properties of the session can be 
accessed and set via $session->whatever or $document->session->whatever and vice 
versa for the $document object.

The problem arises when the $document->deconstructor function is called. As 
described above the ob_ callback fires and properly writes the captured output 
to a file then calls ob_end_clean() to dump the buffer and returns nothing, then 
right after the deconstructor function is called which does the following:
include("a header file.php");
include("the temp file from ob_");
include("a footer file.php");
unlink("the temp file from ob_");

Now this works beautifully, except that some of the object properties get 
destoryed. For instance since the includes are called from 
$document->deconstructor it makes sense that $this should reference the document 
object and that $this->session should reference the session object, but the 
following happens. In the file I have this:

$this is a 
$tihs->session is a session)?>

Which returns:

$this is a rj_document
$this->session is a


Now I thought that it might be because the session object is destroyed before 
the document object fires its deconstructor call so when the objects are 
associated I changed the document line to be:
$document->session = $session
But I get the same results.


Anyone have any insight?


Thanks,
Evan

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




[PHP] Re: How do I validate input using php?

2002-07-24 Thread Mike Mannakee

Here's the code I use to validate emails:

function check_email($email)
 {
  global $email;
  $regex="^([a-z0-9_]|\\-|\\.)+@(([a-z0-9_]|\\-)+\\.)+[a-z]{2,4}$";
  return eregi($regex, $email, $trash);
 }

Hope this helps,

Mike


"ØYstein HåLand" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I've tried a function like this:
> function validate() { //
> if ( is_numeric($input1) && is_numeric($input2) && ctype_alpha($input3) &&
> ctype_alpha($input4) )
>  return true;
> }
>
>
> And then I call the function:
>
> if (validate() == false) {
> some action;
> }
>
> My problem is I get the action every time, even though the input is of the
> right type. And, is ctype_alpha() the only way to check for only
alphabetic
> characters?
> And (this started with one question), anyone got a good solution on
> validating email-adresses with php?
>
>



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




RE: [PHP] Re: date

2002-07-24 Thread John Holmes

>   I am not sure it works, since isn't tested, but here we go. It's
pure
> Mysql, and it would be probaly easier, faster, and more readable to do
> with
> PHP mixed. But where's the fun of it? ;-)
> 
> date_field is the name of your date column.
> 
> $sql = "SELECT IF(DAYOFMONTH(date_field) = DAYOFMONTH(CURRENT_DATE),
> 'Today', IF (date_field = DATE_SUB(date_field, INTERVAL 1 DAYS),
> 'Yesterday', date_field)) FROM table"

I don't think you want DAYOFMONTH. Otherwise if today is July 24th, then
a date column with June 24th, or any 24th, will come up as Today.

Something like this will work, though...

SELECT IF(TO_DAYS(CURDATE()) =
TO_DAYS(date_column),'Today',IF(TO_DAYS(CURDATE())-1 =
TO_DAYS(date_column),'Yesterday',date_column)) FROM your_table;

Hope that helps...

---John Holmes...


> Julio Nobrega
> Pode acessar:
> http://www.inerciasensorial.com.br
> 
> 
> "Alexander Ross" <[EMAIL PROTECTED]> escreveu na mensagem
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > I have a column in one of my mysql tables which holds the date &
time
> that
> > the record was inserted.  When I run a query later on I want to
display
> the
> > date, but if the date is today or yesterday I want to display
"today" or
> > "yesterday" instead .. how do i compare to stored date with todays
date?
> > todays date -1?  Thanks
> >
> >
> 
> 
> 
> --
> 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




[PHP] Re: best way to log bad email address'

2002-07-24 Thread Mike Mannakee

You'll have to make sure that your headers include a reply-to email address.
Also set up with your server administrator that the outgoing emails from
your site have a correct sender.  The mail function's return value only
tells you that it made it to the outgoing mail server.  That the server
actually sends it is completely unverified.  You could try setting up an
IMAP function that logs onto the mail server and collects the returned mails
for you, automatically deleting them from your database, but I wouldn't have
that run for at least 24 hours after the mail is sent, to make certain to
catch the returns.

Mike


"Justin French" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi,
>
> what's the best way to log the bad email address' from a mail() loop?
>
> my guess is:
>
>  $log = '';
> $to = '[EMAIL PROTECTED]';
> $subj = 'foo';
> $msg = 'blah';
> $head = 'From: [EMAIL PROTECTED]';
>
> if(!mail($to,$sub,$msg,$head))
> {
> $log .= "{$to}\n";
> }
>
> // write $log to screen, or to a file
> ?>
>
> But I'm interested in people's experience with what mail() returns:
> From the manual:
> "mail() returns TRUE if the mail was successfully accepted for delivery,
> FALSE otherwise."
>
> Is the definition of "accepted for delivery" dependent on each server, or
is
> there are general definition of what it means?
>
> ie, when am I likely to get a returned value of FALSE?
>
>
> Also, I'm on a shared server.  Is there any way I can specify the email
> address that bounces return to with either an ini_set or with an email
> header?
>
> Because my assumption is that there will be email address' that return
TRUE,
> but later bounce.
>
> Can't see what it might be in the php.ini file though.
>
>
> Thanks in advance,
>
> Justin French
>



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




[PHP] datetime field - still a newbie

2002-07-24 Thread Alexander Ross

I have a datetime field in one of my mysql tables...when displaying some of
my records I want to display the date in the aforementioned datetime field,
but if the date is today I want to display "today" instead.  If the date is
yesterday I want it to display that  so I how do I compare the date in
my record to todays date? Thanks

Alex



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




RE: [PHP] Speeding up PHP or MySQL

2002-07-24 Thread John Holmes

> Is there anyways to speed up MySQL queries?  Or showing the results
> through
> PHP? I have several queries that have about 8 left joins or so.. Yes
very
> huge and when you have lots of people using these functions at once it
> really slows down.. Are there any practices that you can think of that
> would
> speed up any sql queries?  I was thinking of using stored procedures,
but
> after a bit of research I found ou= t that MySQL doesn=B9t have that
yet
> so
> that's a no go :(  Or is there a way of storing common query results?
I
> am
> looking for _anything_ that will speed up showing results to large
> queries..

How about an index on your tables?

---John Holmes...


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




RE: [PHP] Trouble with \

2002-07-24 Thread John Holmes

> > Try this function:
> > http://www.php.net/manual/en/function.stripslashes.php
> 
> Oddly enough, as I told John, I did that as well and it doesn't work.

Are the \ there to escape anything, like ' or " or are they just in
there by themselves..as a delimiter or something. If the \ is by itself,
then stripslashes() won't do anything to it. Maybe you should just try

$newtext = str_replace("\","",$old_text);

Without seeing a sample of your file and some more information, all I
can give is "snooty" answers, evidently. 

---John Holmes...


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




RE: [PHP] HTTP_POST_FILES undefined - What happen?

2002-07-24 Thread Dave [Hawk-Systems]

>Thought I turned on register_globals on in the php.ini, my server
>didn't know the HTTP_POST_FILES.
>
>echo $HTTP_POST_FILES[$file]['type'] ;
>
>echo $HTTP_POST_FILES[$file]['name'] ;
>
>echo $HTTP_POST_FILES[$file]['size'] ;
>
>I've always get these messages:
>
>PHP Warning: Undefined variable: HTTP_POST_FILES in
>c:\inetpub\wwwroot\ohabolana\scripts\sary_vaovao.inc on line 4 PHP
>Warning: Undefined variable: HTTP_POST_FILES in
>c:\inetpub\wwwroot\ohabolana\scripts\sary_vaovao.inc on line 5 PHP
>Warning: Undefined variable: HTTP_POST_FILES in
>c:\inetpub\wwwroot\ohabolana\scripts\sary_vaovao.inc on line 6

first, you are uploading the file to this page correct?

perhaps a bit of code showing your file handling?

FYI/

depending on version you can use $_FILES for short

if register globals is on you can refer to the files as the form field name for
your file upload
$upfile[$i]
$upfile_name[$i]
$upfile_type[$i]
$upfile_size[$i]

you may wish to reconsider globals defaulting to on though, (see security
section on file uploads)  also check to see that the file was indeed uploaded...
features.file-upload




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




[PHP] best way to log bad email address'

2002-07-24 Thread Justin French

Hi,

what's the best way to log the bad email address' from a mail() loop?

my guess is:



But I'm interested in people's experience with what mail() returns:
>From the manual:
"mail() returns TRUE if the mail was successfully accepted for delivery,
FALSE otherwise."

Is the definition of "accepted for delivery" dependent on each server, or is
there are general definition of what it means?

ie, when am I likely to get a returned value of FALSE?


Also, I'm on a shared server.  Is there any way I can specify the email
address that bounces return to with either an ini_set or with an email
header?

Because my assumption is that there will be email address' that return TRUE,
but later bounce.

Can't see what it might be in the php.ini file though.


Thanks in advance,

Justin French


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




Re[2]: [PHP] HTTP_POST_FILES undefined - What happen?

2002-07-24 Thread Tom Rogers

Hi,

Thursday, July 25, 2002, 11:15:33 AM, you wrote:
TR> Hi,

TR> Thursday, July 25, 2002, 10:39:08 AM, you wrote:
R>> Hi all,

R>> Thought I turned on register_globals on in the php.ini, my server didn't know the 
HTTP_POST_FILES.

R>> echo $HTTP_POST_FILES[$file]['type'] ;

R>> echo $HTTP_POST_FILES[$file]['name'] ;

R>> echo $HTTP_POST_FILES[$file]['size'] ;

R>> I've always get these messages:

R>> PHP Warning: Undefined variable: HTTP_POST_FILES in 
c:\inetpub\wwwroot\ohabolana\scripts\sary_vaovao.inc on line 4 PHP Warning: Undefined 
variable: HTTP_POST_FILES in
R>> c:\inetpub\wwwroot\ohabolana\scripts\sary_vaovao.inc on line 5 PHP Warning: 
Undefined variable: HTTP_POST_FILES in 
c:\inetpub\wwwroot\ohabolana\scripts\sary_vaovao.inc on line 6 

R>> Any suggestions ?

R>> Ravelomanana Rija
R>> [EMAIL PROTECTED]
R>> BP 1528 Port Vila
R>> Vanuatu

TR> If they are being used in a function you will need to do:
TR> function whatever(){
TR> global $HTTP_POST_VARS;
TR> .
TR> .
TR> .
TR> }

TR> Just a guess :)


TR> -- 
TR> Best regards,
TR> Tom



sorry that should have been
global $HTTP_POST_FILES;

-- 
Best regards,
Tom


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




[PHP] Re: Numbers with leading zero... :: THANK YOU!!

2002-07-24 Thread vins

Thanks so much for the help you guys.
problem sorted out...

:D


"Vins" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi.
>
> I've got this script that needs to take for examle 02 and increase that to
> 03.
> but when i run the script $Num++; it changes 03 to 3;
>
> is there not a function that adds leading zeros onto a string ?
>
>



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




Re: [PHP] HTTP_POST_FILES undefined - What happen?

2002-07-24 Thread Tom Rogers

Hi,

Thursday, July 25, 2002, 10:39:08 AM, you wrote:
R> Hi all,

R> Thought I turned on register_globals on in the php.ini, my server didn't know the 
HTTP_POST_FILES.

R> echo $HTTP_POST_FILES[$file]['type'] ;

R> echo $HTTP_POST_FILES[$file]['name'] ;

R> echo $HTTP_POST_FILES[$file]['size'] ;

R> I've always get these messages:

R> PHP Warning: Undefined variable: HTTP_POST_FILES in 
c:\inetpub\wwwroot\ohabolana\scripts\sary_vaovao.inc on line 4 PHP Warning: Undefined 
variable: HTTP_POST_FILES in
R> c:\inetpub\wwwroot\ohabolana\scripts\sary_vaovao.inc on line 5 PHP Warning: 
Undefined variable: HTTP_POST_FILES in 
c:\inetpub\wwwroot\ohabolana\scripts\sary_vaovao.inc on line 6 

R> Any suggestions ?

R> Ravelomanana Rija
R> [EMAIL PROTECTED]
R> BP 1528 Port Vila
R> Vanuatu

If they are being used in a function you will need to do:
function whatever(){
global $HTTP_POST_VARS;
.
.
.
}

Just a guess :)


-- 
Best regards,
Tom


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




Re: [PHP] Numbers with leading zero...

2002-07-24 Thread Tom Rogers

Hi,

Thursday, July 25, 2002, 10:44:00 AM, you wrote:
v> Hi.

v> I've got this script that needs to take for examle 02 and increase that to
v> 03.
v> but when i run the script $Num++; it changes 03 to 3;

v> is there not a function that adds leading zeros onto a string ?




have a look at the sprintf() function for full info:

sprintf("value = %02d", $value);

-- 
Best regards,
Tom


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




Re: [PHP] Hitting return in a textarea box...

2002-07-24 Thread Tom Rogers

Hi,

Thursday, July 25, 2002, 4:26:15 AM, you wrote:
JL> I'm putting together a message board, and I'm having
JL> problems with hitting the return(enter) key within my
JL> textarea.

JL> I've looked around for a solution, I tried
JL> wrap="hard", wrap="soft" and wrap="vitual" and none of
JL> them worked (should they?  I may have done it wrong?)
JL> and I also tried nohardbreaks and nosoftbreaks, but I
JL> think they may be no longer supported.

JL> Is this a case for regex?  If so, can someone perhaps
JL> point me to an article on how to accomplish this? 
JL> Thanks very much for any help.

JL> Jesse

JL> __ 
JL> Post your ad for free now! http://personals.yahoo.ca


I use wrap="soft" in the textarea input and then to display I use
nl2br(htmlentities($content));

-- 
Best regards,
Tom


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




RE: [PHP] Numbers with leading zero...

2002-07-24 Thread Martin Towell

you could use: printf("%02d", ++$Num);
or if you want to put it back into $Num, use the sprintf() version

-Original Message-
From: vins [mailto:[EMAIL PROTECTED]]
Sent: Thursday, July 25, 2002 10:44 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Numbers with leading zero...


Hi.

I've got this script that needs to take for examle 02 and increase that to
03.
but when i run the script $Num++; it changes 03 to 3;

is there not a function that adds leading zeros onto a string ?



-- 
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




[PHP] Numbers with leading zero...

2002-07-24 Thread vins

Hi.

I've got this script that needs to take for examle 02 and increase that to
03.
but when i run the script $Num++; it changes 03 to 3;

is there not a function that adds leading zeros onto a string ?



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




[PHP] HTTP_POST_FILES undefined - What happen?

2002-07-24 Thread Rija

Hi all,

Thought I turned on register_globals on in the php.ini, my server didn't know the 
HTTP_POST_FILES.

echo $HTTP_POST_FILES[$file]['type'] ;

echo $HTTP_POST_FILES[$file]['name'] ;

echo $HTTP_POST_FILES[$file]['size'] ;

I've always get these messages:

PHP Warning: Undefined variable: HTTP_POST_FILES in 
c:\inetpub\wwwroot\ohabolana\scripts\sary_vaovao.inc on line 4 PHP Warning: Undefined 
variable: HTTP_POST_FILES in c:\inetpub\wwwroot\ohabolana\scripts\sary_vaovao.inc on 
line 5 PHP Warning: Undefined variable: HTTP_POST_FILES in 
c:\inetpub\wwwroot\ohabolana\scripts\sary_vaovao.inc on line 6 

Any suggestions ?

Ravelomanana Rija
[EMAIL PROTECTED]
BP 1528 Port Vila
Vanuatu


Re: [PHP] Re: PHP Security Advisory: Vulnerability in PHP versions 4.2.0

2002-07-24 Thread Rick Widmer

At 10:22 AM 7/24/02 -0400, Scott Fletcher wrote:
>It work very nicely  The whole process take 30 to 45 minutes for just
>one server.  I wonder how does someone did 12 computers  in 10 minutes.
>Cool!

For me the key to upgrading many servers is to compile once then copy the
resulting files to all my other servers.  I also compile Apache + mod_ssl + 
PHP
static into one file so usually all I have to do is copy the httpd file to the
other machines.

The machines need similar CPUs and identical library versions, but that 
isn't too
hard to do.  With Linux it is legal to copy in the new httpd file then 
apachectl restart
to update the server.

Rick


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




Re: [PHP] Image upload into database

2002-07-24 Thread Justin French

You need to look at the differences between your server and the live one.

The only real way to test is to have both you AND another tester (preferably
on a slow computer with 56k connection) to try uploading the SAME IMAGE FILE
to both servers.

This will rule out problems with the data type (eg blob).

Then test with larger images/files.



Likely problems will be:

- the file size is too big, and the PHP script is timing out before it can
finish (check php.ini for differences in script timeouts)

- there is a maximum file size for uploaded files on the server, which is
different to 

- the file isn't too big, but the script is still timing out (check php.ini
for differences in script timeouts)

- the 56k connection (different to your office set-up) means that files
upload way too slow, or get interrupted


If possible you should compare your php.ini to the one of the live server,
and try to match them up, which will help.


Justin French






on 25/07/02 9:43 AM, Jesse Lawrence ([EMAIL PROTECTED]) wrote:

> I've setup an image upload feature on a site, which
> uploads images into a mysql database.
> 
> The uploads are working absolutely as expected on my
> local computer (the server), but when someone else
> tried to upload, only 1/3 of the image was uploaded.
> Could it be a matter of size?  I was originally using
> just a Blob, and have since switched to a Long Blob.
> Any thoughts or comments on this would be greatly
> appreciated. 
> 
> Thanks a bunch,
> 
> Jesse 
> 
> __
> Post your ad for free now! http://personals.yahoo.ca


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




Re: [PHP] Trouble with \

2002-07-24 Thread Justin French

on 25/07/02 8:30 AM, [EMAIL PROTECTED]
([EMAIL PROTECTED]) wrote:

> Anyway, with asides to the snooty "RTFM" reply I got, I thought I'd share.

No, I agree with the RTFM statement.  A simple search for "remove slashes"
on php.net would have resulted in links to all the slashes functions,
including stripslashes().

Then you could have tested it using this function, and posted a more
meaningful message like:

"I have a file in my disk hierarchy which seems to have \'s added to it,
possibly from a form post or something... any ideas how I strip them out?
I've tried doing it with stripslashes() using the following code, but it
isn't working."

Then we could have checked out your code, and offered more help.


In any way, this code should strip slashes out of a file:



Which, incidently, was adapted from a sample script in the file section
(fread I think) of the PHP manual :P


I know a few of us tend to just reply with RTM all the time, but in reality,
it helps you form better questions, and helps you understand your own
problem a little better.  More often than not, a decent sample script is
available for what you want, either in the manual, or in the user
contributed notes... but if you at least look at the manual first, you'll be
more likely to get good responses, because you post better questions like:

"I've tried to stripslashes using the following code, but it aint working...
any ideas?"

... which make it a lot easier to help you.


Justin French


Creative Director
http://Indent.com.au



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




RE: [PHP] Image upload into database

2002-07-24 Thread Brian V Bonini

Just curious why you don't upload the image to a dir and just store the link
in the db?

> -Original Message-
> From: Jesse Lawrence [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, July 24, 2002 7:44 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Image upload into database
>
>
> I've setup an image upload feature on a site, which
> uploads images into a mysql database.
>
> The uploads are working absolutely as expected on my
> local computer (the server), but when someone else
> tried to upload, only 1/3 of the image was uploaded.
> Could it be a matter of size?  I was originally using
> just a Blob, and have since switched to a Long Blob.
> Any thoughts or comments on this would be greatly
> appreciated.
>
> Thanks a bunch,
>
> Jesse
>
> __
> Post your ad for free now! http://personals.yahoo.ca
>
> --
> 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




Re: [PHP] Image upload into database

2002-07-24 Thread Tyler Longren

Are you trying to upload the same image as you did at home?  If so,
size isn't the problem if you can do it from home.  It might be a
timeout issue.  There might be something in php.ini you can set for
timeout.  You can specify the max filesize to upload in php.ini also.

Good luck,
Tyler


On Wed, 24 Jul 2002 19:43:37 -0400 (EDT)
Jesse Lawrence <[EMAIL PROTECTED]> wrote:

> I've setup an image upload feature on a site, which
> uploads images into a mysql database.
> 
> The uploads are working absolutely as expected on my
> local computer (the server), but when someone else
> tried to upload, only 1/3 of the image was uploaded. 
> Could it be a matter of size?  I was originally using
> just a Blob, and have since switched to a Long Blob.
> Any thoughts or comments on this would be greatly
> appreciated. 
> 
> Thanks a bunch,
> 
> Jesse 
> 
> __
> 
> Post your ad for free now! http://personals.yahoo.ca
> 
> -- 
> 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




RE: [PHP] RE: create object from variable class.

2002-07-24 Thread Martin Towell

This should work
$object = new $classname;

Martin

-Original Message-
From: Michiel ten Hagen [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 24, 2002 11:17 PM
To: 'Mathieu Dumoulin'
Cc: [EMAIL PROTECTED]
Subject: [PHP] RE: create object from variable class.


Thx for quick reply,

If I use the following:
$object = new {classname};

I get this a parse error:
Parse error: parse error, expecting `T_STRING' or `T_VARIABLE'
or `'$'' in
/home/sites/projects.virtuosys.nl/web/cm/includes/class_crm.inc.php on
line 29

>From that I conclude that with this method its not possible to create an
object from a variable class name

Michiel ten Hagen
[EMAIL PROTECTED]
06-54673863



-Oorspronkelijk bericht-
Van: Mathieu Dumoulin [mailto:[EMAIL PROTECTED]] 
Verzonden: Wednesday, July 24, 2002 3:11 PM
Aan: [EMAIL PROTECTED]
Onderwerp: Re: create object from variable class.


Simple, you made an error here
You are telling the new operator to look into a variable to get the
classname, to specify the class name as a string do this:

$object = new {$classname};

InsaneCoder

Ps: I never tried this, but I think it is actually going to work, you
got nthing to lose anyway I guess, takes two seconds to try.

"Karel De Groot" <[EMAIL PROTECTED]> wrote in message
news:<[EMAIL PROTECTED]>...
> Is it possible to create an object from a clas which name is in a
> variable.
> 
> Example: (doesn't work)
> $object = new ${$classname};
> 
> 
> 
> 



-- 
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




Re: [PHP] Re: PHP 4.2.2 install woe: cannot stat libs/libphp.so

2002-07-24 Thread David Robley

In article <[EMAIL PROTECTED]>, 
[EMAIL PROTECTED] says...
> On Wed, 2002-07-24 at 08:29, Ian Ball wrote:
> > Assuming you are installing from your php-4.2.2 directory, it would appear 
> > the libphp4.so hasn't actually been made, which would point to a possible 
> > error in the configuration parameters.  I am also assuming your php 4.2.1 
> > made OK which would mean all necessary libraries etc are available on your 
> > system.  What are you using for the configure?  On my system it was
> > ./configure --with-mysql --with-apxs=/usr/local/apache/bin/apxs
> > I did have ldap in there too, but for most people this is not necessary.  
> 
> Here is my configure line. Yes, my prev php 4.2.1 made and install fine
> with the same configure line. I did exactly the same steps as when I
> install 4.2.1
> 
> /configure --with-mysql --enable-track-var --disable-debug
> --prefix=/usr/local/apache/php
> --with-config-file-path=/usr/local/apache/lib
> --with-apxs=/usr/local/apache/bin/apxs --with-gd --with-zlib
> 
> > 
> > If a fresh run from the start fails, then without further information, my 
> > best suggestion is to completely delete the php-4.2.2 directory and ocntents, 
> > and start again with the tar -zxf php-4.2.2.whatever, ./configure..
> 
> I did that already, deleting the php-4.2.2 and start with un-tar the
> download. Many times. But still no luck.
> 
> Thanks.
> Rdb

OK - after you do 'make' is there a file libphp4.so in the lib directory 
under where you unpacked the install tarball? If not, something has 
apparently gone wrong with the make process or the configure; you might 
check (I think it is) config.log in the top of the install directory for 
any clues.

I'm not sure, but it might be --enable-track-vars (unless that is a typo); 
check with configure --help | grep track

Cheers 
-- 
David Robley
Temporary Kiwi!

Quod subigo farinam

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




[PHP] Image upload into database

2002-07-24 Thread Jesse Lawrence

I've setup an image upload feature on a site, which
uploads images into a mysql database.

The uploads are working absolutely as expected on my
local computer (the server), but when someone else
tried to upload, only 1/3 of the image was uploaded. 
Could it be a matter of size?  I was originally using
just a Blob, and have since switched to a Long Blob.
Any thoughts or comments on this would be greatly
appreciated. 

Thanks a bunch,

Jesse 

__ 
Post your ad for free now! http://personals.yahoo.ca

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




Re: [PHP] How do I validate input using php?

2002-07-24 Thread JSheble

you're returning a literal true if the condition matches, and nothing if it 
fails...

function validate() { //
 if ( is_numeric($input1) && is_numeric($input2) && 
ctype_alpha($input3) &&
 ctype_alpha($input4) )
 return true;
 else
 return false;
}

At 12:38 AM 7/25/2002 +0200, Øystein Håland wrote:
>I've tried a function like this:
>function validate() { //
>if ( is_numeric($input1) && is_numeric($input2) && ctype_alpha($input3) &&
>ctype_alpha($input4) )
>  return true;
>}
>
>
>And then I call the function:
>
>if (validate() == false) {
> some action;
>}
>
>My problem is I get the action every time, even though the input is of the
>right type. And, is ctype_alpha() the only way to check for only alphabetic
>characters?
>And (this started with one question), anyone got a good solution on
>validating email-adresses with php?
>
>
>
>--
>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




[PHP] How do I validate input using php?

2002-07-24 Thread Øystein Håland

I've tried a function like this:
function validate() { //
if ( is_numeric($input1) && is_numeric($input2) && ctype_alpha($input3) &&
ctype_alpha($input4) )
 return true;
}


And then I call the function:

if (validate() == false) {
some action;
}

My problem is I get the action every time, even though the input is of the
right type. And, is ctype_alpha() the only way to check for only alphabetic
characters?
And (this started with one question), anyone got a good solution on
validating email-adresses with php?



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




RE: [PHP] Trouble with \

2002-07-24 Thread skeller

> If the "\" are showing up in form posted data just do this:
>
> $newtext = stripslashes($oldtext);

That's what I'm doing now before they're written to the file.

> The slashes are put before any single or double quote by a
> nifty little php feature called "magic quotes". By escaping
> quotes in form posted data you greatly reduce the risk of
> sql injections and other types of sneaky stuff.

Right. And what I was also trying to do was keep users from posting
characters that would mess up the data being written to the page. It's for a
limited audience, but you never know who's going to stumble onto it.

Thanks for that.

It certainly looks like nuking them preemptively is the way to go.


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




RE: [PHP] Trouble with \

2002-07-24 Thread skeller

> It's extremely important as to where you put the function within your
> script.

Understood, and as I said before, I'm fairly new to PHP, so I'm bound to
make the boneheaded mistakes. But I did try and solve it myself before
begging for help :)

Basically, the user enteres some text into a form, posted to a script that
catches the data and appends their name and text to the end of a file. Then,
on another function on another page, I'm reading that line in and
regurgitating it onto a page to generate a list of the last 20 posters and
their comment.

$myLine = fgets($myFile,255);
print("$myLine \n");

That's it. I figured between those two lines would be something like

$myLine = (stripslashes($myLine));

Which I tried, in several variations depending on which page I was looking
at for help. I also tried using strtr instead. Neither of those would remove
the slashes before the line was printed to the page. I even tried using a
new variable name, as in

$fauxText = (stripslashes($myLine));

in case PHP had some kind of quirk about variables tweaking themselves.

The file that's being read is plain text, btw. So if you want to try and
duplicate, just read from a text file.

But, like I said, using stripslashes *before* writing to the file fixes it
regardless.


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




[PHP] Php and Apache

2002-07-24 Thread Varsha Agarwal

Hi,
I have istalled php from the red hat cd at the time i
installed red hat itself. I downloaded apache and
installed it. Can anyone tell me how to configure php
on apache server? I mean what do I do next to run php
scripts? I am totally new to all this. Please help.
-Varsha

__
Do You Yahoo!?
Yahoo! Health - Feel better, live better
http://health.yahoo.com

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




Re: [PHP] Trouble with \

2002-07-24 Thread Tech Support

If the "\" are showing up in form posted data just do this:

$newtext = stripslashes($oldtext);

The slashes are put before any single or double quote by a nifty little php
feature called "magic quotes". By escaping quotes in form posted data you
greatly reduce the risk of sql injections and other types of sneaky stuff.

Jim Grill
Support
Web-1 Hosting
http://www.web-1hosting.net
- Original Message -
From: <[EMAIL PROTECTED]>
To: "PHP List (E-mail)" <[EMAIL PROTECTED]>
Sent: Wednesday, July 24, 2002 5:30 PM
Subject: [PHP] Trouble with \


> Anyway, with asides to the snooty "RTFM" reply I got, I thought I'd share.
>
> Turns out the \'s that I was having problems getting rid of were written
> there from a form post that was used to collect the data. I still haven't
> found a way to remove them after reading them from the file, but I did
> manage to change them before they were posted by doing a strtr.
>
> If someone has a way to clearn \'s out of a string brought in from a file,
> I'm all ears, but it's working now.
>
>
>
> --
> The Health TV Channel, Inc.
> (a non - profit organization)
> 3820 Lake Otis Pkwy.
> Anchorage, AK 99508
> 907.770.6200 ext.220
> 907.336.6205 (fax)
> Web: www.healthtvchannel.org
>
>
> --
> 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




Re: [PHP] Trouble with \

2002-07-24 Thread Richard Baskett

It's extremely important as to where you put the function within your
script.  I know it's basic and goes without saying, but hey a lot of
mistakes that we make.. Especially late at night, are ones that embarrass us
after we find out the answer :)  I guess I would have to find out exactly
what you are doing to know what the problem is.

Cheers!

Rick

"The future does not belong to those who are content with today, apathetic
toward common problems and their fellow man alike, timid and fearful in the
face of bold projects and new ideas. Rather, it will belong to those who can
blend passion, reason and courage in a personal commitment to the great
enterprises and ideals of American society." - Robert F. Kennedy

> From: <[EMAIL PROTECTED]>
> Date: Wed, 24 Jul 2002 14:48:07 -0800
> To: "PHP List \(E-mail\)" <[EMAIL PROTECTED]>
> Subject: RE: [PHP] Trouble with \
> 
>> Try this function:
>> http://www.php.net/manual/en/function.stripslashes.php
> 
> Oddly enough, as I told John, I did that as well and it doesn't work.
> 
> -- 
> 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




[PHP] Re: date

2002-07-24 Thread Julio Nobrega

  I am not sure it works, since isn't tested, but here we go. It's pure
Mysql, and it would be probaly easier, faster, and more readable to do with
PHP mixed. But where's the fun of it? ;-)

date_field is the name of your date column.

$sql = "SELECT IF(DAYOFMONTH(date_field) = DAYOFMONTH(CURRENT_DATE),
'Today', IF (date_field = DATE_SUB(date_field, INTERVAL 1 DAYS),
'Yesterday', date_field)) FROM table"

If the date isn't today or yesterday, you will get the date_field contents.

--
Julio Nobrega
Pode acessar:
http://www.inerciasensorial.com.br


"Alexander Ross" <[EMAIL PROTECTED]> escreveu na mensagem
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I have a column in one of my mysql tables which holds the date & time that
> the record was inserted.  When I run a query later on I want to display
the
> date, but if the date is today or yesterday I want to display "today" or
> "yesterday" instead .. how do i compare to stored date with todays date?
> todays date -1?  Thanks
>
>



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




RE: [PHP] Trouble with \

2002-07-24 Thread skeller

> Try this function:
> http://www.php.net/manual/en/function.stripslashes.php

Oddly enough, as I told John, I did that as well and it doesn't work. 

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




[PHP] Re: date

2002-07-24 Thread Joel Colombo

i use seconds in place of time alot.
using the PHP time() function and Date() functions u can do a lot.

instead of a time / date TIMESTAMP field type i use an INT type
i then call the $the_time = Time(); and insert that.
then u can manipulate the hell outta that INT value from the DB with php's
Date() function.

allows u to compare lengths between times and perform much simplier numeric
math on the values
rather then the 'calender' math. somethings can be trickier like Leaps and
stuff, but i found more pors for most of my application needs.

Same data sizes : INT or TIMESTAMP in mysql are 4 bytes
and they both give u down to the second.

then to find out today, u just run Date('m-d-Y');
compare those vals to Date('m-d-Y', $DB_VALUE);

there u go it is today or it isnt ! out put data accordingly.

Joel



"Alexander Ross" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I have a column in one of my mysql tables which holds the date & time that
> the record was inserted.  When I run a query later on I want to display
the
> date, but if the date is today or yesterday I want to display "today" or
> "yesterday" instead .. how do i compare to stored date with todays date?
> todays date -1?  Thanks
>
>



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




[PHP] Re: Speeding up PHP or MySQL

2002-07-24 Thread Julio Nobrega

  Mysql 4 can cache queries. You can try using temporary tables, so you can
break up joins.

  Also, perhaps making a "rawdata" table placeholder. Put a timestamp field
on your columns. Make the query and store somewhere the query itself, the
results and the time they were last modified. Then when the next query
comes, compare if one already exists on the database. If so, only grab the
"rawdata", ie, the previous results.

  And read Mysql's manual section about optimization if you haven't done so
already, since it has important tips.

--
Julio Nobrega
Pode acessar:
http://www.inerciasensorial.com.br


"Richard Baskett" <[EMAIL PROTECTED]> escreveu na mensagem
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Is there anyways to speed up MySQL queries?  Or showing the results
through
> PHP? I have several queries that have about 8 left joins or so.. Yes very
> huge and when you have lots of people using these functions at once it
> really slows down.. Are there any practices that you can think of that
would
> speed up any sql queries?  I was thinking of using stored procedures, but
> after a bit of research I found ou= t that MySQL doesn=B9t have that yet
so
> that's a no go :(  Or is there a way of storing common query results?  I
am
> looking for _anything_ that will speed up showing results to large
queries..
>
> I do use the ob_gzhandler and that helps a bit... Help! :)
>
> Cheers and Thanks!
>
> Rick
>
> "Let us live as people who are prepared to die, and die as people who are
> prepared to live." - James S. Stewart
>
>



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




Re: [PHP] Trouble with \

2002-07-24 Thread Richard Baskett

Try this function:

http://www.php.net/manual/en/function.stripslashes.php

Rick

"And God shall wipe away all tears from their eyes; and there shall be no
more death, neither sorrow, nor crying, neither shall there be any more
pain: for the former things are passed away." - Revelation 21:4


> From: <[EMAIL PROTECTED]>
> Date: Wed, 24 Jul 2002 14:30:08 -0800
> To: "PHP List \(E-mail\)" <[EMAIL PROTECTED]>
> Subject: [PHP] Trouble with \
> 
> Anyway, with asides to the snooty "RTFM" reply I got, I thought I'd share.
> 
> Turns out the \'s that I was having problems getting rid of were written
> there from a form post that was used to collect the data. I still haven't
> found a way to remove them after reading them from the file, but I did
> manage to change them before they were posted by doing a strtr.
> 
> If someone has a way to clearn \'s out of a string brought in from a file,
> I'm all ears, but it's working now.
> 
> 
> 
> --
> The Health TV Channel, Inc.
> (a non - profit organization)
> 3820 Lake Otis Pkwy.
> Anchorage, AK 99508
> 907.770.6200 ext.220
> 907.336.6205 (fax)
> Web: www.healthtvchannel.org
> 
> 
> -- 
> 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




[PHP] Speeding up PHP or MySQL

2002-07-24 Thread Richard Baskett

Is there anyways to speed up MySQL queries?  Or showing the results through
PHP? I have several queries that have about 8 left joins or so.. Yes very
huge and when you have lots of people using these functions at once it
really slows down.. Are there any practices that you can think of that would
speed up any sql queries?  I was thinking of using stored procedures, but
after a bit of research I found ou= t that MySQL doesn=B9t have that yet so
that's a no go :(  Or is there a way of storing common query results?  I am
looking for _anything_ that will speed up showing results to large queries..

I do use the ob_gzhandler and that helps a bit... Help! :)

Cheers and Thanks!

Rick

"Let us live as people who are prepared to die, and die as people who are
prepared to live." - James S. Stewart



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




[PHP] Trouble with \

2002-07-24 Thread skeller

Anyway, with asides to the snooty "RTFM" reply I got, I thought I'd share.

Turns out the \'s that I was having problems getting rid of were written
there from a form post that was used to collect the data. I still haven't
found a way to remove them after reading them from the file, but I did
manage to change them before they were posted by doing a strtr.

If someone has a way to clearn \'s out of a string brought in from a file,
I'm all ears, but it's working now.



--
The Health TV Channel, Inc.
(a non - profit organization)
3820 Lake Otis Pkwy.
Anchorage, AK 99508
907.770.6200 ext.220
907.336.6205 (fax)
Web: www.healthtvchannel.org


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




Re: [PHP] Banner Ad Serving...

2002-07-24 Thread Jeff Bearer

You can also checkout OASIS

http://oasis.sourceforge.net/

It's pretty good software, but i'm unable to use it here because it
doesn't have as man features as OAS from RealMedia which my manager is
used to.

http://www.realmedia.com

It's expensive and doesn't really integrate into PHP. but it's very
indepth.


On Tue, 2002-07-23 at 23:47, Dave at Sinewaves.net wrote:
> Is there any way of automatically adding a certain bit of code to every page
> on a web server (or within a given directory)?
> 
> As in, is there any kind of Apache-specific PHP stuff that will add a banner
> ad or copyright notice to pages (without editing the actual pages themselves
> and without changing their file names)?  I've looked around a bit, and I
> can't seem to brainstorm how it could be done.
> 
> Any help will be greatly appreciated (with good karma to boot). :)
> 
> Dave
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
-- 
Jeff Bearer, RHCE
Webmaster, PittsburghLIVE.com
2002 EPpy Award Winner, Best Newspaper Website


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




[PHP] Re: need some help on stratagy... (php/mysql/javascript)

2002-07-24 Thread Richard Lynch

>..and how poor would the performance be if there were 813 shots in the
>movie?  Thanks for your help

How fast/big is the surfer's computer?

It's the work on THEIR side that matters.

PHP can spew out 813 shots pretty quickly.

For that matter, if the movie itself is static, you can use PHP to just
prepare the 813 shots "off-line" and paste it in.

How fast will JavaScript handle the 813-element array is entirely up to the
browser/JavaScript computer, not your web-server or PHP.

-- 
Like Music?  http://l-i-e.com/artists.htm
I'm looking for a PRO QUALITY two-input sound card supported by Linux (any
major distro).  Need to record live events (mixed already) to stereo
CD-quality.  Soundcard Recommendations?
Software to handle the recording? Don't need fancy mixer stuff.  Zero (0)
post-production time.  Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo
audio-to-disk.

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




[PHP] Re: Free WEB Hosting with PHP and MySQL support

2002-07-24 Thread crimix

As I written to zac, I tried avoid this problem with Dns2Go but the 
Client application send the Ip of my router and not that of my computer.

Tiz

Wm wrote:
> If you want to continue to host it yourself, and simply want a stable
> address, try this: http://www.dynip.com/.  I've used it for FTP serving
> before, and it works very well.
> 
> Wm
> 
> "Crimix" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> 
>>Unfortunatelly I changed my ADLS setting from IP static to IP dynamic
>>and now nobody, me too, can access to my data.
>>My question is if exist a Free WEB Server where I can place my data
>>using PHP and MySQL support?
>>Thank you and have a nice day
>>
>>Tiziano Crimella - Switzerland
>>
> 
> 
> 



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




[PHP] Re: Free WEB Hosting with PHP and MySQL support

2002-07-24 Thread Wm

If you want to continue to host it yourself, and simply want a stable
address, try this: http://www.dynip.com/.  I've used it for FTP serving
before, and it works very well.

Wm

"Crimix" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Unfortunatelly I changed my ADLS setting from IP static to IP dynamic
> and now nobody, me too, can access to my data.
> My question is if exist a Free WEB Server where I can place my data
> using PHP and MySQL support?
> Thank you and have a nice day
>
> Tiziano Crimella - Switzerland
>



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




Re: [PHP] Free WEB Hosting with PHP and MySQL support

2002-07-24 Thread Zac Hillier

easyDNS.com provide a dynamic dns solution to your problem

Zac

- Original Message - 
From: "crimix" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, July 24, 2002 10:03 PM
Subject: [PHP] Free WEB Hosting with PHP and MySQL support


> Unfortunatelly I changed my ADLS setting from IP static to IP dynamic 
> and now nobody, me too, can access to my data.
> My question is if exist a Free WEB Server where I can place my data 
> using PHP and MySQL support?
> Thank you and have a nice day
> 
> Tiziano Crimella - Switzerland
> 
> 
> -- 
> 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




[PHP] Free WEB Hosting with PHP and MySQL support

2002-07-24 Thread crimix

Unfortunatelly I changed my ADLS setting from IP static to IP dynamic 
and now nobody, me too, can access to my data.
My question is if exist a Free WEB Server where I can place my data 
using PHP and MySQL support?
Thank you and have a nice day

Tiziano Crimella - Switzerland


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




Re: [PHP] Removing \ From a String?

2002-07-24 Thread 1LT John W. Holmes

RTM. stripslashes()

---John Holmes...

- Original Message - 
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, July 24, 2002 5:21 PM
Subject: [PHP] Removing \ From a String? 


> I'm trying to remove all \'s from a string before printing it, but strtr
> still treats it as an escape character. How do I remove them? Anyone?
> 
> --
> The Health TV Channel, Inc.
> (a non - profit organization)
> 3820 Lake Otis Pkwy.
> Anchorage, AK 99508
> 907.770.6200 ext.220
> 907.336.6205 (fax)
> Web: www.healthtvchannel.org
> 
> 
> -- 
> 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




[PHP] Removing \ From a String?

2002-07-24 Thread skeller

I'm trying to remove all \'s from a string before printing it, but strtr
still treats it as an escape character. How do I remove them? Anyone?

--
The Health TV Channel, Inc.
(a non - profit organization)
3820 Lake Otis Pkwy.
Anchorage, AK 99508
907.770.6200 ext.220
907.336.6205 (fax)
Web: www.healthtvchannel.org


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




Re: [PHP] Help with msql_fetch_array()

2002-07-24 Thread Kevin Stone

That should definitely be working.  Only thing I can think of is that you're
database name isn't correct.  You're certain "news" is the full name of the
database.. I mean it's not "news_com" or something like that?  The $link
must be valid becuase the script isn't ending with "Couldn't make
connection".  So that just leaves the mysql_select_db() function.  And the
only thing that will make that function return FALSE is if it can't find the
database name for that user on the specified server.
-Kevin

- Original Message -
From: "Matthew Bielecki" <[EMAIL PROTECTED]>
To: "PHPCoder" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Cc: "php-general" <[EMAIL PROTECTED]>
Sent: Wednesday, July 24, 2002 2:07 PM
Subject: Re: [PHP] Help with msql_fetch_array()


> Well I think you were correct about not connecting to the db, but I don't
> understand why.  I wrote another little script just to test the
> connection.
>
> 
> $link = mysql_connect("servername","username","password")
>   or die("Couldn't make connection.");
> $diditwork = mysql_select_db("news", $link);
>
> if ($diditwork <> FALSE)
>{
>   echo "got the db..yea!";
>   echo $link;
>}
>else
>{
>   echo "didnt get db...bo";
>   echo $link;
>}
> ?>
>
> This returns "didnt get db...booResource id #1
>
> I don't understand how I can get a resource ID but then not be able to use
> the "news" database.  Like I described earlier, this happens with my other
> db as well.  I can connect to the db through the console or any other
> client I have on the physical server and do whatever I want with the db's,
> I'm just having problems with php.
>
> Thanks again for your help!!
>
>
>
>
>
>
>
>
>
> PHPCoder <[EMAIL PROTECTED]>
> 07/24/02 01:50 PM
>
>
> To: Matthew Bielecki <[EMAIL PROTECTED]>
> cc: php-general <[EMAIL PROTECTED]>
> Subject:Re: [PHP] Help with msql_fetch_array()
>
>
> I can almost guarantee that it's not the second line that is "failing",
> the problem here is that $result is not containing naything, and that is
> normally due to the fact that you are not connecting to the db, or the
> table "tablename" is not there.
>
> I use the following format as my "standard" MySQL connect and query
> snippet:
>
> $link = @mysql_connect("localhost",$username,$password) or die ('Could
> not connect!'); //@ suppresses the default error message generated by
> this function and the "or die()" bit kills the script right then and
> there should it not be able to connect.
> mysql_select_db("YOUR_DB_NAME",$link);
> $sql = "select * from your_table_name";
> if ( $result = mysql_query($sql)) {  // checks to see if $result
> contains anything before it even tries to fetch an associative array
> from it.
>  $row = mysql_fetch_assoc($result);
> } else {
> echo "Empty result set!";
>
> Note also that I use mysql_fetch_assoc and NOT mysql_fecth_array, as 9
> out of 10 times, you don't need the array element id's that is returned
> by mysql_fetch_array.
>
> Matthew Bielecki wrote:
>
> >I have a couple of scripts that fail with the error of:
> >Warning: mysql_fetch_array(): supplied argument is not a valid MySQL
> result
> >resource in...
> >
> >I'm new to both SQL and PHP and I'm wondering if I have some setting
> >turned off or what.
> >
> >Here's the piece of code that is failing (the second line fails):
> >
> >$result = mysql_db_query($dbname, "SELECT * FROM tablename ORDER BY id");
> >$row = mysql_fetch_array($result);
> >
> >
> >Thanks for your help in advance!!
> >
>
>
>
>
>


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




[PHP] date

2002-07-24 Thread Alexander Ross

I have a column in one of my mysql tables which holds the date & time that
the record was inserted.  When I run a query later on I want to display the
date, but if the date is today or yesterday I want to display "today" or
"yesterday" instead .. how do i compare to stored date with todays date?
todays date -1?  Thanks



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




Re: [PHP] Best template class

2002-07-24 Thread Hans Lellelid

I would recommend Smarty (http://smarty.php.net).  Smarty is unique (?)
in that it compiles templates into PHP code -- making it one of the
faster templating engines out there.

I use Smarty & love it.

Cheers,
Hans

On Wed, 2002-07-24 at 15:02, Remy Dufour wrote:
> Hi,
> Im currently working with phplib template and im wondering if PEAR template class 
>can give me more...
> Anyone got an idea  ?
> 
> Rémy




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




[PHP] socket_set_block(); - question

2002-07-24 Thread Micha

Hi,

I found the function socket_set_block(); in ext/sockets/sockets.c (the
function is not documented) and I tried to use it but it seems to
doesn't take effect...
Why doesn't this function work ? Am I doing something wrong ?

Here is my code:

  function sockRead($length = 1) {
  socket_set_block($this->IcqSocket);
  return @socket_read($this->IcqSocket, $length,
PHP_BINARY_READ);
  socket_set_nonblock($this->IcqSocket);
  }


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




RE: [PHP] Running ./configure multiple times

2002-07-24 Thread Matt Schroebel

> From: Scott Fletcher [mailto:[EMAIL PROTECTED]] 
> Sent: Wednesday, July 24, 2002 2:53 PM
> Subject: Re: [PHP] Running ./configure multiple times
> 
> Yes, it is pretty safe to run ./configure more than once.  
> The 1st time, it
> create the config.cache and so on.  The 2nd time, it use the 
> config.cache
> and other stuffs instead of starting from scratch.  To redo 
> everything from  scratch.  I believe one of those config.* files need to be 
> removed so you  can start again from scratch, not sure which files that need 
> to be delete.

I always 
rm config.cache 
before rebuilding with new options so the configure script will pick up the right 
libraries and new options.

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




[PHP] Re: Windows installation help.

2002-07-24 Thread Nadrew

(This was from an email sent to Gabor, and the site said this address was for help)

>This is not a definition of the $blah variable. $blah = 1; would be a definition.


I've never had any problems using just $blah; before, it never errored on me once, is 
there any reason it does this? (by the way the version I use on Nadrew.com is 4.2.1 
and it works fine.)
-Nadrew



Re: [PHP] Help with msql_fetch_array()

2002-07-24 Thread Matthew Bielecki

Well I think you were correct about not connecting to the db, but I don't 
understand why.  I wrote another little script just to test the 
connection.

 FALSE)
   {
  echo "got the db..yea!";
  echo $link;
   }
   else
   {
  echo "didnt get db...bo";
  echo $link;
   }
?>

This returns "didnt get db...booResource id #1

I don't understand how I can get a resource ID but then not be able to use 
the "news" database.  Like I described earlier, this happens with my other 
db as well.  I can connect to the db through the console or any other 
client I have on the physical server and do whatever I want with the db's, 
I'm just having problems with php.

Thanks again for your help!!









PHPCoder <[EMAIL PROTECTED]>
07/24/02 01:50 PM

 
To: Matthew Bielecki <[EMAIL PROTECTED]>
cc: php-general <[EMAIL PROTECTED]>
Subject:Re: [PHP] Help with msql_fetch_array()


I can almost guarantee that it's not the second line that is "failing", 
the problem here is that $result is not containing naything, and that is 
normally due to the fact that you are not connecting to the db, or the 
table "tablename" is not there.

I use the following format as my "standard" MySQL connect and query 
snippet:

$link = @mysql_connect("localhost",$username,$password) or die ('Could 
not connect!'); //@ suppresses the default error message generated by 
this function and the "or die()" bit kills the script right then and 
there should it not be able to connect.
mysql_select_db("YOUR_DB_NAME",$link);
$sql = "select * from your_table_name";
if ( $result = mysql_query($sql)) {  // checks to see if $result 
contains anything before it even tries to fetch an associative array 
from it.
 $row = mysql_fetch_assoc($result);
} else {
echo "Empty result set!";

Note also that I use mysql_fetch_assoc and NOT mysql_fecth_array, as 9 
out of 10 times, you don't need the array element id's that is returned 
by mysql_fetch_array.

Matthew Bielecki wrote:

>I have a couple of scripts that fail with the error of:
>Warning: mysql_fetch_array(): supplied argument is not a valid MySQL 
result 
>resource in...
>
>I'm new to both SQL and PHP and I'm wondering if I have some setting 
>turned off or what.
>
>Here's the piece of code that is failing (the second line fails):
>
>$result = mysql_db_query($dbname, "SELECT * FROM tablename ORDER BY id");
>$row = mysql_fetch_array($result);
>
>
>Thanks for your help in advance!!
>







Re: [PHP] File upload memory usage.

2002-07-24 Thread Reid Sutherland

Jason Wong wrote:

> Apparently that is how it will work in a _future_ version of PHP. But for now 
> it's all stuffed in RAM until the complete file is received.

That's crazy.  Maybe I don't understand enough of how PHP deals with 
various web servers and maybe that's why this is the way it is.  But 
man... the way it's done is _very_ silly.

Anyway, thanks for the update Jason.

-reid






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




Re: [PHP] File upload memory usage.

2002-07-24 Thread Jason Wong

On Wednesday 24 July 2002 21:48, Reid Sutherland wrote:
> Hi,
>
> I'm currently locked in a battle with PHP and file uploads.  I've
> searched the list to no avail.  I actually found a guy with the same
> problem who ended up using perl to make this work.  I'm trying to avoid
> that.
>
> The problem is, I'm dealing with huge POST uploads (100+ mb).  And
> everytime you upload a file it stores it in RAM and then dumps the file
> to the drive.  Is there any way around this?  This is extremely
> dangerous.  Since this customer may have multiple people uploading at
> the same time, it could result in a massive memory hit over a long
> period of time.
>
> Now I figured PHP would pipe the POST stream into a temporary file
> instead of holding it in RAM.  This is how it should work right?

Apparently that is how it will work in a _future_ version of PHP. But for now 
it's all stuffed in RAM until the complete file is received.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
Yow!  Did something bad happen or am I in a drive-in movie??
*/


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




Re: [PHP] Re: PHP Security Advisory: Vulnerability in PHP versions 4.2.0

2002-07-24 Thread Jason Wong

On Wednesday 24 July 2002 22:22, Scott Fletcher wrote:
> It work very nicely  The whole process take 30 to 45 minutes for just
> one server.  

You've got a slow computer and/or you type too slow ;-)

> I wonder how does someone did 12 computers  in 10 minutes.
> Cool!

For me it was a case of 'typing' in 6 commands:

1) download php
2) untar it
3) cd
4) configure
5) make
6) make install

Actually I just copy and pasted those commands which took me all of 5 seconds 
to do. So unless you count the download and compilation time,  12 systems in 
10 minutes is in the ballpark.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
Yow!  I just went below the poverty line!
*/


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




Re: [PHP] Running ./configure multiple times

2002-07-24 Thread Jason Wong

On Wednesday 24 July 2002 23:41, Chris Garaffa wrote:
> Well my RedHat system got hosed, so I reinstalled everything. I'm back to
> installing PHP now, and I'm wondering if it's safe for me to run
> ./configure multiple times. Here's the situation:
> I want to compile with gd support, and pdflib, and a bunch of other
> options. Instead of running a whole huge 5 line ./configure, can I run one
> at a time to make sure they all work, then run the whole thing?
> Also, just noticed this: I have gd installed, and libgd.so in /usr/lib, so
> I tried ./configure --with-apxs --with-gd=/usr/lib/ (also tried without the
> trailing /), but it gives: configure: error: Unable to find libgd.(a|so)
> anywhere under /usr/lib/
> What gives?

Use:  --with-gd=/usr

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
There can be no daily democracy without daily citizenship.
-- Ralph Nader
*/


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




Re: [PHP] Help with msql_fetch_array()

2002-07-24 Thread Jason Wong

On Thursday 25 July 2002 00:34, Matthew Bielecki wrote:
> I have a couple of scripts that fail with the error of:
> Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result
> resource in...
>
> I'm new to both SQL and PHP and I'm wondering if I have some setting
> turned off or what.
>
> Here's the piece of code that is failing (the second line fails):
>
> $result = mysql_db_query($dbname, "SELECT * FROM tablename ORDER BY id");
> $row = mysql_fetch_array($result);

It's a very good idea to add some error checking code it'll save you a lot of 
grief. See examples in manual for details.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
"Nine years of ballet, asshole."
-- Shelly Long, to the bad guy after making a jump over a gorge that he
   couldn't quite, in "Outrageous Fortune"
*/


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




[PHP] Best template class

2002-07-24 Thread Remy Dufour

Hi,
Im currently working with phplib template and im wondering if PEAR template class can 
give me more...
Anyone got an idea  ?

Rémy



Re: [PHP] Running ./configure multiple times

2002-07-24 Thread Scott Fletcher

Yes, it is pretty safe to run ./configure more than once.  The 1st time, it
create the config.cache and so on.  The 2nd time, it use the config.cache
and other stuffs instead of starting from scratch.  To redo everything from
scratch.  I believe one of those config.* files need to be removed so you
can start again from scratch, not sure which files that need to be delete.
But don't delete the original file, config or configure.

Second of all, the list you provided to me.  I noticed it is a link file,
not a source file because of hte L before rwx.  The first three links that
point to the 4th file.  The fouth file is a link that aren't pointed to
anything, so it meant it is a link without a file.  That may be why you got
the error.

FletchSOD

"Tom Rogers" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi,
>
> Thursday, July 25, 2002, 1:41:25 AM, you wrote:
> CG> Well my RedHat system got hosed, so I reinstalled everything. I'm back
to
> CG> installing PHP now, and I'm wondering if it's safe for me to run
./configure
> CG> multiple times. Here's the situation:
> CG> I want to compile with gd support, and pdflib, and a bunch of other
options.
> CG> Instead of running a whole huge 5 line ./configure, can I run one at a
time
> CG> to make sure they all work, then run the whole thing?
> CG> Also, just noticed this: I have gd installed, and libgd.so in
/usr/lib, so I
> CG> tried ./configure --with-apxs --with-gd=/usr/lib/ (also tried without
the
> CG> trailing /), but it gives: configure: error: Unable to find
libgd.(a|so)
> CG> anywhere under /usr/lib/
> CG> What gives?
> CG> (in this ouptut, the stuff that's not important is cut out -- dates,
etc)
> CG> [root@saturn php-4.2.2]# ls -l /usr/lib/libgd.*
> CG> lrwxrwxrwx S /usr/lib/libgd.so -> libgd.so.1.8.3
> CG> lrwxrwxrwx S /usr/lib/libgd.so.1 -> libgd.so.1.8.3
> CG> lrwxrwxrwx S /usr/lib/libgd.so.1.8 -> libgd.so.1.8.3
> CG> lrwxrwxrwx S /usr/lib/libgd.so.1.8.3
> CG> [root@saturn php-4.2.2]#
>
> CG> TIA,
> CG> c.
>
>
> CG> --
> CG> PHP General Mailing List (http://www.php.net/)
> CG> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
> it may be looking for libgd.a in the gd directory do a make libgd.a
> then copy it to /usr/lib
>
> --
> Best regards,
> Tom
>



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




Re: [PHP] Help with msql_fetch_array()

2002-07-24 Thread Martin Clifford

It is on whatever installation my host is running :o)  I know it's 4.x, though I 
should really make them upgrade.

>>> "Phillip S. Baker" <[EMAIL PROTECTED]> 07/24/02 02:34PM >>>
At 11:26 AM 7/24/2002 Wednesday, Martin Clifford wrote:
>Shouldn't it be:
>
>$result = mysql_query($sql, $link_id);

Actually mysql_query should default to the last database connection opened 
if no link identifier has been specified.
So the link identifier to not absolutely required.

Phillip


-- 
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




Re: [PHP] Hitting return in a textarea box...

2002-07-24 Thread Phillip S. Baker

At 11:26 AM 7/24/2002 Wednesday, Jesse Lawrence wrote:
>I'm putting together a message board, and I'm having
>problems with hitting the return(enter) key within my
>textarea.
>
>I've looked around for a solution, I tried
>wrap="hard", wrap="soft" and wrap="vitual" and none of
>them worked (should they?  I may have done it wrong?)
>and I also tried nohardbreaks and nosoftbreaks, but I
>think they may be no longer supported.
>
>Is this a case for regex?  If so, can someone perhaps
>point me to an article on how to accomplish this?
>Thanks very much for any help.
>
>Jesse


What problem specifically are you having?
Not clear on what issue you are having?

Displaying the carriage returns?

if you use nl2br($textarea_input) function then this will convert all 
carriage returns to  tags to properly display HTML.
Is that what you are looking for?

Phillip


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




Re: [PHP] Help with msql_fetch_array()

2002-07-24 Thread Phillip S. Baker

At 11:26 AM 7/24/2002 Wednesday, Martin Clifford wrote:
>Shouldn't it be:
>
>$result = mysql_query($sql, $link_id);

Actually mysql_query should default to the last database connection opened 
if no link identifier has been specified.
So the link identifier to not absolutely required.

Phillip


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




Re: [PHP] Hitting return in a textarea box...

2002-07-24 Thread Martin Clifford

I've never had a problem with this.  Even using a textbox with only the required 
parameters works fine as far as hitting the return key to get a newline.  If you're 
talking about hitting the return key to submit, that's something else entirely, hehe.

Martin Clifford
Homepage: http://www.completesource.net
Developer's Forums: http://www.completesource.net/forums/


>>> Jesse Lawrence <[EMAIL PROTECTED]> 07/24/02 02:26PM >>>
I'm putting together a message board, and I'm having
problems with hitting the return(enter) key within my
textarea.

I've looked around for a solution, I tried
wrap="hard", wrap="soft" and wrap="vitual" and none of
them worked (should they?  I may have done it wrong?)
and I also tried nohardbreaks and nosoftbreaks, but I
think they may be no longer supported.

Is this a case for regex?  If so, can someone perhaps
point me to an article on how to accomplish this? 
Thanks very much for any help.

Jesse

__ 
Post your ad for free now! http://personals.yahoo.ca 

-- 
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




Re: [PHP] Help with msql_fetch_array()

2002-07-24 Thread Martin Clifford

Shouldn't it be:

$result = mysql_query($sql, $link_id);

PHP will be quick to tell you that there is a missing link identifier in the 
mysql_query() call.  It's happened to me plenty of times.  HTH!

Martin Clifford
Homepage: http://www.completesource.net
Developer's Forums: http://www.completesource.net/forums/


>>> PHPCoder <[EMAIL PROTECTED]> 07/24/02 02:16PM >>>
Yes, what on earth was I thinking!
should be:
...
$result = mysql_query($sql);
if (mysql_num_rows($result)) {
 $row = mysql_fetch_assoc($result);
 } else {
 echo "whatever";
 }
...


Kevin Stone wrote:

>You beat me too the punch and I think you explained it better than me, but
>just one minor little thing to note.  Where you said..
>
>"if ( $result = mysql_query($sql)) "
>
>This is not a valid way to check if the query has returned anything.
>mysql_query() returns FALSE on error.  So if there was no error but there
>also wasn't anything returned then the object stored in $result wiill more
>than likely evaluate to TRUE.  For the determining factor you should count
>the number of rows with mysql_num_rows($result).  If the returned value is
>zero then you know it hasn't returned anything.
>
>-Kevin
>
>- Original Message -
>From: "PHPCoder" <[EMAIL PROTECTED]>
>To: "Matthew Bielecki" <[EMAIL PROTECTED]>
>Cc: "php-general" <[EMAIL PROTECTED]>
>Sent: Wednesday, July 24, 2002 11:50 AM
>Subject: Re: [PHP] Help with msql_fetch_array()
>
>
>>I can almost guarantee that it's not the second line that is "failing",
>>the problem here is that $result is not containing naything, and that is
>>normally due to the fact that you are not connecting to the db, or the
>>table "tablename" is not there.
>>
>>I use the following format as my "standard" MySQL connect and query
>>
>snippet:
>
>>$link = @mysql_connect("localhost",$username,$password) or die ('Could
>>not connect!'); //@ suppresses the default error message generated by
>>this function and the "or die()" bit kills the script right then and
>>there should it not be able to connect.
>>mysql_select_db("YOUR_DB_NAME",$link);
>>$sql = "select * from your_table_name";
>>if ( $result = mysql_query($sql)) {  // checks to see if $result
>>contains anything before it even tries to fetch an associative array
>>from it.
>> $row = mysql_fetch_assoc($result);
>>} else {
>>echo "Empty result set!";
>>
>>Note also that I use mysql_fetch_assoc and NOT mysql_fecth_array, as 9
>>out of 10 times, you don't need the array element id's that is returned
>>by mysql_fetch_array.
>>
>>Matthew Bielecki wrote:
>>
>>>I have a couple of scripts that fail with the error of:
>>>Warning: mysql_fetch_array(): supplied argument is not a valid MySQL
>>>
>result
>
>>>resource in...
>>>
>>>I'm new to both SQL and PHP and I'm wondering if I have some setting
>>>turned off or what.
>>>
>>>Here's the piece of code that is failing (the second line fails):
>>>
>>>$result = mysql_db_query($dbname, "SELECT * FROM tablename ORDER BY id");
>>>   $row = mysql_fetch_array($result);
>>>
>>>
>>>Thanks for your help in advance!!
>>>
>>
>>
>>--
>>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 



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




[PHP] Hitting return in a textarea box...

2002-07-24 Thread Jesse Lawrence

I'm putting together a message board, and I'm having
problems with hitting the return(enter) key within my
textarea.

I've looked around for a solution, I tried
wrap="hard", wrap="soft" and wrap="vitual" and none of
them worked (should they?  I may have done it wrong?)
and I also tried nohardbreaks and nosoftbreaks, but I
think they may be no longer supported.

Is this a case for regex?  If so, can someone perhaps
point me to an article on how to accomplish this? 
Thanks very much for any help.

Jesse

__ 
Post your ad for free now! http://personals.yahoo.ca

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




Re: [PHP] Help with msql_fetch_array()

2002-07-24 Thread PHPCoder

Yes, what on earth was I thinking!
should be:
...
$result = mysql_query($sql);
if (mysql_num_rows($result)) {
 $row = mysql_fetch_assoc($result);
 } else {
 echo "whatever";
 }
...


Kevin Stone wrote:

>You beat me too the punch and I think you explained it better than me, but
>just one minor little thing to note.  Where you said..
>
>"if ( $result = mysql_query($sql)) "
>
>This is not a valid way to check if the query has returned anything.
>mysql_query() returns FALSE on error.  So if there was no error but there
>also wasn't anything returned then the object stored in $result wiill more
>than likely evaluate to TRUE.  For the determining factor you should count
>the number of rows with mysql_num_rows($result).  If the returned value is
>zero then you know it hasn't returned anything.
>
>-Kevin
>
>- Original Message -
>From: "PHPCoder" <[EMAIL PROTECTED]>
>To: "Matthew Bielecki" <[EMAIL PROTECTED]>
>Cc: "php-general" <[EMAIL PROTECTED]>
>Sent: Wednesday, July 24, 2002 11:50 AM
>Subject: Re: [PHP] Help with msql_fetch_array()
>
>
>>I can almost guarantee that it's not the second line that is "failing",
>>the problem here is that $result is not containing naything, and that is
>>normally due to the fact that you are not connecting to the db, or the
>>table "tablename" is not there.
>>
>>I use the following format as my "standard" MySQL connect and query
>>
>snippet:
>
>>$link = @mysql_connect("localhost",$username,$password) or die ('Could
>>not connect!'); //@ suppresses the default error message generated by
>>this function and the "or die()" bit kills the script right then and
>>there should it not be able to connect.
>>mysql_select_db("YOUR_DB_NAME",$link);
>>$sql = "select * from your_table_name";
>>if ( $result = mysql_query($sql)) {  // checks to see if $result
>>contains anything before it even tries to fetch an associative array
>>from it.
>> $row = mysql_fetch_assoc($result);
>>} else {
>>echo "Empty result set!";
>>
>>Note also that I use mysql_fetch_assoc and NOT mysql_fecth_array, as 9
>>out of 10 times, you don't need the array element id's that is returned
>>by mysql_fetch_array.
>>
>>Matthew Bielecki wrote:
>>
>>>I have a couple of scripts that fail with the error of:
>>>Warning: mysql_fetch_array(): supplied argument is not a valid MySQL
>>>
>result
>
>>>resource in...
>>>
>>>I'm new to both SQL and PHP and I'm wondering if I have some setting
>>>turned off or what.
>>>
>>>Here's the piece of code that is failing (the second line fails):
>>>
>>>$result = mysql_db_query($dbname, "SELECT * FROM tablename ORDER BY id");
>>>   $row = mysql_fetch_array($result);
>>>
>>>
>>>Thanks for your help in advance!!
>>>
>>
>>
>>--
>>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




Re: [PHP] Help with msql_fetch_array()

2002-07-24 Thread Kevin Stone

You beat me too the punch and I think you explained it better than me, but
just one minor little thing to note.  Where you said..

"if ( $result = mysql_query($sql)) "

This is not a valid way to check if the query has returned anything.
mysql_query() returns FALSE on error.  So if there was no error but there
also wasn't anything returned then the object stored in $result wiill more
than likely evaluate to TRUE.  For the determining factor you should count
the number of rows with mysql_num_rows($result).  If the returned value is
zero then you know it hasn't returned anything.

-Kevin

- Original Message -
From: "PHPCoder" <[EMAIL PROTECTED]>
To: "Matthew Bielecki" <[EMAIL PROTECTED]>
Cc: "php-general" <[EMAIL PROTECTED]>
Sent: Wednesday, July 24, 2002 11:50 AM
Subject: Re: [PHP] Help with msql_fetch_array()


> I can almost guarantee that it's not the second line that is "failing",
> the problem here is that $result is not containing naything, and that is
> normally due to the fact that you are not connecting to the db, or the
> table "tablename" is not there.
>
> I use the following format as my "standard" MySQL connect and query
snippet:
>
> $link = @mysql_connect("localhost",$username,$password) or die ('Could
> not connect!'); //@ suppresses the default error message generated by
> this function and the "or die()" bit kills the script right then and
> there should it not be able to connect.
> mysql_select_db("YOUR_DB_NAME",$link);
> $sql = "select * from your_table_name";
> if ( $result = mysql_query($sql)) {  // checks to see if $result
> contains anything before it even tries to fetch an associative array
> from it.
>  $row = mysql_fetch_assoc($result);
> } else {
> echo "Empty result set!";
>
> Note also that I use mysql_fetch_assoc and NOT mysql_fecth_array, as 9
> out of 10 times, you don't need the array element id's that is returned
> by mysql_fetch_array.
>
> Matthew Bielecki wrote:
>
> >I have a couple of scripts that fail with the error of:
> >Warning: mysql_fetch_array(): supplied argument is not a valid MySQL
result
> >resource in...
> >
> >I'm new to both SQL and PHP and I'm wondering if I have some setting
> >turned off or what.
> >
> >Here's the piece of code that is failing (the second line fails):
> >
> >$result = mysql_db_query($dbname, "SELECT * FROM tablename ORDER BY id");
> >$row = mysql_fetch_array($result);
> >
> >
> >Thanks for your help in advance!!
> >
>
>
>
> --
> 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




Re: [PHP] MySQL Backup and Restore

2002-07-24 Thread Martin Clifford

With phpMyAdmin, just scroll down until you see the dumping section.  Select the 
appropriate information, tick the "save as file" box, then "Go".  It'll prompt you to 
save the file.  You just use that file, then, as a query to your next database.

Martin

>>> "1LT John W. Holmes" <[EMAIL PROTECTED]> 07/24/02 01:38PM >>>
I've never had any luck using PHPMyAdmin for dumping databases. They always
time out over the 30 second limit. I know if it was my installation, I could
fix it, but these are usually with hosting companies, where that's the only
access they provide. It's very much a pain in the butt...

---John Holmes...

- Original Message -
From: "Justin French" <[EMAIL PROTECTED]>
To: "Peter" <[EMAIL PROTECTED]>; "kip" <[EMAIL PROTECTED]>;
<[EMAIL PROTECTED]>
Sent: Tuesday, July 23, 2002 11:29 PM
Subject: Re: [PHP] MySQL Backup and Restore


> Can highly recommend doing it (and a whole lot more) with phpMyAdmin
> (http://phpMyAdmin.net)
>
> Justin French
>
>
>
>
> on 24/07/02 1:04 PM, Peter ([EMAIL PROTECTED]) wrote:
>
> > grab ur self a copy of myphpadmin  or use mysqldump or just simply make
a
> > copy of the data dir or grab ur self a copy of mysql_front
> >
> >> -Original Message-
> >> From: kip [mailto:[EMAIL PROTECTED]] 
> >> Sent: Wednesday, 24 July 2002 12:58 PM
> >> To: [EMAIL PROTECTED] 
> >> Subject: [PHP] MySQL Backup and Restore
> >>
> >>
> >> Hi,
> >>
> >> Can you tell me the steps of backup and restore the databases in Mysql?
> >>
> >> And can i specific a path for the backup file?
> >>
> >> Futhermore, i have installed the MySQL in Win2000 but i don't know how
to
> >> restore the database of MySQL from a Linux server to Win2000 MySQL.
> >>
> >> Thanks
> >>
> >>
> >>
> >> --
> >> 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 
>


-- 
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




RE: [PHP] MySQL Backup and Restore

2002-07-24 Thread Andrew Chase

I encountered that same timeout problem once, and I wound up just installing
my own copy of PhpMyAdmin in an .htaccess protected directory on the server,
and extending the time limit there.  It only took about 10 minutes to set
up, and as an added bonus it was a more recent version of PhpMyAdmin than
the one the host provided. :)

-Andy

> -Original Message-
> From: 1LT John W. Holmes [mailto:[EMAIL PROTECTED]]
>
> I've never had any luck using PHPMyAdmin for dumping databases.
> They always
> time out over the 30 second limit. I know if it was my
> installation, I could
> fix it, but these are usually with hosting companies, where
> that's the only
> access they provide. It's very much a pain in the butt...


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




Re: [PHP] Help with msql_fetch_array()

2002-07-24 Thread Kevin Stone

Try using mysql_query(); instead of mysql_db_query();  The SQL query is the
first parameter in this function.  The second parameter is a pointer
connecting to the mysql server.  The pointer is generated by mysql_connect()
and you'll also need to select the database with mysql_select_db().  But
it's the standard way..

$db = mysql_connect("localhost", "username", "password");// connect to
mysql server
mysql_select_db("mytable", $db);
// select database by name
$query = "SELECT * FROM mytable ORDER BY id"; // define query to
submit
$result = mysql_query($query, $db);  //
submit query
if (mysql_num_rows($result) > 0)
// skip if no rows were found
{
while ($row = mysql_fetch_array($result))
{
// .. do whtever..
}
}
mysql_close($db);

It's also a common practice to put the first couple of lines in a file to
include() back into your main script so that you can protect your useranme
and password.

Good luck.
-Kevin

- Original Message -
From: "Matthew Bielecki" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, July 24, 2002 10:34 AM
Subject: [PHP] Help with msql_fetch_array()


> I have a couple of scripts that fail with the error of:
> Warning: mysql_fetch_array(): supplied argument is not a valid MySQL
result
> resource in...
>
> I'm new to both SQL and PHP and I'm wondering if I have some setting
> turned off or what.
>
> Here's the piece of code that is failing (the second line fails):
>
> $result = mysql_db_query($dbname, "SELECT * FROM tablename ORDER BY id");
> $row = mysql_fetch_array($result);
>
>
> Thanks for your help in advance!!


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




Re: [PHP] Help with msql_fetch_array()

2002-07-24 Thread PHPCoder

I can almost guarantee that it's not the second line that is "failing", 
the problem here is that $result is not containing naything, and that is 
normally due to the fact that you are not connecting to the db, or the 
table "tablename" is not there.

I use the following format as my "standard" MySQL connect and query snippet:

$link = @mysql_connect("localhost",$username,$password) or die ('Could 
not connect!'); //@ suppresses the default error message generated by 
this function and the "or die()" bit kills the script right then and 
there should it not be able to connect.
mysql_select_db("YOUR_DB_NAME",$link);
$sql = "select * from your_table_name";
if ( $result = mysql_query($sql)) {  // checks to see if $result 
contains anything before it even tries to fetch an associative array 
from it.
 $row = mysql_fetch_assoc($result);
} else {
echo "Empty result set!";

Note also that I use mysql_fetch_assoc and NOT mysql_fecth_array, as 9 
out of 10 times, you don't need the array element id's that is returned 
by mysql_fetch_array.

Matthew Bielecki wrote:

>I have a couple of scripts that fail with the error of:
>Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result 
>resource in...
>
>I'm new to both SQL and PHP and I'm wondering if I have some setting 
>turned off or what.
>
>Here's the piece of code that is failing (the second line fails):
>
>$result = mysql_db_query($dbname, "SELECT * FROM tablename ORDER BY id");
>$row = mysql_fetch_array($result);
>
>
>Thanks for your help in advance!!
>



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




  1   2   >