[PHP] PHP - XHTML converter to HDML or WML

2003-08-30 Thread Joe Harman
Hey maybe you guys can help me out here.

I would like to start developing for WAP enabled devices. since there
are a lot of people out there who still have phones that use different
version of WML and still some that use HDML. and then the new phones
being able to display XHTML. I would like to either find a parser or
make one that will convert a XHTML file to be compatable with the older
mark-up languages. does anyone have experience with this?

Give you an example.. I have a Sanyo SCP-4700 on the Sprint PCS network.
only HDML 3.0 and WML 1.1 is compatable.. So I run into a lot of
different errors.

So the first step would be to figure out how to determine a cell phone
user's browser. So what's it capable of WML 1.1 or WML 2.0, HDML.. Or
XHTML

Appreciate the feedback,

Joe Harman

http://www.HarmanMedia.com

Have you ever noticed? Anybody going slower than you is an idiot, and
anyone going faster than you is a maniac. - George Carlen



[PHP] Hardening php.ini for an ISP environment

2003-08-30 Thread Roman Medina

 Hi,

 I'm looking for good and complete documentation about hardening a PHP
box which is going to be used to offer hosting services. The machine
will have Apache + PHP with VirtualDomains. Assuming Apache config is
secure, which aspects would be affected for the activation of php
module?

 I'd like a have a look to a complete php.ini checklist. I've been
doing some basic research and I found useful some tips:
- safe_mode on (solves remote execution of arbitrary code)
- open_basedir ./ (solves browsing HD' server problem)
- some limits like memory or CPU time used by a given php script
- disable fsockopen and pfsockopen (solves the problem in launching a
connect to remote hosts from the PHP/web server).

 Regarding last point, is there any php.ini option to disable ALL (at
the same time) PHP dangerous network commands such as fsockopen?

 Any more clues?

 Any help would be greatly appreciated. Thanks in advance.

 Saludos,
 --Roman

--
PGP Fingerprint:
09BB EFCD 21ED 4E79 25FB  29E1 E47F 8A7D EAD5 6742
[Key ID: 0xEAD56742. Available at KeyServ]

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



Re: [PHP] Gripe

2003-08-30 Thread Chris Shiflett
--- Curt Zirzow [EMAIL PROTECTED] wrote:
 * Thus wrote Chris W. Parker ([EMAIL PROTECTED]):
  Chris Shiflett mailto:[EMAIL PROTECTED]
  on Friday, August 29, 2003 2:16 PM said:
  
   if ($foo) { if ($bar) echo 'blah'; else { echo 'else'; }
  ^  ^ ^
   Where is the missing brace? :-)   | |
   |  | |
  Here +--+-/
|  |
   Or Here -+--/
|
   Or Here -/

I think Curt got my point the best. :-)

The point is that you can't tell where I forgot the brace without making
assumptions about what I wanted to do. If a human can't tell whether there is a
missing brace until the very end, a human can't write software that does
either.

Chris

=
Become a better Web developer with the HTTP Developer's Handbook
http://httphandbook.org/

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



Re: [PHP] PHP - XHTML converter to HDML or WML

2003-08-30 Thread Raditha Dissanayake
Hi,

The best approach for you is to use XSLT.  good information about XSLT 
can be found on w3shcools.com
briefly what it can do is to take an xml and convert it to virtually any 
other format. For this is to happen though you need to have strict XHTML 
transistion will not do because it's not always well formed.

If you are really keen to parse your XHTML and go on that path, it can 
be done with SAX (once again provided that it's well formed). Otherwise 
the best HTML parser i have seen actuall comes with perl.

best regards
raditha
Joe Harman wrote:

Hey maybe you guys can help me out here.

I would like to start developing for WAP enabled devices. since there
are a lot of people out there who still have phones that use different
version of WML and still some that use HDML. and then the new phones
being able to display XHTML. I would like to either find a parser or
make one that will convert a XHTML file to be compatable with the older
mark-up languages. does anyone have experience with this?
Give you an example.. I have a Sanyo SCP-4700 on the Sprint PCS network.
only HDML 3.0 and WML 1.1 is compatable.. So I run into a lot of
different errors.
So the first step would be to figure out how to determine a cell phone
user's browser. So what's it capable of WML 1.1 or WML 2.0, HDML.. Or
XHTML
Appreciate the feedback,

Joe Harman

http://www.HarmanMedia.com

Have you ever noticed? Anybody going slower than you is an idiot, and
anyone going faster than you is a maniac. - George Carlen
 



--
http://www.raditha.com/php/progress.php
A progress bar for PHP file uploads.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Why? Why this is not an imap_error?

2003-08-30 Thread myhan
Warning:  imap_fetchstructure(): Bad message number in
e:\testroot\imap\index.php on line 52

I ust imap_fetchstructure function to get the structure of a message, and I
want to push the errors into an array.
I give a wrong message number and expect cause an imap error, which can be
get by using imap_errors().
But it does not work like that. I get nothing from imap_errors(), and the
browser print a waring like that :

Warning:  imap_fetchstructure(): Bad message number in
e:\testroot\imap\index.php on line 52

What can I do?

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



Re: [PHP] Re: speed of mail() on two servers

2003-08-30 Thread Manuel Lemos
Hello,

On 08/29/2003 01:34 PM, David T-G wrote:
% /var/qmail/control/concurrencyremote

Well, that's what I thought, but what I don't know is whether or not
qmail requires a restart to see it :-)
RTFM! :-)

I guess you just need to send a HUP signal to reload the configuration 
options.

--

Regards,
Manuel Lemos
Free ready to use OOP components written in PHP
http://www.phpclasses.org/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Session Issue

2003-08-30 Thread Seth Willits
I'm logging in via a form, and on the form page it creates the session:

?php
	session_start();
	if ($_POST['username'] == $username  $_POST['password'] == $password  
) {
		$_SESSION['loggedIn'] = true;
	} else
		$_SESSION['loggedIn'] = false;
?

And later in the same page, I include another file which has the links  
to the pages within the secured section of the site:

?php if ($_SESSION['loggedIn']) require(section_nav.php); ?

From there, when I go to another page, that same line of doesn't work,  
as the links are not shown. Any idea on why that's happening? Did I  
miss a step?



Seth Willits
 
---
President and Head Developer of Freak Software - http://www.freaksw.com
QA Columnist for REALbasic Developer Magazine -  
http://www.rbdeveloper.com
Webmaster for REALbasic Game Central - http://www.freaksw.com/rbgames

Black holes are where God divided by zero.
-- Steven Wright
 
---

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


Re: [PHP] Apache and forward slash

2003-08-30 Thread Tom Rogers
Hi,

Saturday, August 30, 2003, 2:49:43 AM, you wrote:
CC Hey,

CC I am setting up Apache 1.3.27 on a linux box (I really dont know much about
CC linux) and I am having small problem. When a specify a subdirectory off of
CC my document root, I must include a / forward slash in order for the index
CC page to load, otherwise I get the The page cannot be displayed message.
CC For example, I must type:

CC http://somedomain/phpmyadmin/

CC instead of

CC http://somedomain/phpmyadmin

CC My only previous experience with configuring apache is on Win machines,
CC where I haven't had this problem before. I know this is off topic but u guys
CC know everything, so any help would be greatly appreciated. Thanks


make sure apache is compiled with and using mod_dir (it should by
default..)

-- 
regards,
Tom

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



Re: [PHP] Why? Why this is not an imap_error?

2003-08-30 Thread Curt Zirzow
* Thus wrote myhan ([EMAIL PROTECTED]):
 
 I ust imap_fetchstructure function to get the structure of a message, and I
 want to push the errors into an array.
 I give a wrong message number and expect cause an imap error, which can be
 get by using imap_errors().
 But it does not work like that. I get nothing from imap_errors(), and the
 browser print a waring like that :
 
 Warning:  imap_fetchstructure(): Bad message number in
 e:\testroot\imap\index.php on line 52
 
 What can I do?

You can psudo trap the error message, if you have the php.ini
setting 'track_errors' on then you can do something like:

if (! @imap_fetchstructure(...) ) {
  array_push($errors, $php_errormsg);
}

The @ suppresses direct output to the browser. and php_errormsg
contains the string that woulda been sent.

HTH,

Curt
-- 
I used to think I was indecisive, but now I'm not so sure.

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



Re: [PHP] Session Issue

2003-08-30 Thread Curt Zirzow
* Thus wrote Seth Willits ([EMAIL PROTECTED]):
 I'm logging in via a form, and on the form page it creates the session:
 
 ?php
   session_start();
   if ($_POST['username'] == $username  $_POST['password'] == 
   $password  ) {
   $_SESSION['loggedIn'] = true;
   } else
   $_SESSION['loggedIn'] = false;
 ?
 ...
 
 ?php if ($_SESSION['loggedIn']) require(section_nav.php); ?
 
 
 From there, when I go to another page, that same line of doesn't work,  
 as the links are not shown. Any idea on why that's happening? Did I  
 miss a step?

Does the next page call session_start()?  all pages that use
$_SESSION, must call that first.


Curt
-- 
I used to think I was indecisive, but now I'm not so sure.

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



Re: [PHP] Gripe^2 [was Gripe]

2003-08-30 Thread Curt Zirzow
Why do people insist on using their work address so we are plagued
with privacy notices and autorespond's letting us know that he will
be gone one extra day over the weekend


p.s. you'll know why I'm griping if you reply to this bg
p.s.s. at least till i get him booted off the list vbg

cheers!

Curt
-- 
I used to think I was indecisive, but now I'm not so sure.

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



Re: [PHP] Session Issue

2003-08-30 Thread Seth Willits
On Friday, August 29, 2003, at 07:44  PM, Curt Zirzow wrote:

Does the next page call session_start()?  all pages that use
$_SESSION, must call that first.
Ohhh... ok. Thanks :)



Seth Willits
 
---
President and Head Developer of Freak Software - http://www.freaksw.com
QA Columnist for REALbasic Developer Magazine -  
http://www.rbdeveloper.com
Webmaster for REALbasic Game Central - http://www.freaksw.com/rbgames

One day you'll be wandering through the darkness looking for guidance,
 inspiration, and your purpose in life, and the next you'll turn around
 and realize they've been standing right next to you the whole time.
-- Seth Willits
 
---

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


[PHP] php 4.2.3 on AIX - include statment cause seg. fault

2003-08-30 Thread PM WONG
After upgrading from php 4.0.x to 4.2.3 
many previous php scripts that had been working failed
becos of the include statement
The apache error log logged segmentation fault

I think it might have to do with AIX as there are
no problems for 4.2.3 which I've installed on Tru 64 Unix
(I've checked the php.ini file and the are the same on both platforms)

Anyone who has encountered this for AIX ?

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



[PHP] some html basics please

2003-08-30 Thread Dennis Gearon
It seems that HTML is LAME, LAME,LAME when it comes to determining local 
directories.

I would like to somehow:

   put image links relative to a base directory (if a relative URI is 
given)
   and have PAGE links relative to the current page (if a relative URI 
is given)

What I seem to be able to do instead, is to:

   with NO base  href=websitehost/~my_directory/ in the header
   hard code the location of the images
   use relative URI for pages
-OR-
   with NO base  href=websitehost/~my_directory/ in the header
   use relative location of the images
   hard code the URI for pages
there seems no way to tell the browser to look below the base of the 
site for relative URI for images,
but do local to the current file relative for other pages.

And doing '/someURI makes the browser go off the site and not the base.

GR.

I can either get my images from a particular place on my site by 
hardcoding the exact UR

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


Re: [PHP] Gripe^2 [was Gripe]

2003-08-30 Thread Nicholas Robinson
You could equally ask why we get plagued with silly strap lines like

I used to think I was indecisive, but now I'm not so sure.

HTH


On Saturday 30 Aug 2003 3:54 am, Curt Zirzow wrote:
 Why do people insist on using their work address so we are plagued
 with privacy notices and autorespond's letting us know that he will
 be gone one extra day over the weekend


 p.s. you'll know why I'm griping if you reply to this bg
 p.s.s. at least till i get him booted off the list vbg

 cheers!

 Curt

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



Re: [PHP] some html basics please

2003-08-30 Thread Leif K-Brooks
Dennis Gearon wrote:

It seems that HTML is LAME, LAME,LAME when it comes to determining 
local directories.
This is a PHP list, not an HTML list. What does this have to do with PHP?

--
The above message is encrypted with double rot13 encoding.  Any unauthorized attempt 
to decrypt it will be prosecuted to the full extent of the law.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Session Timeout

2003-08-30 Thread Seth Willits
From what I see, the default timeout for a session is 1440 seconds or  
24 minutes. I was gone for nearly an hour, came back, and the session  
was still valid. Must the value set in the config file be different  
than 1440, or am I misunderstanding session.gc_maxlifetime? I'd like  
for the user to be required to log in if they've been inactive for 10  
minutes, or if they closed the browser window and opened another one.

Sorry for all the basic questions :)

Seth Willits
 
---
President and Head Developer of Freak Software - http://www.freaksw.com
QA Columnist for REALbasic Developer Magazine -  
http://www.rbdeveloper.com
Webmaster for REALbasic Game Central - http://www.freaksw.com/rbgames

Not everything that can be counted counts, and not everything that  
counts
 can be counted.
-- Albert Einstein
 
---

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


Re: [PHP] some html basics please

2003-08-30 Thread Leif K-Brooks
Dennis Gearon wrote:

h, php outputs to the browser,
hmmm, browser reads HTML
hm,maybe somepeople who program in PHP have to dabble in HTML
Never said they don't, but the HTML PHP outputs has nothing to do with 
PHP. Take this to an HTML list/newsgroup.

--
The above message is encrypted with double rot13 encoding.  Any unauthorized attempt 
to decrypt it will be prosecuted to the full extent of the law.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Session Timeout

2003-08-30 Thread Tom Rogers
Hi,

Saturday, August 30, 2003, 1:55:02 PM, you wrote:
SW  From what I see, the default timeout for a session is 1440 seconds or  
SW 24 minutes. I was gone for nearly an hour, came back, and the session  
SW was still valid. Must the value set in the config file be different  
SW than 1440, or am I misunderstanding session.gc_maxlifetime? I'd like  
SW for the user to be required to log in if they've been inactive for 10  
SW minutes, or if they closed the browser window and opened another one.


SW Sorry for all the basic questions :)


SW Seth Willits
SW  
SW ---
SW President and Head Developer of Freak Software - http://www.freaksw.com
SW QA Columnist for REALbasic Developer Magazine -  
SW http://www.rbdeveloper.com
SW Webmaster for REALbasic Game Central - http://www.freaksw.com/rbgames

SW Not everything that can be counted counts, and not everything that  
SW counts
SW   can be counted.
SW  -- Albert Einstein
SW  
SW ---


The session timeout just sets the maximum time before the session data
becomes valid for a garbage collect. If a garbage collect is not
triggered the data is still valid as far as php is concerned. You have
to implement your own timeout checks if you need exactly 24 minutes.
You can do this by storeing the last accessed time in the $_SESSION
array and check it on each start.
I think by default garbage is collected 1 in every 100 hits. (1%)
If it done on every hit it would start to impact performance on busy
sites.

-- 
regards,
Tom

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



Re: [PHP] Gripe^2 [was Gripe]

2003-08-30 Thread Curt Zirzow
* Thus wrote Nicholas Robinson ([EMAIL PROTECTED]):
 You could equally ask why we get plagued with silly strap lines like
 
 I used to think I was indecisive, but now I'm not so sure.

No, you can't *equally* ask why.  It is perfectly acceptable to
have a signature attached to your email.  It is not acceptable to
have a 15 line message wrapped in a box describing the company's
privacy disclaimer.

oh, and it is hardly a strapline, or well.. mabey not :)

 
 On Saturday 30 Aug 2003 3:54 am, Curt Zirzow wrote:
  Why do people insist on using their work address so we are plagued
  with privacy notices and autorespond's letting us know that he will
  be gone one extra day over the weekend

Curt
-- 
I used to think I was indecisive, but now I'm not so sure.

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



[PHP] authentication variable

2003-08-30 Thread BhongOng
Hi,

I have some questions. Is it possible to pass login data such
as username and password to the HTTP Basic Authentication
dialog box from PHP? How do you code that?

Is it also possible to get the variable data from the Authentication
dialog once login? I tried putting phpinfo() in an index.php page inside
the web protected directory but I can only see the username in the
variables..



Calixto Ong II

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



Re: [PHP] Session Timeout

2003-08-30 Thread Curt Zirzow
* Thus wrote Seth Willits ([EMAIL PROTECTED]):
 From what I see, the default timeout for a session is 1440 seconds or  
 24 minutes. I was gone for nearly an hour, came back, and the session  
 was still valid. Must the value set in the config file be different  
 than 1440, or am I misunderstanding session.gc_maxlifetime? I'd like  
 for the user to be required to log in if they've been inactive for 10  
 minutes, or if they closed the browser window and opened another one.

The issue with the session still being around when your browser
closed then reopened has to with the ini setting:

  session.cookie_lifetime

You want it to be 0, for it to expire as soon as the browser closes.

You might want to manage your lifetime of the session yourself,
like Tom Rogers suggested.  This will also avoid issues with clock
settings on the client's computer. So a set up with something like
this:

php.ini:
session.cookie_lifetime = 0

file.php:
$lifetime = (60 * 10); // 10 minutes lifetime
session_start();
if (! empty($_SESSION['last_access']  
  $_SESSION['last_access'] = (time() + $lifetime) ) {

  //  Session has expired
  $_SESSION = array(); // kill session

} else {
  $_SESSION['last_access'] = time();
}

-OR-

if you're not worried about the client's clock being fast or slow:

php.ini:
session.cookie_lifetime = 10;

Curt
-- 
I used to think I was indecisive, but now I'm not so sure.

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



Re: [PHP] authentication variable

2003-08-30 Thread Curt Zirzow
* Thus wrote BhongOng ([EMAIL PROTECTED]):
 Hi,
 
 I have some questions. Is it possible to pass login data such
 as username and password to the HTTP Basic Authentication
 dialog box from PHP? How do you code that?

I know for sure with Basic authentication you can't.

 
 Is it also possible to get the variable data from the Authentication
 dialog once login? I tried putting phpinfo() in an index.php page inside
 the web protected directory but I can only see the username in the
 variables..

Answers to this and probably other questions that might come up
about authentication:

  http://php.net/features.http-auth



Curt
-- 
I used to think I was indecisive, but now I'm not so sure.

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



Re: [PHP] creating a development log

2003-08-30 Thread Merlin
Thanx Chris, this works. Here is the code (might help somebody else)

unset($previousDate);

for ($i=0; $i  $num_results; $i++){

if($previousDate != $log['date'][$i])
echo 'b'.$log[date][$i].'/b'.$p.'ul';
	echo 'li'.$log[entry][$i].'/li';		

$previousDate = $log['date'][$i];
if($previousDate != $log['date'][$i+1]){
echo '/ul'; 
}
}


Chris W. Parker wrote:
Merlin mailto:[EMAIL PROTECTED]
on Friday, August 29, 2003 3:03 PM said:

Unfortuantelley this looks way more complicated than I thought. How to
group by date and still get the entry, and how can I arange it, that
it outputs only the one for the date and then closes the list`?


To display the output like you've got in your post you'd do something
like this:
(pseudo code)

$arrayOfEntries = GetEntries();

$previousDate = ;
foreach($arrayOfEntries as $entry)
{
if($previousDate != $entry['date'])
{
// show date header
// show comment for this record
}
else
{
// show comment only
}
$previousDate = $entry['date'];
}
Let me know if this helps (and if it doesn't too).

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


Re: [PHP] creating a development log

2003-08-30 Thread Merlin
Thanx Chris, this works. Here is the code (might help somebody else)

unset($previousDate);

for ($i=0; $i  $num_results; $i++){

if($previousDate != $log['date'][$i])
echo 'b'.$log[date][$i].'/b'.$p.'ul';
	echo 'li'.$log[entry][$i].'/li';		

$previousDate = $log['date'][$i];
if($previousDate != $log['date'][$i+1]){
echo '/ul'; 
}
}


Chris W. Parker wrote:
Merlin mailto:[EMAIL PROTECTED]
on Friday, August 29, 2003 3:03 PM said:

Unfortuantelley this looks way more complicated than I thought. How to
group by date and still get the entry, and how can I arange it, that
it outputs only the one for the date and then closes the list`?


To display the output like you've got in your post you'd do something
like this:
(pseudo code)

$arrayOfEntries = GetEntries();

$previousDate = ;
foreach($arrayOfEntries as $entry)
{
if($previousDate != $entry['date'])
{
// show date header
// show comment for this record
}
else
{
// show comment only
}
$previousDate = $entry['date'];
}
Let me know if this helps (and if it doesn't too).

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


Re: [PHP] creating a development log

2003-08-30 Thread Merlin
Thanx Chris, this works. Here is the code (might help somebody else)

unset($previousDate);

for ($i=0; $i  $num_results; $i++){

if($previousDate != $log['date'][$i])
echo 'b'.$log[date][$i].'/b'.$p.'ul';
	echo 'li'.$log[entry][$i].'/li';		

$previousDate = $log['date'][$i];
if($previousDate != $log['date'][$i+1]){
echo '/ul'; 
}
}
Chris W. Parker wrote:

Merlin mailto:[EMAIL PROTECTED]
on Friday, August 29, 2003 3:03 PM said:

Unfortuantelley this looks way more complicated than I thought. How to
group by date and still get the entry, and how can I arange it, that
it outputs only the one for the date and then closes the list`?


To display the output like you've got in your post you'd do something
like this:
(pseudo code)

$arrayOfEntries = GetEntries();

$previousDate = ;
foreach($arrayOfEntries as $entry)
{
if($previousDate != $entry['date'])
{
// show date header
// show comment for this record
}
else
{
// show comment only
}
$previousDate = $entry['date'];
}
Let me know if this helps (and if it doesn't too).

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


[PHP] Re: Hardening php.ini for an ISP environment

2003-08-30 Thread Joerg Behrens
 - Original Message - 
 From: Roman Medina [EMAIL PROTECTED]
 Newsgroups: php.general
 To: [EMAIL PROTECTED]
 Sent: Saturday, August 30, 2003 1:45 AM
 Subject: Hardening php.ini for an ISP environment



  Hi,

  I'm looking for good and complete documentation about hardening a PHP
 box which is going to be used to offer hosting services. The machine
 will have Apache + PHP with VirtualDomains. Assuming Apache config is
 secure, which aspects would be affected for the activation of php
 module?

Use php over cgi and try a sbox/suexec wrapper to create a secure
environment.


  I'd like a have a look to a complete php.ini checklist. I've been
 doing some basic research and I found useful some tips:
 - safe_mode on (solves remote execution of arbitrary code)
 - open_basedir ./ (solves browsing HD' server problem)

Safe_mode on makes a http fileupload for users impossible when using php as
a module. So the most php based apps like gallerys, cms cant run at your
environment.


 - some limits like memory or CPU time used by a given php script
 - disable fsockopen and pfsockopen (solves the problem in launching a
 connect to remote hosts from the PHP/web server).

Use a firewall or something like iptables to makes outgoing connections
forbidden. Use ulimits or other job restriction to set runtime limits for
the cgi processes.

  Regarding last point, is there any php.ini option to disable ALL (at
 the same time) PHP dangerous network commands such as fsockopen?

  Any more clues?

Learn more about your given webserver. Alls these problems are not generated
by php. You'll have the same problems when runing perl,python as a module
becaue all these runing under the rights of the webserver user.

regards
Joerg

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



[PHP] Sotre image created by GD in db

2003-08-30 Thread Mohammadreza Hassanrezaeian
Dear Guys,
I want to store an image created by GD functions to a field of my DB. I can
not save it to a string to save it to blob field. Can any one help me with a
simple sample code?
Regards,
Mohammad

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



php-general Digest 30 Aug 2003 10:43:43 -0000 Issue 2267

2003-08-30 Thread php-general-digest-help

php-general Digest 30 Aug 2003 10:43:43 - Issue 2267

Topics (messages 161198 through 161238):

Re: Gripe
161198 by: John W. Holmes
161199 by: Chris Shiflett
161201 by: Chris W. Parker
161202 by: Chris W. Parker
161205 by: Curt Zirzow
161208 by: Chris W. Parker
161213 by: Chris Shiflett

Re: jpeg libraries.
161200 by: Jason Wong

Apache and forward slash
161203 by: Christian Calloway
161218 by: Tom Rogers

creating a development log
161204 by: Merlin
161206 by: Chris W. Parker
161234 by: Merlin
161235 by: Merlin
161236 by: Merlin

Approaches to Logging In
161207 by: Seth Willits
161209 by: Chris W. Parker
161210 by: Chris Sherwood

PHP -  XHTML converter to HDML or WML
161211 by: Joe Harman
161214 by: Raditha Dissanayake

Hardening php.ini for an ISP environment
161212 by: Roman Medina
161237 by: Joerg Behrens

Why? Why this is not an imap_error?
161215 by: myhan
161219 by: Curt Zirzow

Re: speed of mail() on two servers
161216 by: Manuel Lemos

Session Issue
161217 by: Seth Willits
161220 by: Curt Zirzow
161222 by: Seth Willits

Re: Gripe^2 [was Gripe]
161221 by: Curt Zirzow
161225 by: Nicholas Robinson
161230 by: Curt Zirzow

php 4.2.3 on AIX - include statment cause seg. fault
161223 by: PM WONG

some html basics please
161224 by: Dennis Gearon
161226 by: Leif K-Brooks
161228 by: Leif K-Brooks

Session Timeout
161227 by: Seth Willits
161229 by: Tom Rogers
161232 by: Curt Zirzow

authentication variable
161231 by: BhongOng
161233 by: Curt Zirzow

Sotre image created by GD in db
161238 by: Mohammadreza Hassanrezaeian

Administrivia:

To subscribe to the digest, e-mail:
[EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]

To post to the list, e-mail:
[EMAIL PROTECTED]


--
---BeginMessage---
Jackson Miller wrote:
Why is it that when you forget a } the error says:
Unexpected $ on line [last line of file]
Why can't it just say:
Missing } on or before (best guess).
How could the parser possibly know that one was missing as it's going 
through the file? It just keeps a count and can only realize something 
is wrong when it gets to the end of the file and sees the count is off.

--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

php|architect: The Magazine for PHP Professionals  www.phparch.com
---End Message---
---BeginMessage---
--- John W. Holmes [EMAIL PROTECTED] wrote:
 How could the parser possibly know that one was missing as it's going 
 through the file? It just keeps a count and can only realize something 
 is wrong when it gets to the end of the file and sees the count is off.

I can't see how a human could determine this prior to getting to the end
either, unless you assume that the author has properly indented the code. Am I
missing something obvious?

if ($foo) { if ($bar) echo 'blah'; else { echo 'else'; }

Where is the missing brace? :-)

Chris

=
Become a better Web developer with the HTTP Developer's Handbook
http://httphandbook.org/
---End Message---
---BeginMessage---
Chris Shiflett mailto:[EMAIL PROTECTED]
on Friday, August 29, 2003 2:16 PM said:

 if ($foo) { if ($bar) echo 'blah'; else { echo 'else'; }
 ^
 Where is the missing brace? :-) |
  |
Here -/


I'm pretty sure I've seen an error message from something (maybe,
asp.net, or classic asp) that shows a line like i've drawn and points to
where it thinks the problem is. (And no it wasn't always the end of the
last line.) But maybe my memory is a little foggy.



Chris.
---End Message---
---BeginMessage---
Chris W. Parker 
on Friday, August 29, 2003 2:23 PM said:

 I'm pretty sure I've seen an error message from something (maybe,
 asp.net, or classic asp) that shows a line like i've drawn and points
 to where it thinks the problem is. (And no it wasn't always the end
 of the last line.) But maybe my memory is a little foggy.

I should also add (before someone corrects me) that is could have been
related to syntax errors only and not missing braces. Thus the But
maybe my memory is a little foggy. clause in my previous post.



c.
---End Message---
---BeginMessage---
* Thus wrote Chris W. Parker ([EMAIL PROTECTED]):
 Chris Shiflett mailto:[EMAIL PROTECTED]
 on Friday, August 29, 2003 2:16 PM said:
 
  if ($foo) { if ($bar) echo 'blah'; else { echo 'else'; }
 ^  ^ ^
  Where is the missing brace? :-)   |  

RE: [PHP] Sotre image created by GD in db

2003-08-30 Thread Boaz Yahav
Can you save it to a file?
If you can save it to a file, have a look at : 

Saving Images in MySQL
http://www.weberdev.com/ViewArticle.php3?ArticleID=3

Sincerely
 
berber
 
Visit http://www.weberdev.com/ Today!!!
To see where PHP might take you tomorrow.
Share your code : http://addexample.weberdev.com
Search for PHP Code from your browser http://toolbar.weberdev.com



-Original Message-
From: Mohammadreza Hassanrezaeian [mailto:[EMAIL PROTECTED] 
Sent: Saturday, August 30, 2003 12:03 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Sotre image created by GD in db


Dear Guys,
I want to store an image created by GD functions to a field of my DB. I
can not save it to a string to save it to blob field. Can any one help
me with a simple sample code? Regards, Mohammad

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

2003-08-30 Thread Sylvain Rayé
Hello,

I hope you will manage to help me. I have some troubles with this script and
I receive a message in the navigator :

if(is_uploaded_file($_FILES['image']['tmp_name']) 
$_FILES['image']['size']  $MAX_FILE_SIZE){

if(move_uploaded_file($_FILES['image']['tmp_name'],$dirroot./images/photos_
elt/.$_FILES['image']['name'])  send_sql(INSERT INTO $table_categories
SET nom_cat = '.$info_admin['input_nom_element'].',image_cat =
'.$_FILES['image']['name'].', id_parent = $id_parent))
$message = La cateacute;gorie a bien eacute;teacute;
ajouteacute;e ;
else $message = La cateacute;gorie n'a pas eacute;teacute;
ajouteacute;e car une erreur de chargement de fichier s'est produite.;

/* is_uploaded_ file() s'occupe de v„rifier si le fichier est
bien mis dans le dossier temporaire */
/* move_uploaded_file() s'occupe de t„l„charger le fichier dans
le dossier '../images/photos_elt/' */
/* $image_name est une variable contenant le nom du fichier et
est g„n„r„ automatiquement */
/* $image est le chemin et le nom du fichier enregistr„
temporairement */
/* la requete $sql est efectu„ si un fichier est existant sinon
une autre requƒte est faite */

}
elseif(send_sql(INSERT INTO $table_categories SET nom_cat =
'.$info_admin['input_nom_element'].', id_parent = $id_parent))
$message = La cateacute;gorie a bien eacute;teacute;
ajouteacute;e ;
else $message = Cateacute;gorie non ajouteacute;e, veuillez
contacter l'adiministrateur pour signaler une eacute;ventuelle anomalie en
deacute;crivant l'anomalie..;

The message is :

Warning:  Unable to create
'/home/sites/site82/web/images/photos_elt/ail.jpg':  Permission denied in
/home/sites/site82/web/gestion_site/bve_navigation.php on line 73



Warning:  Unable to move '/tmp/phpeZc96V' to
'/home/sites/site82/web/images/photos_elt/ail.jpg' in
/home/sites/site82/web/gestion_site/bve_navigation.php on line 73

Thanks a lot.
Sylvain

-
[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]





[PHP] Re: Hello

2003-08-30 Thread Catalin Trifu
Hi,

The message is :
Warning:  Unable to create
'/home/sites/site82/web/images/photos_elt/ail.jpg':  Permission denied in
/home/sites/site82/web/gestion_site/bve_navigation.php on line 73

it's obvious the user under which the apache server runs does not have
write permissions on /home/sites/site82/web/images/photos_elt
so: chmod it to permit writting. If the use is nobody i guess you have
to chmod it to 777

Warning:  Unable to move '/tmp/phpeZc96V' to
'/home/sites/site82/web/images/photos_elt/ail.jpg' in
/home/sites/site82/web/gestion_site/bve_navigation.php on line 73
same as above.

Cheers,
Catalin

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



[PHP] Frameworks

2003-08-30 Thread Catalin Trifu
Hi,

  Don't know if this is the place to start this,
but I'd like to hear some pros and contras for
some frameworks out there (MVC mostly).
  I mean, you have Placebo, Phrame, pehppy, aso.
  I'm getting a little bit dizzy by how many there
are and I'd like to know your oppinions on them.
Catalin

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


[PHP] Using PHP to cache a flash movie

2003-08-30 Thread Sid
Hello,

Does anyone know a method in which I can load a large flash movie in the background 
and only when it is done, play it. In the mean time, the user should be able to carry 
on surfing normally.

Any ideas?

Thank you,

- Sid


[PHP] allow_call_time_pass_reference?

2003-08-30 Thread Armand Turpel
Hi,
Why allow_call_time_pass_reference is deprecated? I mean it should be the
choice of the programmer to make use of  pass by reference or not.

Example:

$this_string = $is_really_big   // lets say 500 kb

function ($this_string){} // Here the function takes a copy of $this_string
(500 kb) - in php4

function ( $this_string){} // Here the function takes only the address of
$this_string (I guess an int value)

Make use of the second function is less memory intense. So again. Why this
feature should be deprecated? And why (the nonsens!) to give hostmasters the
possibility to switch this off in the php.ini?

Thanks

atu

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



[PHP] Re: Using PHP to cache a flash movie

2003-08-30 Thread Catalin Trifu
Hello,

Does anyone know a method in which I can load a large flash movie in the background and only when it is done, play it. In the mean time, the user should be able to carry on surfing normally.

Any ideas?

Thank you,

- Sid

Hi,

Simply put you can not! if the user moves from one page to another,
the old request goes bye! bye!
Cheers,
Catalin
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] trouble with array_search

2003-08-30 Thread Merlin
Hi there,

I am having somee trouble with array_search.

The function should search for a given date, but it does not work since 
array_search seems only to compare strings. Thats why I tryed to cast 
it, but does not help.

Here is the problem:

(pseudo code)

while(...
$log[date][]= (string)date('mdY',$row-timestamp)
$date_search = '03042003';

$search = array_search($date_search, $dates);
if ($search !== NULL)
echo 'works';   
it always returns 0

Thanx for any help on that,

Merlin

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


[PHP] superglobals?

2003-08-30 Thread Stevie D Peele
What do we call things like this -- $_POST['name'], $_SERVER['remote
add']

Are they superglobals and where can I find a list of these?

Thanks


The best thing to hit the internet in years - Juno SpeedBand!
Surf the web up to FIVE TIMES FASTER!
Only $14.95/ month - visit www.juno.com to sign up today!

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



[PHP] Re: trouble with array_search

2003-08-30 Thread Catalin Trifu
Hi,

  You don't have to convert to string; PHP does it
automatically.
  Did you check for the $dates array, does it really contain
what you think it should.
  So, try to make a print_r($dates) and see if you have what you expect.
  FYI: array_search() returns the key of the last found element
(if any)
Cheers,
Catalin

Hi there,

I am having somee trouble with array_search.

The function should search for a given date, but it does not work since 
array_search seems only to compare strings. Thats why I tryed to cast 
it, but does not help.

Here is the problem:

(pseudo code)

while(...
$log[date][] = (string)date('mdY',$row-timestamp)
$date_search = '03042003';

$search = array_search($date_search, $dates);
if ($search !== NULL)
echo 'works';   

it always returns 0

Thanx for any help on that,

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


Re: [PHP] Re: Using PHP to cache a flash movie

2003-08-30 Thread Sid
Yes, But I was thinking of something like an invisible frame on top which
loads the movie

- Original Message -
From: Catalin Trifu [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: 30 August 2003 Saturday 7:29 AM
Subject: [PHP] Re: Using PHP to cache a flash movie


  Hello,
 
  Does anyone know a method in which I can load a large flash movie in the
background and only when it is done, play it. In the mean time, the user
should be able to carry on surfing normally.
 
  Any ideas?
 
  Thank you,
 
  - Sid
 

 Hi,

 Simply put you can not! if the user moves from one page to another,
 the old request goes bye! bye!

 Cheers,
 Catalin

 --
 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: superglobals?

2003-08-30 Thread Catalin Trifu
Stevie D Peele wrote:

What do we call things like this -- $_POST['name'], $_SERVER['remote
add']
Are they superglobals and where can I find a list of these?

Thanks


The best thing to hit the internet in years - Juno SpeedBand!
Surf the web up to FIVE TIMES FASTER!
Only $14.95/ month - visit www.juno.com to sign up today!
 Hi,

   Superglobals are those variables defined by PHP, like
$_SERVER, $_REQUEST, etc. 
(http://de3.php.net/manual/en/language.variables.predefined.php)
   User defined superglobals do not exist (yet at least)
   In the exmple above the variables are $_SERVER and $_POST
the others are just members of the respective arrays.

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


[PHP] Re: trouble with array_search

2003-08-30 Thread Merlin
I printed the values out, and inserted it into a varibble to check if it 
finds it. In this case it works! But it only wokes if I do it like this:

array('03042003');

This does not work:
array(03042003);
So I gues it has something to do with this? It really drives me crecy, I 
already spent an hour on it :-(

Merlin



Catalin Trifu wrote:

Hi,

  You don't have to convert to string; PHP does it
automatically.
  Did you check for the $dates array, does it really contain
what you think it should.
  So, try to make a print_r($dates) and see if you have what you expect.
  FYI: array_search() returns the key of the last found element
(if any)
Cheers,
Catalin

Hi there,

I am having somee trouble with array_search.

The function should search for a given date, but it does not work 
since array_search seems only to compare strings. Thats why I tryed to 
cast it, but does not help.

Here is the problem:

(pseudo code)

while(...
$log[date][] = (string)date('mdY',$row-timestamp)
$date_search = '03042003';

$search = array_search($date_search, $dates);
if ($search !== NULL)
echo 'works';  

it always returns 0

Thanx for any help on that,

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


Re: [PHP] allow_call_time_pass_reference?

2003-08-30 Thread Curt Zirzow
* Thus wrote Armand Turpel ([EMAIL PROTECTED]):
 Why allow_call_time_pass_reference is deprecated? I mean it should be the
 choice of the programmer to make use of  pass by reference or not.
 
 Example:
 
 $this_string = $is_really_big   // lets say 500 kb
 
 function ($this_string){} // Here the function takes a copy of $this_string
 (500 kb) - in php4
 
 function ( $this_string){} // Here the function takes only the address of
 $this_string (I guess an int value)
 
 Make use of the second function is less memory intense. So again. Why this
 feature should be deprecated? And why (the nonsens!) to give hostmasters the
 possibility to switch this off in the php.ini?

You aren't understanding what that flag does:

php.ini
; - allow_call_time_pass_reference = Off [Code cleanliness]
;  It's not possible to decide to force a variable to be passed by reference
; when calling a function.  The PHP 4 style to do this is by making the
; function require the relevant argument by reference.
/php.ini

This flag does not apply to what you have above. What this disables
is the ablity to decide at 'call time', of the function, to pass by
reference or not. This was an old method and changed in php 4:


function foo($bar) { }
foo($mybar); // this is what it doesn't allow.


It is up to the function to declare if you want to pass by
reference or not, this is not depricated:

function foo_reference($bar) { }
function foo_copy($bar) { }


Curt
-- 
I used to think I was indecisive, but now I'm not so sure.

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



[PHP] Re: trouble with array_search

2003-08-30 Thread Catalin Trifu
  Hi,

I printed the values out, and inserted it into a varibble to check if it 
finds it. In this case it works! But it only wokes if I do it like this:

array('03042003');

This does not work:
array(03042003);
When you make array(03042003) what you get is an array like this
Array ( 0 = 3042003 ); PHP convers the string you got from date to an 
integer.
So when adding the results from date() to the $dates array, you should
keep them as strings.
you could say
$d = date('mdY', timestamp);
$dates[] = $d;//this will keep the variable added as string

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


Re: [PHP] Re: trouble with array_search

2003-08-30 Thread Jim Lucas
the problem is, when you do it the second way, it drops the leading zero off
the number.

and the first way you are telling it that you are setting a string.


Try this.

print_r(array(001,'001',002,'002'));

you will notice that on two of them, you don't see the leading zeros, that
is because normal integers do not retain their leading zeros even if you
enter them.

Jim Lucas

- Original Message - 
From: Merlin [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Saturday, August 30, 2003 9:02 AM
Subject: [PHP] Re: trouble with array_search


 I printed the values out, and inserted it into a varibble to check if it
 finds it. In this case it works! But it only wokes if I do it like this:

 array('03042003');

 This does not work:
 array(03042003);

 So I gues it has something to do with this? It really drives me crecy, I
 already spent an hour on it :-(

 Merlin



 Catalin Trifu wrote:

  Hi,
 
You don't have to convert to string; PHP does it
  automatically.
Did you check for the $dates array, does it really contain
  what you think it should.
So, try to make a print_r($dates) and see if you have what you expect.
FYI: array_search() returns the key of the last found element
  (if any)
 
  Cheers,
  Catalin
 
 
  Hi there,
 
  I am having somee trouble with array_search.
 
  The function should search for a given date, but it does not work
  since array_search seems only to compare strings. Thats why I tryed to
  cast it, but does not help.
 
  Here is the problem:
 
  (pseudo code)
 
 
  while(...
  $log[date][] = (string)date('mdY',$row-timestamp)
 
  $date_search = '03042003';
 
  $search = array_search($date_search, $dates);
  if ($search !== NULL)
  echo 'works';
 
  it always returns 0
 
  Thanx for any help on that,
 
  Merlin

 -- 
 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] some html basics please

2003-08-30 Thread Chris Shiflett
--- Dennis Gearon [EMAIL PROTECTED] wrote:
 It seems that HTML is LAME, LAME,LAME when it comes to determining
 local directories.

I think you just need to understand how filesystems work and what a URL is.

../ is the parent directory
./  is the current directory
/   is the root directory

If you reference /image.png from a page found at
http://example.org/foo/bar.php, the browser will request the resource at
http://example.org/image.png. If you reference ./image.png or even just
image.png in that page, the browser will request
http://example.org/foo/image.png.

Just remember that the browser is the one interpreting the path and requesting
the URL, which is why / references document root and not the root directory of
the filesystem.

Hope that helps.

Chris

=
Become a better Web developer with the HTTP Developer's Handbook
http://httphandbook.org/

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



Re: [PHP] some html basics please

2003-08-30 Thread Dennis Gearon
Chris Shiflett wrote:

../ is the parent directory
./  is the current directory
/   is the root directory
 

I knew that ./ was the current directory on a *nix system, but a browser 
will respect that also?

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


[PHP] execute command line script from browser

2003-08-30 Thread Rodney Green
Is there a way to execute a command line php script from a browser by, say
clicking a button and then having the browser let go and let the script run
independet of the browser? Hope I explained that correctly.

Thanks,
Rod


  CinchHost.com - Web Hosting Made Easier
 ASP, PHP, CGI, WEBMAIL, And More
 Packages as Low as $9.99 - No Set Up fees
http://www.cinchhost.com/


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



[PHP] Re: trouble with array_search

2003-08-30 Thread Merlin
thank you for your help. I have found that the error was laying 
somewhere else. The code like you wrote was ok.

Cheers,

merlin

Catalin Trifu wrote:

  Hi,

I printed the values out, and inserted it into a varibble to check if 
it finds it. In this case it works! But it only wokes if I do it like 
this:

array('03042003');

This does not work:
array(03042003);


When you make array(03042003) what you get is an array like this
Array ( 0 = 3042003 ); PHP convers the string you got from date to an 
integer.
So when adding the results from date() to the $dates array, you should
keep them as strings.
you could say
$d = date('mdY', timestamp);
$dates[] = $d;//this will keep the variable added as string

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


[PHP] Table format needs php correction

2003-08-30 Thread Gloria L. McMillan
Hi!

This is a problem of the table formatting on a form in MySQL and PHP.
It may be in the HTML table code.

The problem is one that must be frequent.  I have a mixture of one character
and long fill-in text items.

My table now looks awkward. Somebody gave me a complex table that puts colors as 
backgrounds
behind the headers.  Could that be the problem?  -Gloria


Here is the URL to view PHP HTML table as it appears on screen:
http://DakotaCom.net/~glomc/forms/CAT.php

Here is the mysql create table structure file:

#
# Table structure for table 'CAT'
#

CREATE TABLE CAT (
   id int(10) unsigned DEFAULT '0' NOT NULL auto_increment,
   added datetime DEFAULT '-00-00 00:00:00' NOT NULL,
   name varchar(50) NOT NULL,
   course varchar(50) NOT NULL,
   unit varchar(50) NOT NULL,
   q1 text NOT NULL,
   q2 text NOT NULL,
   q3 text NOT NULL,
   q4 text NOT NULL,
   q5 varchar(10) NOT NULL,
   q6 varchar(10) NOT NULL,
   q7 varchar(10) NOT NULL,
   PRIMARY KEY (id)
);


Here is the table HTML part of the PHP file:

print table\n;
while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) {
 print \ttr\n;
 foreach ($line as $col_value) {
  print \t\ttd$col_value/td\n;
 }
 print \t/tr\n;
}
print /table\n;
*/
while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
 printf(
div class=\colorfield\
table
 trthDate/ththName/ththCourse/ththUnit/th\n

trtd%s/tdtd%s/tdtd%s/tdtd%s/td/tr\n

 trth = colspan = 4 Q1 /th\n
 trtd%s/td\n

 trth = colspan = 4 Q2 /th\n
 trtd%s/td\n

 trth = colspan = 4 Q3 /th\n
 trtd%s/td\n

 trth = colspan = 4 Q4 /th\n
 trtd%s/td\n

 trthQ5/ththQ6/ththQ7/th\n

 trtd%s/tdtd%s/tdtd%s/td\n
/table


/div\n,
   $row['added'],
   $row['name'],
   $row['course'],
   $row['unit'],
   $row['q1'],
   $row['q2'],
   $row['q3'],
   $row['q4'],
   $row['q5'],
   $row['q6'],
   $row['q7']);

}

/* Free resultset */
 mysql_free_result($result);

/* Close the database connection */
mysql_close($link);

?
/body
/html

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



[PHP] Re: Table format needs php correction

2003-08-30 Thread Al
There are too many problems with your code for anyone to spend the time 
going thru them all.

I'd suggest, first constructing a regular html table that looks like you 
want it to.  Hint, IE6 requires something in TDs [e.g., nbsp;] for 
borders to show. 

When the table looks the way you want it to, validate the code at 
http://validator.w3.org/

Then work on your php code to generate the exact same html.

Gloria L. McMillan wrote:

Hi!

This is a problem of the table formatting on a form in MySQL and PHP.
It may be in the HTML table code.
The problem is one that must be frequent.  I have a mixture of one character
and long fill-in text items.
My table now looks awkward. Somebody gave me a complex table that puts colors as 
backgrounds
behind the headers.  Could that be the problem?  -Gloria
Here is the URL to view PHP HTML table as it appears on screen:
http://DakotaCom.net/~glomc/forms/CAT.php
Here is the mysql create table structure file:

#
# Table structure for table 'CAT'
#
CREATE TABLE CAT (
  id int(10) unsigned DEFAULT '0' NOT NULL auto_increment,
  added datetime DEFAULT '-00-00 00:00:00' NOT NULL,
  name varchar(50) NOT NULL,
  course varchar(50) NOT NULL,
  unit varchar(50) NOT NULL,
  q1 text NOT NULL,
  q2 text NOT NULL,
  q3 text NOT NULL,
  q4 text NOT NULL,
  q5 varchar(10) NOT NULL,
  q6 varchar(10) NOT NULL,
  q7 varchar(10) NOT NULL,
  PRIMARY KEY (id)
);
Here is the table HTML part of the PHP file:

print table\n;
while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) {
print \ttr\n;
foreach ($line as $col_value) {
 print \t\ttd$col_value/td\n;
}
print \t/tr\n;
}
print /table\n;
*/
while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
printf(
div class=\colorfield\
table
trthDate/ththName/ththCourse/ththUnit/th\n
trtd%s/tdtd%s/tdtd%s/tdtd%s/td/tr\n

trth = colspan = 4 Q1 /th\n
trtd%s/td\n
trth = colspan = 4 Q2 /th\n
trtd%s/td\n
trth = colspan = 4 Q3 /th\n
trtd%s/td\n
trth = colspan = 4 Q4 /th\n
trtd%s/td\n
trthQ5/ththQ6/ththQ7/th\n

trtd%s/tdtd%s/tdtd%s/td\n
/table
/div\n,
  $row['added'],
  $row['name'],
  $row['course'],
  $row['unit'],
  $row['q1'],
  $row['q2'],
  $row['q3'],
  $row['q4'],
  $row['q5'],
  $row['q6'],
  $row['q7']);
}

/* Free resultset */
mysql_free_result($result);
/* Close the database connection */
mysql_close($link);
?
/body
/html
 

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


Re: [PHP] Table format needs php correction

2003-08-30 Thread Curt Zirzow
* Thus wrote Gloria L. McMillan ([EMAIL PROTECTED]):
 Hi!

Hello Gloria,

 
 This is a problem of the table formatting on a form in MySQL and PHP.
 It may be in the HTML table code.
 ...
 Here is the URL to view PHP HTML table as it appears on screen:
 http://DakotaCom.net/~glomc/forms/CAT.php

I think you need to take a step back for a moment. First consider
how you want the data to be presented in html, then the php code
will be very simple.

From what I see and how I would prefer to set the layout would be
something like this:

 Date  Name   Course  Unit
 Aug 30 2003   Gloria WRT 102 Fall 03 Essay 1

 Q1 data for q1
 Q2 data for q2
 ...


Then easily put that into a html table structure:

tr
 tdDate/tdtdName/tdtdCourse/tdtdUnit/td
/tr
tr
 tdAug 30 2003/tdtdGloria /tdtdWRT 102 Fall 03/tdtdEssay 1/td
/tr
tr
 tdQ1/tdtd colspan=3data for q1/td
/tr
tr
 tdQ2/tdtd colspan=3data for q2/td
tr
 ...

Now inside your fetch_array loop just use that template above using
php variables instead of text and table column attributes in the
appropriate places will result in a decent looking site.


Curt
-- 
I used to think I was indecisive, but now I'm not so sure.

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



Re: [PHP] Table format needs php correction

2003-08-30 Thread andu
On Sat, 30 Aug 2003 10:23:49 -0700
Gloria L. McMillan [EMAIL PROTECTED] wrote:

 Hi!
 
 This is a problem of the table formatting on a form in MySQL and PHP.
 It may be in the HTML table code.
 
 The problem is one that must be frequent.  I have a mixture of one
 character and long fill-in text items.
 
 My table now looks awkward. Somebody gave me a complex table that puts
 colors as backgrounds behind the headers.  Could that be the problem? 
 -Gloria

The SQL has nothing to do with it (though make sure the query returns
what you expect), it's just how you format the table with the data you
have. My advice is to start it simple with no colors or stuff like that
and work on it until you get the proper table (html). Forget about using
other people's code in something like this and try to understand the
logic before you get to beautifying your output. I just spent the last
couple of days with tables formating, css, etc
 
 
 
 Here is the URL to view PHP HTML table as it appears on screen:
 http://DakotaCom.net/~glomc/forms/CAT.php
 
 Here is the mysql create table structure file:
 
 #
 # Table structure for table 'CAT'
 #
 
 CREATE TABLE CAT (
id int(10) unsigned DEFAULT '0' NOT NULL auto_increment,
added datetime DEFAULT '-00-00 00:00:00' NOT NULL,
name varchar(50) NOT NULL,
course varchar(50) NOT NULL,
unit varchar(50) NOT NULL,
q1 text NOT NULL,
q2 text NOT NULL,
q3 text NOT NULL,
q4 text NOT NULL,
q5 varchar(10) NOT NULL,
q6 varchar(10) NOT NULL,
q7 varchar(10) NOT NULL,
PRIMARY KEY (id)
 );
 
 
 Here is the table HTML part of the PHP file:
 
 print table\n;
 while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) {
  print \ttr\n;
  foreach ($line as $col_value) {
   print \t\ttd$col_value/td\n;
  }
  print \t/tr\n;
 }
 print /table\n;
 */
 while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
  printf(
 div class=\colorfield\
 table
  trthDate/ththName/ththCourse/ththUnit/th\n
 
 trtd%s/tdtd%s/tdtd%s/tdtd%s/td/tr\n
 
  trth = colspan = 4 Q1 /th\n
  trtd%s/td\n
 
  trth = colspan = 4 Q2 /th\n
  trtd%s/td\n
 
  trth = colspan = 4 Q3 /th\n
  trtd%s/td\n
 
  trth = colspan = 4 Q4 /th\n
  trtd%s/td\n
 
  trthQ5/ththQ6/ththQ7/th\n
 
  trtd%s/tdtd%s/tdtd%s/td\n
 /table
 
 
 /div\n,
$row['added'],
$row['name'],
$row['course'],
$row['unit'],
$row['q1'],
$row['q2'],
$row['q3'],
$row['q4'],
$row['q5'],
$row['q6'],
$row['q7']);
 
 }
 
 /* Free resultset */
  mysql_free_result($result);
 
 /* Close the database connection */
 mysql_close($link);
 
 ?
 /body
 /html
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 
 


-- 
Regards, Andu Novac

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



[PHP] Re: allow_call_time_pass_reference?

2003-08-30 Thread rush
Armand Turpel [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Hi,
 Why allow_call_time_pass_reference is deprecated? I mean it should be the
 choice of the programmer to make use of  pass by reference or not.

maybe it was a problematicd idea to have call time decision in the first
place, and now they want it to put it to rest somehow. In all other
languages the decision is in the signature of the function, and there is no
ability to to have call time decision. Probably it causes implentation
problems and inconsistences, and needs to be eliminated before new 5.0
semantics is in the place.

rush
--
http://www.templatetamer.com/

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



[PHP] Re: Sotre image created by GD in db

2003-08-30 Thread Baroiller Pierre-Emmanuel
Hi,

you can do something like this :

!-- code --
$imgdata = addslashes(imagejpeg($imnew));   // For JPG file.
$query=INSERT INTO your_table (data) value ('$imgdata');
$result = @mysql_query($query);
!-- /code --

I haven't try but it may work...
Regards.
P.E. Baroiller


Mohammadreza Hassanrezaeian [EMAIL PROTECTED] a écrit dans le message
de news:[EMAIL PROTECTED]
 Dear Guys,
 I want to store an image created by GD functions to a field of my DB. I
can
 not save it to a string to save it to blob field. Can any one help me with
a
 simple sample code?
 Regards,
 Mohammad

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



[PHP] Re: Lack of info

2003-08-30 Thread Senshi Oukan
IM not ranting, IM pointing out that I have looked on the website and the
FAQ is a joke and help from other sources is either buy something or as the
case of IRC, no channel of that description was turned up in the search.

Out of fustration and spending several attempts to implement PHP and IM
doubting weather or not its worth all this bother, I cant get the help IM
looking for, FAQ has not got my particular issue listed and now I have
resorted to direct contact as I cant get any straight answer or link to
somewhere that does not sell me something or ask for membership or payment
of any kind.  The IRC sounded a good deal better but even then the #php
channel is not listed, I try to join the #php channel and nothing

I followed the set up a from the examples in the acompanying documentation
which is very sketchy at best and all you state is after install the php.ini
file needs putting in the %system root% and configuring...  well I did all
that, What I want to know is information on what is acceptable info that
should be used in the config...nice to say it needs configuring, perhaps you
could enlighten me as to all the terms and what they are meant for and what
data needs putting into the fields?  I also want to know how I know its
installed and functioning as I have no idea if its functioning.

So IM stuck, fustrated as this is about the 5th time I have tried to tackle
the problem over as many months but cant get the information on what I need
to do to get it up and running, the FAQ is a joke, more info on LINUX than
you can shake a stick at, if you care to look at the site you will see the
word LINUX poping up ever few lines or so.all IM trying to do is set up
a messaging board, either Snitz forums or phpBB2, and they both use PHP.

It is no good either hi-lighting that 100's of other people have no problem
using it, mabey so, but how many 1,000s have had problems and not chased it
up?  Chances are those users will have grown up and been taught that in
school or know people who understand the config of it, IM a lot longer in
tooth and have no prior knowledge of PC technology other than what I left
school with some 25 years ago, so simply stating a fact like that does not
remedy the situation and I dont think you appreciate my position when I say
that my knowledge although patchy, I have problems when setups and setup
information waffels on about terms and items that have no meaning and have
no explanation other than another jargon word or tech term... the basics of
setting up operating systems and servers is childs play as is building PCs
from scratch but compaired to setting up PHP, it has become a nightmare of
biblical proportions.

One final thing is if PHP is so easy to set up, why am I having problems?
and why is their so little help in the FAQ ?

Perhaps you should have an FAQ for newbies, no jargon or tech speak, just
information presented in a package that everyone can understand.


I really would appreciate some help, as the info IM looking for is not
listed in your FAQ.




- Original Message -
From: Gabor Hojtsy [EMAIL PROTECTED]
To: Senshi Oukan [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Saturday, August 30, 2003 4:47 PM
Subject: Re: Lack of info


  Been down that road and it got me knowhere, I dont wish to buy
information
  or books, I just need to know if its running as well as if its working
and
  if the config or rather how the config works...
 
  For an organisation that wants people to use PHP, you sure make things
very
  difficult to achieve, why I am so critical of sites like yours.
 
  I will re-iterate once more, I have trawled the site and resources and
  cannot find the answer to my problem anywhere in the site or links you
  provide, plenty of waffel and hot air but no nuts and bolts stuff, if
you
  dont know what IM talking about??? IM talking about the info to make it
work
  as at the moment it is just occupying hard drive space which I could put
to
  better use if this is the level of support that you get from PHP.
 
  So...2nd time around and I hope you read the email before you reply.
 
  Can I have access to the information I need if you have it? You have
plenty
  of advice for Linux users, what about us Windows users? Running Linux is
not
  an option IM afraid.

 What do you think how much of our users set up PHP on windows and on
 linux? See http://php.net/usage, and see yourself that we have a lot of
 users around the world.

 Guys working on the PHP engine, extensions, documentation, etc. all do
 their work for free, including me. We are not interested in getting
 every single person to use PHP. If you find some other solution better
 suited for you, then choose that one. The numbers show that there is a
 huge number of users finding PHP easy to set up and run, and that we
 (and all the sites covering PHP on the net) provide proper support for
 what we develop for free and give out for free.

 If you would like to get an answer, ask a question first. 

Re: [PHP] allow_call_time_pass_reference?

2003-08-30 Thread Armand Turpel
Thanks for this clarification!

atu




- Original Message - 
From: Curt Zirzow [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Saturday, August 30, 2003 6:10 PM
Subject: Re: [PHP] allow_call_time_pass_reference?


 * Thus wrote Armand Turpel ([EMAIL PROTECTED]):
  Why allow_call_time_pass_reference is deprecated? I mean it should be
the
  choice of the programmer to make use of  pass by reference or not.
 
  Example:
 
  $this_string = $is_really_big   // lets say 500 kb
 
  function ($this_string){} // Here the function takes a copy of
$this_string
  (500 kb) - in php4
 
  function ( $this_string){} // Here the function takes only the address
of
  $this_string (I guess an int value)
 
  Make use of the second function is less memory intense. So again. Why
this
  feature should be deprecated? And why (the nonsens!) to give hostmasters
the
  possibility to switch this off in the php.ini?

 You aren't understanding what that flag does:

 php.ini
 ; - allow_call_time_pass_reference = Off [Code cleanliness]
 ;  It's not possible to decide to force a variable to be passed by
reference
 ; when calling a function.  The PHP 4 style to do this is by making
the
 ; function require the relevant argument by reference.
 /php.ini

 This flag does not apply to what you have above. What this disables
 is the ablity to decide at 'call time', of the function, to pass by
 reference or not. This was an old method and changed in php 4:


 function foo($bar) { }
 foo($mybar); // this is what it doesn't allow.


 It is up to the function to declare if you want to pass by
 reference or not, this is not depricated:

 function foo_reference($bar) { }
 function foo_copy($bar) { }


 Curt
 -- 
 I used to think I was indecisive, but now I'm not so sure.

 -- 
 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] PHP equivalent to MOD

2003-08-30 Thread James Johnson
Hi,

I need to see if a number is divisible by 2. I don't see the math function
mod in my PHP Functions reference manual. Is there another way to do this?

Thanks,
James

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



RE: [PHP] PHP equivalent to MOD

2003-08-30 Thread James Johnson
Nevermind, I found it in the archives.
Thanks

-Original Message-
From: James Johnson [mailto:[EMAIL PROTECTED] 
Sent: Saturday, August 30, 2003 12:25 PM
To: [EMAIL PROTECTED]
Subject: [PHP] PHP equivalent to MOD


Hi,

I need to see if a number is divisible by 2. I don't see the math function
mod in my PHP Functions reference manual. Is there another way to do this?

Thanks,
James

-- 
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: Lack of info

2003-08-30 Thread Curt Zirzow
* Thus wrote Senshi Oukan ([EMAIL PROTECTED]):
 IM not ranting, IM pointing out that I have looked on the website and the
 FAQ is a joke and help from other sources is either buy something or as the
 case of IRC, no channel of that description was turned up in the search.

Apparently you have a problem with reading. You did exactly the
*opposite* of what Goba suggested and took your rant, and then some,
to this list.

 
 
 - Original Message -
 From: Gabor Hojtsy [EMAIL PROTECTED]
 To: Senshi Oukan [EMAIL PROTECTED]; [EMAIL PROTECTED]
 Sent: Saturday, August 30, 2003 4:47 PM
 Subject: Re: Lack of info
 
 
   Been down that road and it got me knowhere, I dont wish to buy
 information
   or books, I just need to know if its running as well as if its working
 and
   {snip a bunch of ranting )

 
  what we develop for free and give out for free.
 
  If you would like to get an answer, ask a question first. But please
  forward that to [EMAIL PROTECTED], and take my advice on
  omitting rants from that letter, or otherwise you will not receive an
  answer. Consider the IRC channels, forums, local user groups,
  conferences, books, tutorial sites, windows quick installation kits
  linked from our site.
 
  Goba
 


Curt
-- 
I used to think I was indecisive, but now I'm not so sure.

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



Re: [PHP] Table format needs php correction

2003-08-30 Thread Curt Zirzow
* Thus wrote Curt Zirzow ([EMAIL PROTECTED]):
 * Thus wrote Gloria L. McMillan ([EMAIL PROTECTED]):
  Hi!
 
 Hello Gloria,
 
  
  This is a problem of the table formatting on a form in MySQL and PHP.
  It may be in the HTML table code.
  ...
  Here is the URL to view PHP HTML table as it appears on screen:
  http://DakotaCom.net/~glomc/forms/CAT.php
 
 I think you need to take a step back for a moment. First consider
 how you want the data to be presented in html, then the php code
 will be very simple.

Ok, I had a little extra time this morning :)

  http://zirzow.dyndns.org/html/php/html/table.php


Curt
-- 
I used to think I was indecisive, but now I'm not so sure.

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



[PHP] Problems with $DOCUMENT_ROOT being blank

2003-08-30 Thread brad e
I set up a PHP4.3.3/mySQL4.0.14/Apache2.0.47 server and everythign is
configured and running properly. i tested php with some scripts and
functions and they all work. When i try and do any file editing/including in
scripts i get file not found errors all over the place when i open like
$DOCUMENT_ROOT/some/file/location. if i manually describe the location as in
/usr/local/some/file/location it works fine. When i echo $DOCUMENT_ROOT i
get nothing (literally ''). I have set my doc root folder in php.ini, but it
doesnt echo that. any ideas?

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



Re: [PHP] Table format needs php correction

2003-08-30 Thread Gloria L. McMillan
Thanks but the lines are all running together in that URL.
I don't know why.
They are not breaking at the end of each line.

Could you re-save a different way?
Maybe send to me as a text file?

Thanks,

Gloria


Curt Zirzow wrote:

 * Thus wrote Curt Zirzow ([EMAIL PROTECTED]):
  * Thus wrote Gloria L. McMillan ([EMAIL PROTECTED]):
   Hi!
 
  Hello Gloria,
 
  
   This is a problem of the table formatting on a form in MySQL and PHP.
   It may be in the HTML table code.
   ...
   Here is the URL to view PHP HTML table as it appears on screen:
   http://DakotaCom.net/~glomc/forms/CAT.php
 
  I think you need to take a step back for a moment. First consider
  how you want the data to be presented in html, then the php code
  will be very simple.

 Ok, I had a little extra time this morning :)

   http://zirzow.dyndns.org/html/php/html/table.php

 Curt
 --
 I used to think I was indecisive, but now I'm not so sure.

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



Re: [PHP] Table format needs php correction

2003-08-30 Thread Gloria L. McMillan
This is all so advanced.  Is it ready to be in place of the table HTML  that I already 
have?

I copied it to word and saved it as a .txt file.  IN IE it looked better than in my
Netscape.

Gloria


Curt Zirzow wrote:

 * Thus wrote Curt Zirzow ([EMAIL PROTECTED]):
  * Thus wrote Gloria L. McMillan ([EMAIL PROTECTED]):
   Hi!
 
  Hello Gloria,
 
  
   This is a problem of the table formatting on a form in MySQL and PHP.
   It may be in the HTML table code.
   ...
   Here is the URL to view PHP HTML table as it appears on screen:
   http://DakotaCom.net/~glomc/forms/CAT.php
 
  I think you need to take a step back for a moment. First consider
  how you want the data to be presented in html, then the php code
  will be very simple.

 Ok, I had a little extra time this morning :)

   http://zirzow.dyndns.org/html/php/html/table.php

 Curt
 --
 I used to think I was indecisive, but now I'm not so sure.

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



[PHP] Multiple word strings getting truncated - help please.

2003-08-30 Thread James Johnson
Hi,

I have a form for a member to signup for an account. The form has standard
fields for addresses, city state, etc. When I insert the data into the
table, if the string has more than one word, it gets truncated to the first
word.

Does this sound like a PHP or a MySQL problem.

Here's the code: (partial as the query is quite long)

$tr_addr1 = $_POST['addr1']
$query = INSERT INTO subscribers (addr1) VALUES('$tr_addr1');

The MySQl table is as such:

addr1 = varchar(50)

Thanks,
James

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



Re: [PHP] Multiple word strings getting truncated - help please.

2003-08-30 Thread David Otton
On Sat, 30 Aug 2003 14:52:30 -0700, you wrote:

I have a form for a member to signup for an account. The form has standard
fields for addresses, city state, etc. When I insert the data into the
table, if the string has more than one word, it gets truncated to the first
word.

Does this sound like a PHP or a MySQL problem.

Here's the code: (partial as the query is quite long)

Odd. Try this

$tr_addr1 = mysql_escape_string ($_POST['addr1']);
$query = INSERT INTO subscribers (addr1) VALUES('$tr_addr1');
echo ($querybr);

And tell us what you get. Then you at least know whether it's a MySQL
problem or an HTML/PHP problem.

Hmm. You are quoting your HTML attributes, right? That's the only thing I
can think of that even comes close to the behaviour you describe.

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



RE: [PHP] Pipe an email to PHP

2003-08-30 Thread Thomas Tremain

I resolved my problem several days later, and I thought I might post it for
those that come up behind me.

I had several blank lines in my .php file after the closing ?

This caused an output of the script (even though I could not see it) which
generated the failure notice within Exim. 


Thomas Tremain
www.LiveHost.net
www.GotoNames.com
www.TrafficExaminer.com

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



[PHP] RE: Solved. [PHP] Multiple word strings getting truncated - help please.

2003-08-30 Thread James Johnson
Hi David,

From your suggestion, I found the problem. I'm validating the form and if
something isn't correct, I'm not doing the query, but maintaining what the
user previously entered with the following code:

?php if(isset($_POST['addr1'])){$a1 = $_POST['addr1'];}else{$a1 = ;}?
input type=text name=addr1 size=32 value=?php echo $a1; ?

In some of the input tags, I hadn't put quotes around the value.

Thanks,

James

-Original Message-
From: David Otton [mailto:[EMAIL PROTECTED] 
Sent: Saturday, August 30, 2003 3:24 PM
To: James Johnson
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] Multiple word strings getting truncated - help please.


On Sat, 30 Aug 2003 14:52:30 -0700, you wrote:

I have a form for a member to signup for an account. The form has 
standard fields for addresses, city state, etc. When I insert the data 
into the table, if the string has more than one word, it gets truncated 
to the first word.

Does this sound like a PHP or a MySQL problem.

Here's the code: (partial as the query is quite long)

Odd. Try this

$tr_addr1 = mysql_escape_string ($_POST['addr1']);
$query = INSERT INTO subscribers (addr1) VALUES('$tr_addr1'); echo
($querybr);

And tell us what you get. Then you at least know whether it's a MySQL
problem or an HTML/PHP problem.

Hmm. You are quoting your HTML attributes, right? That's the only thing I
can think of that even comes close to the behaviour you describe.

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