[PHP] printing

2003-01-27 Thread Shaun van den Berg
Hey,

Is there a way in php to print to a printer? say i have a order from , when
someone clicks the submit button - then print the form plus the entered
details to a page ?

Thanks for you help

Shaun

--
Novtel Consulting
Tel: +27 21 9822373
Fax: +27 21 9815846
Please visit our website:
www.novtel.co.za



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




[PHP] Need Guru's Help

2003-01-27 Thread Tariq Murtaza
Hi All Guru's here,

I need your help regarding converting HTML Table structure to DB schema 
or XML format. I am not a Regular expression expert.

(Actually i have 500 html files containing this table struction,and need 
to read all 500 files and convert them to DB schema or XML format)

Looking for anybody to help me out.
Regards  Tariq



   http://www.ababasons.com

 >A. BABA & SONS 
   
  240/2, SECTOR 6.1,
Lahore.
 [LAHORE ] 
   
 Phone:
 92021-6974878
 Mobile:
 0333-66566 
 Fax:
 92021-6901145
   
   
   http://www.ababasons.com

 >ABC & CO 

   
  240/2, SECTOR 6.1,
NORTH KARACHI,
 KARACHI.
 [KARACHI ] 
   
 Phone:
 92021-6974878
 Mobile:
 033-565659
 Fax:
 92021-6118625 
   
   
   http://www.ababasons.com

 >ARahat Textile 

   
  240/2, SECTOR 6.1,
NORTH KARACHI,
 KARACHI.
 [KARACHI ] 
   
 Phone:
 92021-6974878
 Mobile:
   
 Fax:
 92021-6966625 
   
   
   http://www.ababasons.com

 >A. Corvid Ltd 

   
  240/2, SECTOR 6.1,
NORTH Peshawar
 [PESHAWAR ] 
   
 Phone:
 92021-6974878
 Mobile:
 0332-656656 
 Fax:
 92021-69086265
   

--
Tariq Murtaza
Assistant Web Master
Business Technology Team
Small & Medium Enterprise Development Authority




--
Tariq Murtaza
Assistant Web Master
Business Technology Team
Small & Medium Enterprise Development Authority



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



Re: [PHP] PHP Page Refresh on Redirection

2003-01-27 Thread Justin French
on 28/01/03 4:42 PM, Phil ([EMAIL PROTECTED]) wrote:

> I have a PHP page with a form that submits to another PHP processing page.
> On completion of the PHP actions on the processing page, I have echoed into
> the page the javascript action of 'location.href=...' and the location is
> redirected to the PHP form page that starting the process. Both pages take
> data from an SQL server. The problem I'm having is that the the javascript
> always grabs the cached page. I need a newly refreshed page to return with
> updated data from the SQL server. Any suggestions?

In addition to sending the correct no-cache headers (which don't always work
with certain browsers and clients), you could also attach a random string to
the URL as a GET variable, so that the browser thinks it's a NEW, unread
URL.

include this function (straight from the manual) via a function library:


Then to get a random number,



Then you can echo it as a get var or querystring on any URL:

location.href = page.php?r=
location.href = page.php?


Justin


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




[PHP] Good way to organize code using classes???

2003-01-27 Thread @ Nilaab
Hello everyone,

I want to be able to use objects to create my future pages. My goal is to
use methods of classes to make the original front-line script easier to
read, while all the processing is done with a simple call to the different
classes from a single class. Please read futher, as I'll get to a point and
to my question...

I have many classes that do different tasks, like formValidator.class,
stringManipulator.class, db.class, fileManipulation.class, template.class,
etc (these are self-explanitory as their names suggest). Then, I might have
a class called category.class that adds, deletes, edits, moves, and renames
categories within the filesystem and database. But I would have a front-line
script called category.php that would call the necessary methods of
category.class at certain points, depending on the task being done on a
specific step.

In other words I want category.class to call the other classes and do
something with them, then in turn I want category.php to call objects in
category.class for a specific task, such as:

addCategory($new_cat_name);
// or
$cat->editCategory($cat_name);
// or
$cat->deleteCategory($cat_name);
// or
$cat->moveCategory($cat_name);
// or
$cat->renameCategory($cat_name);

?>


My question is:

How can I call a class within another class and do something with it? Right
now I'm doing it the most convenient way I know, which is including other
classes using the include() function within the methods of the
category.class. There is no multiple-inheritance allowed in PHP, so I can
only use inheritance on one class.

I am also extremely skeptical about creating too many classes at a time in
one script. Do the above examples degrade performance speed of the script
when I call too many classes? Also, isn't there a way to use sessions to
save created classes and then use them again for other scripts without the
need to make a new instance of the same class again and again?

I am really looking for a better way to organize my code while still being
able to use these classes whenever I need them and at the same time keeping
the category.php file clean and easy to read. Is there a tutorial on how to
organize code? I'm not looking for html template tutorials. Just how to get
around inheritance limits while still keeping performance and clean-code in
mind.

Here's an example of what category.class might look like:

formatCat($new_cat_name);

// Validate Form Values
$formVal = new formValidator();
$formVal->addCatVal($new_cat_name);

// Add A Folder To Hold Category Files
$file = new fileManipulator();
$file->createFolder($cat_path.$cat_dir);

// And so on...
   }
}





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




RE: [PHP] PHP Page Refresh on Redirection

2003-01-27 Thread John W. Holmes
> I have a PHP page with a form that submits to another PHP processing
page.
> On completion of the PHP actions on the processing page, I have echoed
> into
> the page the javascript action of 'location.href=...' and the location
is
> redirected to the PHP form page that starting the process. Both pages
take
> data from an SQL server. The problem I'm having is that the the
javascript
> always grabs the cached page. I need a newly refreshed page to return
with
> updated data from the SQL server. Any suggestions?

You may be able to use the header() function to send headers telling the
browser not to cache the page. Take a look at the header() manual page
and there is an example (6th gray box).

www.php.net/header

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/



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




[PHP] PHP Page Refresh on Redirection

2003-01-27 Thread Phil
I have a PHP page with a form that submits to another PHP processing page.
On completion of the PHP actions on the processing page, I have echoed into
the page the javascript action of 'location.href=...' and the location is
redirected to the PHP form page that starting the process. Both pages take
data from an SQL server. The problem I'm having is that the the javascript
always grabs the cached page. I need a newly refreshed page to return with
updated data from the SQL server. Any suggestions?



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




[PHP] How to convert HTML Table structure to DB schema or XML format

2003-01-27 Thread Tariq Murtaza
Hi All,

How to convert HTML Table structure to DB schema or XML format
Here is the sample table

Looking for your commnets / directions
(Note: I dont know about regular expressions much :( )

Regards  Tariq



   http://www.ababasons.com

 >A. BABA & SONS 
   
  240/2, SECTOR 6.1,
Lahore.
 [LAHORE ] 
   
 Phone:
 92021-6974878
 Mobile:
 0333-66566 
 Fax:
 92021-6901145
   
   
   http://www.ababasons.com

 >ABC & CO 

   
  240/2, SECTOR 6.1,
NORTH KARACHI,
 KARACHI.
 [KARACHI ] 
   
 Phone:
 92021-6974878
 Mobile:
 033-565659
 Fax:
 92021-6118625 
   
   
   http://www.ababasons.com

 >ARahat Textile 

   
  240/2, SECTOR 6.1,
NORTH KARACHI,
 KARACHI.
 [KARACHI ] 
   
 Phone:
 92021-6974878
 Mobile:
   
 Fax:
 92021-6966625 
   
   
   http://www.ababasons.com

 >A. Corvid Ltd 

   
  240/2, SECTOR 6.1,
NORTH Peshawar
 [PESHAWAR ] 
   
 Phone:
 92021-6974878
 Mobile:
 0332-656656 
 Fax:
 92021-69086265
   




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




Re: [PHP] Access to Pear

2003-01-27 Thread jacob
> Then the only thing you have to change from windows to linux is the 
> ROOT_PATH_DELIMITER (comment it out). 

I meant to say remove the value:
define('ROOT_PATH_DELIMITER', '');

Quoting [EMAIL PROTECTED]:

> You could download the pear files from the pear CVS to somewhere within your
> 
> programs path. If your web files are in (using a linux 
> example) /home/foo/public_html then just change to that directory and
> checkout 
> the files from CVS. This also gives you the luxury of keeping the pear files
> 
> uptodate yourself (cd pear; cvs update). Information on getting pear from the
> 
> CVS can be found here http://www.onlamp.com/lpt/a/882 (scroll down).
> 
> Another option would be to keep everything they way it is and use a full path
> 
> to the include files. You can set the include path in a main settings file 
> somewhere:
> 
> define('DIR_PEAR', '/apache/php/pear');
> include(DIR_PEAR . 'DB.php');
> 
> Of course you would need to have the settings file included in all your 
> scripts (but this is a common thing for larger apps).
> 
> If you want it to dynamically switch depending on windows or linux, using
> full 
> paths, you could try something like (taken from pear DB, if I remember right
> - 
> using a shared settings file as well):
> // try windows
> define('ROOT_PATH_DELIMITER', 'C:');
> 
> define('SMART_PATH_DELIMITER', (substr(PHP_OS, 0, 3) == 'WIN') ? '\\' : '/'
> );
> define('DIR_PEAR', ROOT_PATH_DELIMITER . SMART_PATH_DELIMITER . 'apache' . 
> SMART_PATH_DELIMITER . 'php' . SMART_PATH_DELIMITER . 'pear');
> include(DIR_PEAR . SMART_PATH_DELIMITER . 'DB.php');
> 
> Then the only thing you have to change from windows to linux is the 
> ROOT_PATH_DELIMITER (comment it out). I did this quickly so not sure if it 
> works. Play around - I'm sure you will find something you can work with.
> 
> OR you can manually set your include path at the start of your app:
> 
> ini_set('include_path', '.:..:../..:/apache/php/pear'); // searches 
> through  ./foo.inc, ../foo.inc, ../../foo.inc, /apache/php/pear/foo.inc
> 
> good luck
> 
> Quoting Warren Vail <[EMAIL PROTECTED]>:
> 
> > 
> > I know how to load extensions if they are not included in PHP.ini (dl
> > function), but how do I gain access to PEAR?
> > 
> > I can see the directory /apache/php/pear/ on my test machine, but when I
> try
> > to reference via
> > 
> > include_once("DB.php");
> > 
> > not found on include list error, can I dynamically change include
> list,
> > and what kind of security hole would that represent?  my test machine is
> > windows, and my production machine is Redhat Linux, so I need to find a
> way
> > to gain access to pear in both environments.
> > 
> > Warren Vail
> > [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 General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Access to Pear

2003-01-27 Thread jacob
You could download the pear files from the pear CVS to somewhere within your 
programs path. If your web files are in (using a linux 
example) /home/foo/public_html then just change to that directory and checkout 
the files from CVS. This also gives you the luxury of keeping the pear files 
uptodate yourself (cd pear; cvs update). Information on getting pear from the 
CVS can be found here http://www.onlamp.com/lpt/a/882 (scroll down).

Another option would be to keep everything they way it is and use a full path 
to the include files. You can set the include path in a main settings file 
somewhere:

define('DIR_PEAR', '/apache/php/pear');
include(DIR_PEAR . 'DB.php');

Of course you would need to have the settings file included in all your 
scripts (but this is a common thing for larger apps).

If you want it to dynamically switch depending on windows or linux, using full 
paths, you could try something like (taken from pear DB, if I remember right - 
using a shared settings file as well):
// try windows
define('ROOT_PATH_DELIMITER', 'C:');

define('SMART_PATH_DELIMITER', (substr(PHP_OS, 0, 3) == 'WIN') ? '\\' : '/' );
define('DIR_PEAR', ROOT_PATH_DELIMITER . SMART_PATH_DELIMITER . 'apache' . 
SMART_PATH_DELIMITER . 'php' . SMART_PATH_DELIMITER . 'pear');
include(DIR_PEAR . SMART_PATH_DELIMITER . 'DB.php');

Then the only thing you have to change from windows to linux is the 
ROOT_PATH_DELIMITER (comment it out). I did this quickly so not sure if it 
works. Play around - I'm sure you will find something you can work with.

OR you can manually set your include path at the start of your app:

ini_set('include_path', '.:..:../..:/apache/php/pear'); // searches 
through  ./foo.inc, ../foo.inc, ../../foo.inc, /apache/php/pear/foo.inc

good luck

Quoting Warren Vail <[EMAIL PROTECTED]>:

> 
> I know how to load extensions if they are not included in PHP.ini (dl
> function), but how do I gain access to PEAR?
> 
> I can see the directory /apache/php/pear/ on my test machine, but when I try
> to reference via
> 
> include_once("DB.php");
> 
> not found on include list error, can I dynamically change include list,
> and what kind of security hole would that represent?  my test machine is
> windows, and my production machine is Redhat Linux, so I need to find a way
> to gain access to pear in both environments.
> 
> Warren Vail
> [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




Re[2]: [PHP] Too many 'linespaces'

2003-01-27 Thread Tom Rogers
Hi,

Tuesday, January 28, 2003, 12:47:05 PM, you wrote:
LE> You mean to comment out the while sentence?
LE> A do-while-loop won't work without the while-part would it? Comments are
LE> suplements to understand the code, not needed for the code to work.

LE> Thanks anyway


LE> "Tom Rogers" <[EMAIL PROTECTED]> skrev i melding
LE> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>> Hi,
>>
>> Tuesday, January 28, 2003, 12:24:21 PM, you wrote:
>> LE> Hello,
>>
>> LE> I present some content of a mysql-table in an html-table. When the
LE> query
>> LE> which collects the content contains few rows I get the amount of space
LE> I
>> LE> want between the output and the above content. But when I get for
LE> instance
>> LE> 60 rows, the printed result jumps down about 7 lines. I would like to
LE> have
>> LE> the same small gap between the result of the query and the above
LE> content.
>>
>> LE> The code is as follows:
>>
>> LE> ..snip.
>>
>> LE>  
>> LE>   
>> LE>    >
>> LE> 
>> LE>   
>> LE> 
>>
>> LE>   
>> LE> 
>> LE>   > LE>  //checks if there exists any rows
>> LE>  if($totalRows_Recordset1 > 0) {
>> LE>  ?>
>>
>> LE>   
>> LE> 
>> LE> ..around here the printed result jumps many rows down
>> LE>   Kontonr.
>> LE>   Delkontonr.
>> LE>   Tekst
>> LE>   Kostnad
>> LE>   Enhet
>> LE> 
>> LE>  
>> LE> > LE>   $kontonr = $row_Recordset1['mKontonr'];
>> LE>   $delkontonr = $row_Recordset1['mDelkontonr'];
>> LE>   if ($delkontonr == 0) { $strong = ''; $strong2 =
>> LE> ''; }
>> LE>   else { $strong = ''; $strong2 = ''; }
>> LE>  ?>
>> LE> 
>> LE>   > LE> fjern_null($row_Recordset1['mHovedkonto']) . $strong2; ?>
>> LE>   > LE> $row_Recordset1['mDelkontonr'] . $strong2; ?>
>> LE>   > LE> $row_Recordset1['mKontotekst'] . $strong2; ?>
>> LE>   > LE> fjern_null($row_Recordset1['mKostnad']) . $strong2; ?>
>> LE>$row_Recordset1['mEnhet'] .
>> $strong2; ?>>
>> LE> 
>> LE> 
>> LE> 
>> LE> > LE> mysql_fetch_assoc($Recordset1)); ?>
>> LE>   
>>
>>
>>
>> LE>   > LE>} //if($totalRows_Recordset1 > 0) {
>> LE>?>
>> LE> 
>> LE> 
>> LE>
>>
>> LE> .. and so on 
>>
>>
>> LE> When the query returns 60 rows I get ca. 7 blank lines between  echo
>> LE> $row_Recordset1['mModell']; ?> and Kontonr.
>>
>> LE> Does anyone understand? Anyone have a tip?
>>
>> LE> Thanks a lot!
>>
>> LE> Lars
>>
>>
>>
>>
>> maybe this line needs changing  mysql_fetch_assoc($Recordset1)); ?>
>> to:
>> 
>>
>> I think you need the comment
>>
>> --
>> regards,
>> Tom
>>

True :) I missed the do bit , doing it that way means it will print out empty
values for the first run. You should make it a normal while loop or at least
fetch the first row before hitting the loop.

-- 
regards,
Tom


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




RE: [PHP] Too many 'linespaces'

2003-01-27 Thread John W. Holmes
[snip]
> 
> 
> 
>  mysql_fetch_assoc($Recordset1)); ?>
>   

Your problem is probably right here. Why do you have output between the
 and  tag? Since that doesn't make sense, there shouldn't
be any data there, it's now up to your browser to decide where to place
it. Most browsers will bunch it all together before or after the table.
So place your commented out  tag inside or outside of your table.

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/



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




[PHP] Re: multiple entry forms !!

2003-01-27 Thread Manuel Lemos
On 01/27/2003 09:20 PM, Scott wrote:

hi

looking for some advice

I have a site in progress. user to it have to enter a LOT of information (it
will contain a club directory)

in order to try and make it a less unpleasant experience for the user, I
want to give them 7 smaller input forms, each one following the other

what would be the correct way to do this, one very large, complex coded php
conditional form that does everything, or several smaller ones ?

if I use one form, it will conatin rather a lot of code, but execution would
all be handled by the form itself

but if I use multiple smaller forms, each form would need to process the
previous forms input, and then display it's inputs for entry

I am also using sessions, which adds a little to complexity

any general good coding practice tips/links would be helpful


If you mean a form split in multiple pages, you may want to try this 
class because it provides exactly that, either in sequential (Wizard) 
mode with |Next >|, |< Back|, |Finish >>| buttons, or in random access 
(tabbed pages) mode where you can go from any form page to any other 
with Edit, Update, Cancel buttons:

http://www.phpclasses.org/multipageforms


--

Regards,
Manuel Lemos


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



[PHP] Access to Pear

2003-01-27 Thread Warren Vail

I know how to load extensions if they are not included in PHP.ini (dl
function), but how do I gain access to PEAR?

I can see the directory /apache/php/pear/ on my test machine, but when I try
to reference via

include_once("DB.php");

not found on include list error, can I dynamically change include list,
and what kind of security hole would that represent?  my test machine is
windows, and my production machine is Redhat Linux, so I need to find a way
to gain access to pear in both environments.

Warren Vail
[EMAIL PROTECTED]



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




Re: [PHP] Too many 'linespaces'

2003-01-27 Thread Lars Espelid
You mean to comment out the while sentence?
A do-while-loop won't work without the while-part would it? Comments are
suplements to understand the code, not needed for the code to work.

Thanks anyway


"Tom Rogers" <[EMAIL PROTECTED]> skrev i melding
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi,
>
> Tuesday, January 28, 2003, 12:24:21 PM, you wrote:
> LE> Hello,
>
> LE> I present some content of a mysql-table in an html-table. When the
query
> LE> which collects the content contains few rows I get the amount of space
I
> LE> want between the output and the above content. But when I get for
instance
> LE> 60 rows, the printed result jumps down about 7 lines. I would like to
have
> LE> the same small gap between the result of the query and the above
content.
>
> LE> The code is as follows:
>
> LE> ..snip.
>
> LE>  
> LE>   
> LE>    
> LE> 
> LE>   
> LE> 
>
> LE>   
> LE> 
> LE>LE>  //checks if there exists any rows
> LE>  if($totalRows_Recordset1 > 0) {
> LE>  ?>
>
> LE>   
> LE> 
> LE> ..around here the printed result jumps many rows down
> LE>   Kontonr.
> LE>   Delkontonr.
> LE>   Tekst
> LE>   Kostnad
> LE>   Enhet
> LE> 
> LE>  
> LE>  LE>   $kontonr = $row_Recordset1['mKontonr'];
> LE>   $delkontonr = $row_Recordset1['mDelkontonr'];
> LE>   if ($delkontonr == 0) { $strong = ''; $strong2 =
> LE> ''; }
> LE>   else { $strong = ''; $strong2 = ''; }
> LE>  ?>
> LE> 
> LE>LE> fjern_null($row_Recordset1['mHovedkonto']) . $strong2; ?>
> LE>LE> $row_Recordset1['mDelkontonr'] . $strong2; ?>
> LE>LE> $row_Recordset1['mKontotekst'] . $strong2; ?>
> LE>LE> fjern_null($row_Recordset1['mKostnad']) . $strong2; ?>
> LE>$strong2; ?>>
> LE> 
> LE> 
> LE> 
> LE>  LE> mysql_fetch_assoc($Recordset1)); ?>
> LE>   
>
>
>
> LE>LE>} //if($totalRows_Recordset1 > 0) {
> LE>?>
> LE> 
> LE> 
> LE>
>
> LE> .. and so on 
>
>
> LE> When the query returns 60 rows I get ca. 7 blank lines between  LE> $row_Recordset1['mModell']; ?> and Kontonr.
>
> LE> Does anyone understand? Anyone have a tip?
>
> LE> Thanks a lot!
>
> LE> Lars
>
>
>
>
> maybe this line needs changing 
> to:
> 
>
> I think you need the comment
>
> --
> regards,
> Tom
>



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




Re: [PHP] Session Variables

2003-01-27 Thread Leif K-Brooks
$HTTP_SESSION_VARS and $_SESSION don't magically update when you add a 
session variable with session_register().

Jed R. Brubaker wrote:

I have a quirky problem that should be a breeze for someone who is smarter
than I.

I have a script where I am registering a HTML form post variable as a
session variable and then echo it. In the real script I use it in a MySQL
query, but for the sake of this post, here is the "script":

$user1 = $HTTP_POST_VARS["user1"];
session_register("user1");
echo $HTTP_SESSION_VARS["user1"];

This doesn't work, however, if I hit the refresh button the var miraculously
appears!
What am I doing wrong?



 


--
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] Too many 'linespaces'

2003-01-27 Thread Tom Rogers
Hi,

Tuesday, January 28, 2003, 12:24:21 PM, you wrote:
LE> Hello,

LE> I present some content of a mysql-table in an html-table. When the query
LE> which collects the content contains few rows I get the amount of space I
LE> want between the output and the above content. But when I get for instance
LE> 60 rows, the printed result jumps down about 7 lines. I would like to have
LE> the same small gap between the result of the query and the above content.

LE> The code is as follows:

LE> ..snip.

LE>  
LE>   
LE>    
LE> 
LE>   
LE> 

LE>   
LE> 
LE> //checks if there exists any rows
LE>  if($totalRows_Recordset1 > 0) {
LE>  ?>

LE>   
LE> 
LE> ..around here the printed result jumps many rows down
LE>   Kontonr.
LE>   Delkontonr.
LE>   Tekst
LE>   Kostnad
LE>   Enhet
LE> 
LE>  
LE>$kontonr = $row_Recordset1['mKontonr'];
LE>   $delkontonr = $row_Recordset1['mDelkontonr'];
LE>   if ($delkontonr == 0) { $strong = ''; $strong2 =
LE> ''; }
LE>   else { $strong = ''; $strong2 = ''; }
LE>  ?>
LE> 
LE>fjern_null($row_Recordset1['mHovedkonto']) . $strong2; ?>
LE>$row_Recordset1['mDelkontonr'] . $strong2; ?>
LE>$row_Recordset1['mKontotekst'] . $strong2; ?>
LE>fjern_null($row_Recordset1['mKostnad']) . $strong2; ?>
LE>   >
LE> 
LE> 
LE> 
LE>  mysql_fetch_assoc($Recordset1)); ?>
LE>   



LE>   } //if($totalRows_Recordset1 > 0) {
LE>?>
LE> 
LE> 
LE>

LE> .. and so on 


LE> When the query returns 60 rows I get ca. 7 blank lines between  $row_Recordset1['mModell']; ?> and Kontonr.

LE> Does anyone understand? Anyone have a tip?

LE> Thanks a lot!

LE> Lars




maybe this line needs changing 
to:


I think you need the comment

-- 
regards,
Tom


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




[PHP] Too many 'linespaces'

2003-01-27 Thread Lars Espelid
Hello,

I present some content of a mysql-table in an html-table. When the query
which collects the content contains few rows I get the amount of space I
want between the output and the above content. But when I get for instance
60 rows, the printed result jumps down about 7 lines. I would like to have
the same small gap between the result of the query and the above content.

The code is as follows:

..snip.

 
  
   

  


  

   0) {
 ?>

  

..around here the printed result jumps many rows down
  Kontonr.
  Delkontonr.
  Tekst
  Kostnad
  Enhet

 
'; $strong2 =
''; }
  else { $strong = ''; $strong2 = ''; }
 ?>

  
  
  
  
  




  



   0) {
   ?>


   

.. and so on 


When the query returns 60 rows I get ca. 7 blank lines between  and Kontonr.

Does anyone understand? Anyone have a tip?

Thanks a lot!

Lars



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




RE: [PHP] Anyone?? file uploads received, but mangled

2003-01-27 Thread af
I don't believe it -- it's another IE "feature"!!  It doesn't happen in Netscape 7.  
Not completely sure, but I think the binary data is the mac-specific type/creator code 
which apparently IE feels the need to prepend.  I thought I was safe now that I've 
dumped OS 9 entirely and moved everything to OS X, but I guess not.

Btw, I finally figured out a way of stripping the binary data with a regexp (after 
struggling for a while before discovering that fgets is not binary safe!), but still, 
it's a hack that I'd rather not have to use.  Honestly, Microsoft is the bane of my 
existence.  Every time it tries to "help", it gets it wrong.

Thanks to everyone for the suggestions.  Sometimes the eyes blur and the mind freezes 
over at times like these, and it takes external input to get un-frozen.

Cheers...
Alex
[EMAIL PROTECTED]



> Are you using Apache 2?
> 
> ---John W. Holmes...




> > Last try -- I know there's a lot of noise in this group, but could someone
> > please offer an opinion?
> > 
> > Is the following possible to work around, or is it a bug that I should be
> > reporting?
> > 
> > I'm having issues uploading files whose names don't necessarily end with
> > the correct extension, in particular plain text files which don't end in
> > .txt.  (Why they don't is complicated, and it's impractical to insist that
> > they must.)  The files are received, but altered -- they are prepended
> > with garbage data which makes them difficult to deal with in an elegant
> > automated way, which is the whole point.
> > 
> > No doubt this is a mime type issue, as the files are received as type
> > "application/x-macbinary" when sent from OSX IE (its best guess, I
> > suppose).  Is there any way to force plain text, or raw data?  All I want
> > to happen is for the files to be uploaded completely unchanged.
> > 
> > Btw, this happens with PHP 4.2.3 on OSX (entropy.ch), and with the latest
> > 4.3 on OpenBSD.


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




Re: [PHP] multiple entry forms !!

2003-01-27 Thread Justin French
on 28/01/03 10:20 AM, scott ([EMAIL PROTECTED]) wrote:

> hi
> 
> looking for some advice
> 
> I have a site in progress. user to it have to enter a LOT of information (it
> will contain a club directory)
> 
> in order to try and make it a less unpleasant experience for the user, I
> want to give them 7 smaller input forms, each one following the other
>
> what would be the correct way to do this, one very large, complex coded php
> conditional form that does everything, or several smaller ones ?

one script to "run" the form with decent logic to break it up into a few
sections... but that's makes reading/updating the script difficult, so I
prefer to include() the HTML code for each form, and in some cases, eve
include() the main programming for each "section"


> if I use one form, it will conatin rather a lot of code, but execution would
> all be handled by the form itself
> 
> but if I use multiple smaller forms, each form would need to process the
> previous forms input, and then display it's inputs for entry
> 
> I am also using sessions, which adds a little to complexity

actually, they help!!  You can save the contents of form1 into the session
before showing form2, then adding the contents of form2 before showing
form3, etc etc.  Much easier than setting cookies, writing hidden inputs on
subsequent forms, etc etc.

> any general good coding practice tips/links would be helpful

Use $_GET variables to keep track of which part of the form you are upto,
and what you are doing.

I'd suggest this is a lot clearer than reyling on $_POST['submit'] being
true or anything else like that.

So, maybe you have a few status':

- status=showForm
- status=validate


And for both modes, you would tell the script which form part to
show/validate using a GET variable formPart (=1,=2, etc)


So when the script first loads, set a default of status=showForm and a
formPart=1





Then BEFORE anything is sent to the browser, validating would usually take
place, so that you can do any redirects or anything like that.  The way I've
set it up, is that each form part has it's own php script with some code to
validate the form entry.



I'll show a sample of these include files later.  The aim of MY include
files is to return a var $validEntry of true or false... based on that, I
can decide whether to add the form contents to the session / database, or
whether I should show the form again, due to errors.



That (roughly) takes care of validating each form entry, keeping track of
all the vars with sessions or adding to a DB, and passing people onto the
next form part.

Then you'd want a few lines of HTML, then some code to show the right
formPart's HTML code, and a few lines to clode off the HTML.

if($status = 'showForm')
{
?>

form






The secret is that we're using include files to make sure the form's code
base isn't messy.


The whole script in one:


---


form





---



As for the include files, you can do whatever you like.  For a 3 part form,
you'd have 6 include files -- 3 for validating code, and 3 for HTML code for
each form.  An example of a simple HTML file would be:



Name:

Shoe Size:




Then the validate script for this part would be:



... this only makes sure they were both entered... I'm sure you'd want to do
more, but I'm sick of typing :)



That's probably wy more than you wanted to think about, but once I
started typing, I found it hard to stop :)

Good luck.


Justin


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




[PHP] Re: PHP vs Perl for system scripts (non-web)

2003-01-27 Thread Philip Hallstrom
Unless you've got a compelling reason to switch to Perl, I wouldn't.  I
like Perl, but like you have used PHP a lot more often in the last couple
of years.

Where I find it really nice is when my cron scripts need to use the same
libraries as my web scripts...

-philip

On Mon, 27 Jan 2003, Paul Chvostek wrote:

>
> I have to write a swath of code to manage system-related stuff based on
> database content.  Scripts will be run as root by cron, and determine
> what they have to do via user interaction and SQL lookups.  Functions
> will include manipulation of system configuration files, legacy text
> file configs, and some signalling with posix_kill.  On some of the
> machines in question, there won't even be an httpd installed, so I'd be
> building a php as a standalone binary, and running it with shell magic
> and a -q option.  I've done this kind of stuff in the past in smaller
> environments, and it seems to work nicely.
>
> I'm more comfortable writing stuff in PHP.  I use PHP alot more, and I
> find the resultant code more readable and easier to maintain.  Aside
> from Perl's ubiquity and the dubious advantage of future flexibility by
> using Perl's DBI interface to talk to different SQL servers (I'm using
> MySQL at the moment), are there any compelling reasons I should write
> system stuff in Perl rather than PHP?
>
> Thanks.
>
> --
>   Paul Chvostek <[EMAIL PROTECTED]>
>   Operations / Abuse / Whatever
>   it.canada, hosting and development   http://www.it.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




[PHP] Re: PHP vs Perl for system scripts (non-web)

2003-01-27 Thread Alex
If you like php better, i'd stick with it; however, for almost all of my
un-web-related stuff, i use perl.

i'm pretty sure they would run at about the same speeds/efficency.

"Paul Chvostek" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>
> I have to write a swath of code to manage system-related stuff based on
> database content.  Scripts will be run as root by cron, and determine
> what they have to do via user interaction and SQL lookups.  Functions
> will include manipulation of system configuration files, legacy text
> file configs, and some signalling with posix_kill.  On some of the
> machines in question, there won't even be an httpd installed, so I'd be
> building a php as a standalone binary, and running it with shell magic
> and a -q option.  I've done this kind of stuff in the past in smaller
> environments, and it seems to work nicely.
>
> I'm more comfortable writing stuff in PHP.  I use PHP alot more, and I
> find the resultant code more readable and easier to maintain.  Aside
> from Perl's ubiquity and the dubious advantage of future flexibility by
> using Perl's DBI interface to talk to different SQL servers (I'm using
> MySQL at the moment), are there any compelling reasons I should write
> system stuff in Perl rather than PHP?
>
> Thanks.
>
> --
>   Paul Chvostek <[EMAIL PROTECTED]>
>   Operations / Abuse / Whatever
>   it.canada, hosting and development   http://www.it.ca/
>



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




Re: [PHP] HELP session cache limiters

2003-01-27 Thread Didier McGillis
Nevermind, I have found the person who fooled with the code and then lied 
about being in the file.






From: "Matt" <[EMAIL PROTECTED]>
To: "Didier McGillis" <[EMAIL PROTECTED]>, <[EMAIL PROTECTED]>
Subject: Re: [PHP] HELP session cache limiters
Date: Mon, 27 Jan 2003 19:48:31 -0500

- Original Message -
> From: "Didier McGillis" <[EMAIL PROTECTED]>
> Sent: Monday, January 27, 2003 7:14 PM
> Subject: [PHP] HELP session cache limiters
>
> Any thoughts on this error?
>
> Warning: Cannot send session cache limiter - headers already sent 
(output
> started at 
/home/sisource/public_html/stage/administration/config.php:19)
in

What's happening at line 19 in
/home/sisource/public_html/stage/administration/config.php?


_
The new MSN 8: advanced junk mail protection and 2 months FREE*  
http://join.msn.com/?page=features/junkmail


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



Re: [PHP] HELP session cache limiters

2003-01-27 Thread Matt
- Original Message -
> From: "Didier McGillis" <[EMAIL PROTECTED]>
> Sent: Monday, January 27, 2003 7:14 PM
> Subject: [PHP] HELP session cache limiters
>
> Any thoughts on this error?
>
> Warning: Cannot send session cache limiter - headers already sent (output
> started at /home/sisource/public_html/stage/administration/config.php:19)
in

What's happening at line 19 in
/home/sisource/public_html/stage/administration/config.php?



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




Re: [PHP] output of fread() is blank - FIXED - updated

2003-01-27 Thread Guru Geek
In all actuality I will be manipulating the information that is in that file.

I'm trying to build a log in script.  The id's and passwords are stored in a
text file.  I'm trying to read that text file so I can compare what the
user/viewer had typed in the id and password boxes.  I'm so new to PHP I'm
taking it in baby steps...

Philip Olson wrote:

> On Mon, 27 Jan 2003, Guru Geek wrote:
>
> > Sorry, here is the code now ( I need a nap )
> >
> > $filename
> > ="/usr/local/plesk/apache/vhosts/myserver.com/httpdocs/include/text.txt";
> > $handle = fopen ($filename, "r");
> > $contents = fread ($handle, filesize ($filename));
> > fclose ($handle);
> > echo $contents;
> > exit;
>
> For something like this, just use readfile() and not fread
> as it'd be much more efficient if you don't actually manipulate
> the string $contents.  So:
>
>   readfile($filename);  // note: do not use echo
>
> Also, what is your include_path setting?  It's important
> you know it and what it means as that'll answer the
> question in your last post:
>
>   print ini_get('include_path');
>   http://www.php.net/manual/configuration.directives.php#ini.include-path
>
> Also, no need for "exit" here as that happens automatically.
>
> Regards,
> Philip



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




RE: [PHP] Anyone?? file uploads received, but mangled

2003-01-27 Thread John W. Holmes
> Last try -- I know there's a lot of noise in this group, but could
someone
> please offer an opinion?
> 
> Is the following possible to work around, or is it a bug that I should
be
> reporting?
> 
> I'm having issues uploading files whose names don't necessarily end
with
> the correct extension, in particular plain text files which don't end
in
> .txt.  (Why they don't is complicated, and it's impractical to insist
that
> they must.)  The files are received, but altered -- they are prepended
> with garbage data which makes them difficult to deal with in an
elegant
> automated way, which is the whole point.
> 
> No doubt this is a mime type issue, as the files are received as type
> "application/x-macbinary" when sent from OSX IE (its best guess, I
> suppose).  Is there any way to force plain text, or raw data?  All I
want
> to happen is for the files to be uploaded completely unchanged.
> 
> Btw, this happens with PHP 4.2.3 on OSX (entropy.ch), and with the
latest
> 4.3 on OpenBSD.

Are you using Apache 2?

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/



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




Re: [PHP] output of fread() is blank - FIXED - updated

2003-01-27 Thread Philip Olson
On Mon, 27 Jan 2003, Guru Geek wrote:

> Sorry, here is the code now ( I need a nap )
> 
> $filename
> ="/usr/local/plesk/apache/vhosts/myserver.com/httpdocs/include/text.txt";
> $handle = fopen ($filename, "r");
> $contents = fread ($handle, filesize ($filename));
> fclose ($handle);
> echo $contents;
> exit;

For something like this, just use readfile() and not fread 
as it'd be much more efficient if you don't actually manipulate 
the string $contents.  So:

  readfile($filename);  // note: do not use echo

Also, what is your include_path setting?  It's important
you know it and what it means as that'll answer the
question in your last post:

  print ini_get('include_path');
  http://www.php.net/manual/configuration.directives.php#ini.include-path

Also, no need for "exit" here as that happens automatically.

Regards,
Philip


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




[PHP] HELP session cache limiters

2003-01-27 Thread Didier McGillis
I dont know where this came from.  The site was working fine, unless someone 
else on my team made a fix in this file.

Any thoughts on this error?

Warning: Cannot send session cache limiter - headers already sent (output 
started at /home/sisource/public_html/stage/administration/config.php:19) in 
/home/sisource/public_html/stage/administration/phpSecurePages/checklogin.php 
on line 134








_
Tired of spam? Get advanced junk mail protection with MSN 8.  
http://join.msn.com/?page=features/junkmail


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



Re: [PHP] output of fread() is blank - FIXED - updated

2003-01-27 Thread Guru Geek
Sorry, here is the code now ( I need a nap )

$filename
="/usr/local/plesk/apache/vhosts/myserver.com/httpdocs/include/text.txt";
$handle = fopen ($filename, "r");
$contents = fread ($handle, filesize ($filename));
fclose ($handle);
echo $contents;
exit;



Guru Geek wrote:

> Here's my code now:
>
> $filename =
> "/usr/local/plesk/apache/vhosts/myserver.com/httpdocs/include/text.txt";
> $handle = fopen ($filename, "r");
> $contents = fread ($handle, filesize ($filename));
> fclose ($handle);
> echo readfile($filename);
> exit;
>
> now it displays the contents of the text.txt file.  I originally had just
> /include/text.txt but it told me no such file existed.  But once I added the
> root directory stuff in front of that, it works.
>
> I'm having a similar problem getting smarty to run, it keeps telling me that
> it can't find index.tpl and now I think I know what the problem is...
>
> Thanks to everyone
>
> --
> 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 vs Perl for system scripts (non-web)

2003-01-27 Thread Paul Chvostek

I have to write a swath of code to manage system-related stuff based on
database content.  Scripts will be run as root by cron, and determine
what they have to do via user interaction and SQL lookups.  Functions
will include manipulation of system configuration files, legacy text
file configs, and some signalling with posix_kill.  On some of the
machines in question, there won't even be an httpd installed, so I'd be
building a php as a standalone binary, and running it with shell magic
and a -q option.  I've done this kind of stuff in the past in smaller
environments, and it seems to work nicely.

I'm more comfortable writing stuff in PHP.  I use PHP alot more, and I
find the resultant code more readable and easier to maintain.  Aside
from Perl's ubiquity and the dubious advantage of future flexibility by
using Perl's DBI interface to talk to different SQL servers (I'm using
MySQL at the moment), are there any compelling reasons I should write
system stuff in Perl rather than PHP?

Thanks.

-- 
  Paul Chvostek <[EMAIL PROTECTED]>
  Operations / Abuse / Whatever
  it.canada, hosting and development   http://www.it.ca/


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




Re: [PHP] output of fread() is blank - FIXED

2003-01-27 Thread Guru Geek
Here's my code now:

$filename =
"/usr/local/plesk/apache/vhosts/myserver.com/httpdocs/include/text.txt";
$handle = fopen ($filename, "r");
$contents = fread ($handle, filesize ($filename));
fclose ($handle);
echo readfile($filename);
exit;

now it displays the contents of the text.txt file.  I originally had just
/include/text.txt but it told me no such file existed.  But once I added the
root directory stuff in front of that, it works.

I'm having a similar problem getting smarty to run, it keeps telling me that
it can't find index.tpl and now I think I know what the problem is...

Thanks to everyone



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




[PHP] Re: mail () format

2003-01-27 Thread Philip Hallstrom
Something like...

$body  = "blah blah blah\n";
$body .= "Name = $name\n";
$body .= "Address = $address\n";
$body .= "Comments = $comments\n";

mail("[EMAIL PROTECTED]", "subject", $body);

would do it.

On Tue, 28 Jan 2003, Bruce Levick wrote:

> I have a number of field entries that I am trying to send through to the
> body of an email.
>
> How can I format the mail() command to send these multiple fields.
>
> EG $name, $address, $comments. All to go into the body of an email.
>
> Cheers
>
>
> --
> 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 () format

2003-01-27 Thread Bruce Levick
I have a number of field entries that I am trying to send through to the
body of an email.

How can I format the mail() command to send these multiple fields. 

EG $name, $address, $comments. All to go into the body of an email.

Cheers
  

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




[PHP] Anyone?? file uploads received, but mangled

2003-01-27 Thread af
Hi all.

Last try -- I know there's a lot of noise in this group, but could someone please 
offer an opinion?

Is the following possible to work around, or is it a bug that I should be reporting?

I'm having issues uploading files whose names don't necessarily end with the correct 
extension, in particular plain text files which don't end in .txt.  (Why they don't is 
complicated, and it's impractical to insist that they must.)  The files are received, 
but altered -- they are prepended with garbage data which makes them difficult to deal 
with in an elegant automated way, which is the whole point.

No doubt this is a mime type issue, as the files are received as type 
"application/x-macbinary" when sent from OSX IE (its best guess, I suppose).  Is there 
any way to force plain text, or raw data?  All I want to happen is for the files to be 
uploaded completely unchanged.

Btw, this happens with PHP 4.2.3 on OSX (entropy.ch), and with the latest 4.3 on 
OpenBSD.

Thanks,
Alex
[EMAIL PROTECTED]

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




Re: [PHP] output of fread() is blank

2003-01-27 Thread Philip Olson

On Mon, 27 Jan 2003, Guru Geek wrote:

> Hello,
> 
> I'm a recent convert from CGI/Perl and so am still getting my feet wet
> in PHP.
> 
> Here's my code:
> $filename = "http://www.myserver.com/include/sometext.txt";;
> $handle = fopen ($filename, "rb");
> $contents = fread ($handle, filesize ($filename));
[snip]

See:
  http://www.php.net/filesize

You cannot use it with urls.  Also if you can help it, 
don't go through http like this.  But anyway, see
also: file(), fgets(), and include()

Regards,
Philip


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




[PHP] Re: output of fread() is blank

2003-01-27 Thread Philip Hallstrom
I could be wrong, but I'd guess that filesize fails for remote files.

If all you're doing is spitting out the text, why not use readfile()?

-philip

On Mon, 27 Jan 2003, Guru Geek wrote:

> Hello,
>
> I'm a recent convert from CGI/Perl and so am still getting my feet wet
> in PHP.
>
> Here's my code:
> $filename = "http://www.myserver.com/include/sometext.txt";;
> $handle = fopen ($filename, "rb");
> $contents = fread ($handle, filesize ($filename));
> fclose ($handle);
> echo $contents;
> exit;
>
> The problem is nothing shows up, it's a blank browser window.  I'm sure
> this is a stupid questions and very easily fixed.
>
> Also, if the text file I'm trying to read is multi lined, shouldnt I be
> placing the contents into an array?  or is that old cgi habits coming
> through?
>
> Thanks,
> Roger
>
>
>
> --
> 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] output of fread() is blank

2003-01-27 Thread Jason Sheets
Hello,

The PHP manual page for filesize
(http://www.php.net/manual/en/function.filesize.php) mentions that it
will not work on remote files.  fread will stop once n number of bytes
are read or EOF is received so you could set this to the maximum file
size (in bytes) that you want to download.

Jason

On Mon, 2003-01-27 at 16:27, Guru Geek wrote:
> Hello,
> 
> I'm a recent convert from CGI/Perl and so am still getting my feet wet
> in PHP.
> 
> Here's my code:
> $filename = "http://www.myserver.com/include/sometext.txt";;
> $handle = fopen ($filename, "rb");
> $contents = fread ($handle, filesize ($filename));
> fclose ($handle);
> echo $contents;
> exit;
> 
> The problem is nothing shows up, it's a blank browser window.  I'm sure
> this is a stupid questions and very easily fixed.
> 
> Also, if the text file I'm trying to read is multi lined, shouldnt I be
> placing the contents into an array?  or is that old cgi habits coming
> through?
> 
> Thanks,
> Roger
> 
> 
> 
> -- 
> 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: multiple entry forms !!

2003-01-27 Thread Philip Hallstrom
Use several smaller forms and store the results of each into a session
variable.

Also store a "got-results-for-form-1" (through 7) that gets set for each
of the 7 forms.  Once all 7 are set you can do the final processing.

Set the action of each form to say "save.php" and pass in a "saving_what"
field".  save.php can then do a switch on the saving_what field to
determine what needs checking/storing/etc.

Works good for me.

On Mon, 27 Jan 2003, scott wrote:

> hi
>
> looking for some advice
>
> I have a site in progress. user to it have to enter a LOT of information (it
> will contain a club directory)
>
> in order to try and make it a less unpleasant experience for the user, I
> want to give them 7 smaller input forms, each one following the other
>
> what would be the correct way to do this, one very large, complex coded php
> conditional form that does everything, or several smaller ones ?
>
> if I use one form, it will conatin rather a lot of code, but execution would
> all be handled by the form itself
>
> but if I use multiple smaller forms, each form would need to process the
> previous forms input, and then display it's inputs for entry
>
> I am also using sessions, which adds a little to complexity
>
> any general good coding practice tips/links would be helpful
>
> thanks
>
> _scott
>
>
>
> --
> 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] output of fread() is blank

2003-01-27 Thread Guru Geek
Hello,

I'm a recent convert from CGI/Perl and so am still getting my feet wet
in PHP.

Here's my code:
$filename = "http://www.myserver.com/include/sometext.txt";;
$handle = fopen ($filename, "rb");
$contents = fread ($handle, filesize ($filename));
fclose ($handle);
echo $contents;
exit;

The problem is nothing shows up, it's a blank browser window.  I'm sure
this is a stupid questions and very easily fixed.

Also, if the text file I'm trying to read is multi lined, shouldnt I be
placing the contents into an array?  or is that old cgi habits coming
through?

Thanks,
Roger



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




[PHP] multiple entry forms !!

2003-01-27 Thread scott
hi

looking for some advice

I have a site in progress. user to it have to enter a LOT of information (it
will contain a club directory)

in order to try and make it a less unpleasant experience for the user, I
want to give them 7 smaller input forms, each one following the other

what would be the correct way to do this, one very large, complex coded php
conditional form that does everything, or several smaller ones ?

if I use one form, it will conatin rather a lot of code, but execution would
all be handled by the form itself

but if I use multiple smaller forms, each form would need to process the
previous forms input, and then display it's inputs for entry

I am also using sessions, which adds a little to complexity

any general good coding practice tips/links would be helpful

thanks

_scott



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




Re: [PHP] Help : I need modify a the header information in a JPEG image file

2003-01-27 Thread Chris Shiflett
--- Chris Shiflett <[EMAIL PROTECTED]> wrote:
> --- "Patricio Vera S." <[EMAIL PROTECTED]> wrote:
> > I new to the php world ant the image too, and I need
> > modify the header information in a JPEG image file,
> > is that possibly? How?
> 
> Those are EXIF headers. I am not sure if there is
> support for modifying them (aside from doing it
> manually yourself), but there are some functions that
> help you read them. Rasmus mentions this in his
> presentations:
> 
> http://talks.php.net/show/oscon2002/46
> 
> Hopefully that can get you started.

After looking into it further, I think the EXIF headers may
only exist in jpeg images from digital cameras, so I'm not
sure if the information I gave will help any.

Chris

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




Re: [PHP] Help : I need modify a the header information in a JPEG image file

2003-01-27 Thread Chris Shiflett
--- "Patricio Vera S." <[EMAIL PROTECTED]> wrote:
> I new to the php world ant the image too, and I need
> modify the header information in a JPEG image file,
> is that possibly? How?

Those are EXIF headers. I am not sure if there is support
for modifying them (aside from doing it manually yourself),
but there are some functions that help you read them.
Rasmus mentions this in his presentations:

http://talks.php.net/show/oscon2002/46

Hopefully that can get you started.

Chris

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




Re: [PHP] help needed with session variables

2003-01-27 Thread 1LT John W. Holmes
Are you sure $first_name and $last_name have a value? Double check...

---John Holmes...

- Original Message - 
From: "Pushpinder Singh Garcha" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, January 27, 2003 4:44 PM
Subject: [PHP] help needed with session variables


hello,

I am making use of sessions in my PHp/MySQL Database application. When 
the user is successfully authenticated against the database, a session 
is created in following manner:


session_register("valid_user","firstname","lastname");

$valid_user = $login;
$firstname  = $first_name;
$lastname   = $last_name;

While I  am able to use the $valid_user variable all thru the sesion , 
when I try to use the $valid_user it works fine (i.e. I am able to 
access the value) throughout the session, however when I try to use the 
other two registered session variables i.e firstname and lastname,  I 
am not able to extract the value.  Can you suggest what might be going 
wrong. Note I am locally testing the setup on my Mac.

Many Thanks
Pushpinder Singh Garcha
_
Web Architect


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




Re: [PHP] Found a PHP bug!!!!!!!!!

2003-01-27 Thread White Wolf
"Scott Fletcher":
> Okay, correction...
>
> Double --> 11.1237
> Float --> 0.
>
> Cheers!  It's the way it work in C Programming...  Double won't be as
long
> or as infinite as the floating point.

Absolutely wrong (if you would be in a C newsgroup you would even be
accused of trolling :-)))

double (in C) means: double precision floating point number

float in C means: floating point number

Float is guaranteed to store 6 significant digits (and usually noone uses
it except on some very weird architectures) while double's minimum is 10
significant digits.

WW



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




[PHP] Help : I need modify a the header information in a JPEG image file

2003-01-27 Thread Patricio Vera S.
Hi,

I new to the php world ant the image too, and I need modify the header information 
in a JPEG image file, is that possibly? How?

I need put some information in the image at the instant when the user download 
this from the web site.

Thanks in Advance.

Saludos,
Patricio Vera.





[PHP] help needed with session variables

2003-01-27 Thread Pushpinder Singh Garcha
hello,

I am making use of sessions in my PHp/MySQL Database application. When 
the user is successfully authenticated against the database, a session 
is created in following manner:


   session_register("valid_user","firstname","lastname");

   $valid_user = $login;
   $firstname  = $first_name;
   $lastname   = $last_name;

While I  am able to use the $valid_user variable all thru the sesion , 
when I try to use the $valid_user it works fine (i.e. I am able to 
access the value) throughout the session, however when I try to use the 
other two registered session variables i.e firstname and lastname,  I 
am not able to extract the value.  Can you suggest what might be going 
wrong. Note I am locally testing the setup on my Mac.

Many Thanks
Pushpinder Singh Garcha
_
Web Architect


Re: [PHP] Found a PHP bug!!!!!!!!!

2003-01-27 Thread Scott Fletcher
Okay, correction...

Double --> 11.1237
Float --> 0.

Cheers!  It's the way it work in C Programming...  Double won't be as long
or as infinite as the floating point.


"White Wolf" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> "Scott Fletcher" wrote:
> > Double and Float are not exactly the same thing.
> >
> > Double is ---> 11.123
> > Float is --> .00238823993
>
> I am absolutely new to PHP but what is above (since PHP seems to take most
> of its low-level terminology from C) is a fixed point number and the next
> is a floating point number, which may not fit into the 8 significant
digits
> what is guaranteed for a float on all platforms.  What do I miss?
>
> WW
>
>



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




Re: [PHP] Found a PHP bug!!!!!!!!!

2003-01-27 Thread White Wolf
"Scott Fletcher" wrote:
> Double and Float are not exactly the same thing.
>
> Double is ---> 11.123
> Float is --> .00238823993

I am absolutely new to PHP but what is above (since PHP seems to take most
of its low-level terminology from C) is a fixed point number and the next
is a floating point number, which may not fit into the 8 significant digits
what is guaranteed for a float on all platforms.  What do I miss?

WW



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




Re: [PHP] Found a PHP bug!!!!!!!!!

2003-01-27 Thread Chris Shiflett
--- Scott Fletcher <[EMAIL PROTECTED]> wrote:
> Double and Float are not exactly the same thing.
> 
> Double is ---> 11.123
> Float is --> .00238823993

They are the same thing. Please, read this:

http://www.php.net/manual/en/language.types.php

and this:

http://www.php.net/manual/en/language.types.float.php

Chris

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




Re: [PHP] Found a PHP bug!!!!!!!!!

2003-01-27 Thread Leif K-Brooks

 doubleval

doubleval -- Alias of floatval() 



   Description

This function is an alias of floatval() 
.

   Note: This alias is a left-over from a function-renaming. In older
   versions of PHP you'll need to use this alias of the floatval()
    function,
   because floatval()
    wasn't yet
   available in that version.



Scott Fletcher wrote:

Double and Float are not exactly the same thing.

Double is ---> 11.123
Float is --> .00238823993

"Leif K-Brooks" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 

No, it's floatval.  Doubleval is an alias left over from hwen floats
were called doubles...

Scott Fletcher wrote:

   

Whoop!  FOund it,  it is doubleval()...


What does settype() do exactly


"Scott Fletcher" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...


 

I do know that integer, string, double, float, etc  are different..
   

I
 

have been using hte appropriate method like in javascript and c


   

programming,


 

like converting it to integer and so on  But when I start using PHP,
   

I
 

find no such document of it and I have been using it for 3 years without
   

a
 

problem.  I asked people is there such a thing as converting it by using


   

the


 

function and they told me there is no such a thing and that it is done
automatically...  Now my time is a little bit wasted.   So, I will
   

correct
 

the problem with the php script...

I recently looked up on the manual as Jason Wong instructed me to.  I
havne't found the answer since the document is a little bit mixed up.

Okay, I'm going back to my old way as I did in javascript and c


   

programming.


 

So for php, it would be

floatval() for float...
strval() for string
settype() for whatever..
intval() for integer

Um, what about double???

Thanks,
Scott F.

"Chris Hayes" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...


   

Re: [PHP] Found a PHP bug!
   

uh oh...




 

I don't see why a string wouldn't work when I use "08" (string) and


   

match


 

it


   

against the integer 8, or 08.


   

They're just different types. Normally PHP is veeery flexible with
types,  like javascript, but it just can't be flexible for you here


 

because


   

it needs to choose the most logic to the entire pool of programmers,
 

and
 

 

then


   

"08" = a string
 8 = a decimal integer
08 = by definition an impossible octal integer, so 0.

Since you cannot tell PHP that $var is of a certain type like in
 

[other]
 

programming languages, for example you want it to be treated as an


 

integer,


   

PHP will handle it as what seems to be the most logic.


You can try to use intval (does not alter a variable, only the value as


 

it


 

is used in a calculation or an if() statement) or settype (alters the
variable).





 

"Kirk Johnson" <[EMAIL PROTECTED]> wrote in message
B11731D518B5D61183C700A0C98BE0D9FFBE5D@chef">news:B11731D518B5D61183C700A0C98BE0D9FFBE5D@chef...


   

-Original Message-
From: Scott Fletcher [mailto:[EMAIL PROTECTED]]

Found a PHP bug, I'm using PHP version 4.2.3.  I have been
struggling with
why PHP code failed to work with the month is August or
September


   

I stumbled into this one a short while ago myself. It is not a bug,


 

but a


   

feature! ;) When passing values of 08 or 09 (Aug and Sep), PHP


 

interprets


   

them as octal numbers (because of the leading 0). However, 08 and 09


 

are


   

invalid octal numbers, so PHP converts them to zero.

The fixes are numerous:
- remove the leading zero;
- add zero to them before passing (addition forces a type


 

conversion


 

to


   

int);
- force a type conversion to integer using (int);
- quote them (when PHP converts a string to an integer, it removes


 

the


   

leading zero);

Kirk


 

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.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.
 


   




 


--
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] Found a PHP bug!!!!!!!!!

2003-01-27 Thread Scott Fletcher
Another workaround to this problem is as an addition to Kirk Johnson's
suggestion

--clip--
$month = "08";
 if (trim($month) == 8) {
echo "You got it!!!";
 }
--clip--
"Scott Fletcher" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Aw nut!!!  The intval() doesn't work..  I had enough, I'm going to do
> what Kirk Johnson recommend.  That one work better.
>
> "Scott Fletcher" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > Yea, it's too bad that not many people know about it.  I first asked and
> > they told me it is done automatically.  That was 3 years ago.  I never
had
> a
> > problem for 3 years until now.  So, I'm going back to the old way as I
did
> > in Javascript and C programming.  I first started PHP 3 years ago, so
it's
> > no wonder why there's all the confusion when I was just an innocent
> victim.
> > :-)
> >
> > "Cal Evans" <[EMAIL PROTECTED]> wrote in message
> > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > > John.
> > >
> > > > Actually, "08" is equal to 8 in PHP. PHP will convert the string to
an
> > > >integer and the two will compare as equal.
> > >
> > > No they are not equal. Yes, PHP will do the conversion so that they
are
> > > equal. That does not refute the fact that logically '08' != 8.
> > >
> > >
> > > > Someone already posted why the problem was happening, because the
> > numbers
> > > > were being converted to invalid octal numbers and being set to zero.
> > >
> > > I understand the problem at hand. (and did when I posted) However, if
> > Scott
> > > had been doing the conversions manually, he would never have run
across
> > this
> > > problem.  It is a bad idea to rely on the language (whatever the
> language)
> > > to do automatic variable conversions.
> > >
> > > =C=
> > >
> >
> >
>
>



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




Re: [PHP] Found a PHP bug!!!!!!!!!

2003-01-27 Thread Scott Fletcher
Aw nut!!!  The intval() doesn't work..  I had enough, I'm going to do
what Kirk Johnson recommend.  That one work better.

"Scott Fletcher" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Yea, it's too bad that not many people know about it.  I first asked and
> they told me it is done automatically.  That was 3 years ago.  I never had
a
> problem for 3 years until now.  So, I'm going back to the old way as I did
> in Javascript and C programming.  I first started PHP 3 years ago, so it's
> no wonder why there's all the confusion when I was just an innocent
victim.
> :-)
>
> "Cal Evans" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > John.
> >
> > > Actually, "08" is equal to 8 in PHP. PHP will convert the string to an
> > >integer and the two will compare as equal.
> >
> > No they are not equal. Yes, PHP will do the conversion so that they are
> > equal. That does not refute the fact that logically '08' != 8.
> >
> >
> > > Someone already posted why the problem was happening, because the
> numbers
> > > were being converted to invalid octal numbers and being set to zero.
> >
> > I understand the problem at hand. (and did when I posted) However, if
> Scott
> > had been doing the conversions manually, he would never have run across
> this
> > problem.  It is a bad idea to rely on the language (whatever the
language)
> > to do automatic variable conversions.
> >
> > =C=
> >
>
>



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




Re: [PHP] Found a PHP bug!!!!!!!!!

2003-01-27 Thread Scott Fletcher
Double and Float are not exactly the same thing.

Double is ---> 11.123
Float is --> .00238823993

"Leif K-Brooks" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> No, it's floatval.  Doubleval is an alias left over from hwen floats
> were called doubles...
>
> Scott Fletcher wrote:
>
> >Whoop!  FOund it,  it is doubleval()...
> >
> >
> >What does settype() do exactly
> >
> >
> >"Scott Fletcher" <[EMAIL PROTECTED]> wrote in message
> >[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> >
> >
> >>I do know that integer, string, double, float, etc  are different..
I
> >>have been using hte appropriate method like in javascript and c
> >>
> >>
> >programming,
> >
> >
> >>like converting it to integer and so on  But when I start using PHP,
I
> >>find no such document of it and I have been using it for 3 years without
a
> >>problem.  I asked people is there such a thing as converting it by using
> >>
> >>
> >the
> >
> >
> >>function and they told me there is no such a thing and that it is done
> >>automatically...  Now my time is a little bit wasted.   So, I will
correct
> >>the problem with the php script...
> >>
> >>I recently looked up on the manual as Jason Wong instructed me to.  I
> >>havne't found the answer since the document is a little bit mixed up.
> >>
> >>Okay, I'm going back to my old way as I did in javascript and c
> >>
> >>
> >programming.
> >
> >
> >>So for php, it would be
> >>
> >>floatval() for float...
> >>strval() for string
> >>settype() for whatever..
> >>intval() for integer
> >>
> >>Um, what about double???
> >>
> >>Thanks,
> >> Scott F.
> >>
> >>"Chris Hayes" <[EMAIL PROTECTED]> wrote in message
> >>[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> >>
> >>
> >>> >Re: [PHP] Found a PHP bug!
> >>>uh oh...
> >>>
> >>>
> >>>
> >>>
> I don't see why a string wouldn't work when I use "08" (string) and
> 
> 
> >match
> >
> >
> >>it
> >>
> >>
> against the integer 8, or 08.
> 
> 
> >>>They're just different types. Normally PHP is veeery flexible with
> >>>types,  like javascript, but it just can't be flexible for you here
> >>>
> >>>
> >>because
> >>
> >>
> >>>it needs to choose the most logic to the entire pool of programmers,
and
> >>>
> >>>
> >>then
> >>
> >>
> >>>"08" = a string
> >>>   8 = a decimal integer
> >>>  08 = by definition an impossible octal integer, so 0.
> >>>
> >>>Since you cannot tell PHP that $var is of a certain type like in
[other]
> >>>programming languages, for example you want it to be treated as an
> >>>
> >>>
> >>integer,
> >>
> >>
> >>>PHP will handle it as what seems to be the most logic.
> >>>
> >>>
> >>>You can try to use intval (does not alter a variable, only the value as
> >>>
> >>>
> >it
> >
> >
> >>>is used in a calculation or an if() statement) or settype (alters the
> >>>variable).
> >>>
> >>>
> >>>
> >>>
> >>>
> "Kirk Johnson" <[EMAIL PROTECTED]> wrote in message
> B11731D518B5D61183C700A0C98BE0D9FFBE5D@chef">news:B11731D518B5D61183C700A0C98BE0D9FFBE5D@chef...
> 
> 
> >>-Original Message-
> >>From: Scott Fletcher [mailto:[EMAIL PROTECTED]]
> >>
> >>Found a PHP bug, I'm using PHP version 4.2.3.  I have been
> >>struggling with
> >>why PHP code failed to work with the month is August or
> >>September
> >>
> >>
> >I stumbled into this one a short while ago myself. It is not a bug,
> >
> >
> >>but a
> >>
> >>
> >feature! ;) When passing values of 08 or 09 (Aug and Sep), PHP
> >
> >
> >>interprets
> >>
> >>
> >them as octal numbers (because of the leading 0). However, 08 and 09
> >
> >
> >>are
> >>
> >>
> >invalid octal numbers, so PHP converts them to zero.
> >
> >The fixes are numerous:
> > - remove the leading zero;
> > - add zero to them before passing (addition forces a type
> >
> >
> >conversion
> >
> >
> >>to
> >>
> >>
> >int);
> > - force a type conversion to integer using (int);
> > - quote them (when PHP converts a string to an integer, it removes
> >
> >
> >>the
> >>
> >>
> >leading zero);
> >
> >Kirk
> >
> >
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.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




Re: [PHP] Found a PHP bug!!!!!!!!!

2003-01-27 Thread Scott Fletcher
Yea, it's too bad that not many people know about it.  I first asked and
they told me it is done automatically.  That was 3 years ago.  I never had a
problem for 3 years until now.  So, I'm going back to the old way as I did
in Javascript and C programming.  I first started PHP 3 years ago, so it's
no wonder why there's all the confusion when I was just an innocent victim.
:-)

"Cal Evans" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> John.
>
> > Actually, "08" is equal to 8 in PHP. PHP will convert the string to an
> >integer and the two will compare as equal.
>
> No they are not equal. Yes, PHP will do the conversion so that they are
> equal. That does not refute the fact that logically '08' != 8.
>
>
> > Someone already posted why the problem was happening, because the
numbers
> > were being converted to invalid octal numbers and being set to zero.
>
> I understand the problem at hand. (and did when I posted) However, if
Scott
> had been doing the conversions manually, he would never have run across
this
> problem.  It is a bad idea to rely on the language (whatever the language)
> to do automatic variable conversions.
>
> =C=
>



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




RE: [PHP] Found a PHP bug!!!!!!!!!

2003-01-27 Thread Cal Evans
John.

> Actually, "08" is equal to 8 in PHP. PHP will convert the string to an
>integer and the two will compare as equal.

No they are not equal. Yes, PHP will do the conversion so that they are
equal. That does not refute the fact that logically '08' != 8.


> Someone already posted why the problem was happening, because the numbers
> were being converted to invalid octal numbers and being set to zero.

I understand the problem at hand. (and did when I posted) However, if Scott
had been doing the conversions manually, he would never have run across this
problem.  It is a bad idea to rely on the language (whatever the language)
to do automatic variable conversions.

=C=


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




[PHP] Help with Filesize

2003-01-27 Thread Rodrigo Corrêa

How do i use the function filesize, because i´m using like:

I just want associate the variable $body with a html file

$file_name = 'c:/templates/resp_rep_efetiva_contrato.php';
$fd = fopen($file_name,"r");
line 27   $size = filesize($file_name);  / Dá erro aqui
$body = fread($fd, $size);
$mail = mail($address, $subject, $body, $header); 
it keeps saind that:

Warning: stat failed for c://templates/resp_rep_efetiva_contrato.php (errno=2 - No 
such file or directory) in line 27

but, the file exists because the fopen function works ok, I don´t known what to do



Thanks in advance



Equipe Pratic Sistemas
Rodrigo Corrêa
Fone: (14) 441-1700
[EMAIL PROTECTED]
[EMAIL PROTECTED] 
 





Re: [PHP] Found a PHP bug!!!!!!!!!

2003-01-27 Thread 1LT John W. Holmes
Even doing a type cast won't make a difference for the original problem.
Even if you cast "08" to an integer and compare it to 08 (invalid octal
number), it'll still fail.

The original solution was the best, remove the leading zero from the
comparisons and let PHP handle the type casting.

---John Holmes...

- Original Message -
From: "Ray Hunter" <[EMAIL PROTECTED]>
To: "Scott Fletcher" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Monday, January 27, 2003 3:45 PM
Subject: Re: [PHP] Found a PHP bug!


> U might want to do a type cast to integer from string...
>
> http://www.php.net/manual/en/language.types.type-juggling.php
>
>
> On Mon, 2003-01-27 at 13:47, Scott Fletcher wrote:
> > I would need to use intval() to solve this problem
> >
> > "Scott Fletcher" <[EMAIL PROTECTED]> wrote in message
> > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > > I'm referring to '08' and '09' that don't work
> > >
> > > "Chris Shiflett" <[EMAIL PROTECTED]> wrote in message
> > > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > > > --- Scott Fletcher <[EMAIL PROTECTED]> wrote:
> > > > > Found a PHP bug
> > > > ...
> > > > > if ($month == 01)
> > > >
> > > > I guess you mean:
> > > >
> > > > if ($month == '01')
> > > >
> > > > If so, this is not a bug. Otherwise, please explain what
> > > > you think is wrong.
> > > >
> > > > Chris
> > >
> > >
>
>
> --
> 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] Found a PHP bug!!!!!!!!!

2003-01-27 Thread Leif K-Brooks
No, it's floatval.  Doubleval is an alias left over from hwen floats 
were called doubles...

Scott Fletcher wrote:

Whoop!  FOund it,  it is doubleval()...


What does settype() do exactly


"Scott Fletcher" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 

I do know that integer, string, double, float, etc  are different..  I
have been using hte appropriate method like in javascript and c
   

programming,
 

like converting it to integer and so on  But when I start using PHP, I
find no such document of it and I have been using it for 3 years without a
problem.  I asked people is there such a thing as converting it by using
   

the
 

function and they told me there is no such a thing and that it is done
automatically...  Now my time is a little bit wasted.   So, I will correct
the problem with the php script...

I recently looked up on the manual as Jason Wong instructed me to.  I
havne't found the answer since the document is a little bit mixed up.

Okay, I'm going back to my old way as I did in javascript and c
   

programming.
 

So for php, it would be

floatval() for float...
strval() for string
settype() for whatever..
intval() for integer

Um, what about double???

Thanks,
Scott F.

"Chris Hayes" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
   

>Re: [PHP] Found a PHP bug!
uh oh...


 

I don't see why a string wouldn't work when I use "08" (string) and
   

match
 

it
   

against the integer 8, or 08.
   

They're just different types. Normally PHP is veeery flexible with
types,  like javascript, but it just can't be flexible for you here
 

because
   

it needs to choose the most logic to the entire pool of programmers, and
 

then
   

"08" = a string
  8 = a decimal integer
 08 = by definition an impossible octal integer, so 0.

Since you cannot tell PHP that $var is of a certain type like in [other]
programming languages, for example you want it to be treated as an
 

integer,
   

PHP will handle it as what seems to be the most logic.


You can try to use intval (does not alter a variable, only the value as
 

it
 

is used in a calculation or an if() statement) or settype (alters the
variable).



 

"Kirk Johnson" <[EMAIL PROTECTED]> wrote in message
B11731D518B5D61183C700A0C98BE0D9FFBE5D@chef">news:B11731D518B5D61183C700A0C98BE0D9FFBE5D@chef...
   

-Original Message-
From: Scott Fletcher [mailto:[EMAIL PROTECTED]]

Found a PHP bug, I'm using PHP version 4.2.3.  I have been
struggling with
why PHP code failed to work with the month is August or
September
   

I stumbled into this one a short while ago myself. It is not a bug,
 

but a
   

feature! ;) When passing values of 08 or 09 (Aug and Sep), PHP
 

interprets
   

them as octal numbers (because of the leading 0). However, 08 and 09
 

are
   

invalid octal numbers, so PHP converts them to zero.

The fixes are numerous:
- remove the leading zero;
- add zero to them before passing (addition forces a type
 

conversion
 

to
   

int);
- force a type conversion to integer using (int);
- quote them (when PHP converts a string to an integer, it removes
 

the
   

leading zero);

Kirk
 


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.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.





Re: [PHP] Found a PHP bug!!!!!!!!!

2003-01-27 Thread 1LT John W. Holmes
> Because "8" != 8. "8" (and "08") is a string with the numerals
representing
> the number eight. It is not the number eight. (think back to basic math,
the
> difference between a number and a numeral)

Actually, "08" is equal to 8 in PHP. PHP will convert the string to an
integer and the two will compare as equal.

> PHP does some conversions for you automatically but that just saves you
from
> yourself. (Personally, I wish it wouldn't. People have more trouble
> *because* of the automatic conversions than they would if they had to do
the
> converting themselves.)

Someone already posted why the problem was happening, because the numbers
were being converted to invalid octal numbers and being set to zero.

Run this bit of code for an example:

   echo "" . ((01 == 1) ? "Match" : "No Match");
   echo "" . ((02 == 2) ? "Match" : "No Match");
   echo "" . ((03 == 3) ? "Match" : "No Match");
   echo "" . ((04 == 4) ? "Match" : "No Match");
   echo "" . ((05 == 5) ? "Match" : "No Match");
   echo "" . ((06 == 6) ? "Match" : "No Match");
   echo "" . ((07 == 7) ? "Match" : "No Match");
   echo "" . ((08 == 8) ? "Match" : "No Match");
   echo "" . ((09 == 9) ? "Match" : "No Match");

The last two won't match because 08 and 09 are invalid octal numbers, like
Kirk Johnson already said.

So "08" != 08 and 8 != 08, for example.

---John Holmes...


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




Re: [PHP] Found a PHP bug!!!!!!!!!

2003-01-27 Thread Ray Hunter
U might want to do a type cast to integer from string...

http://www.php.net/manual/en/language.types.type-juggling.php


On Mon, 2003-01-27 at 13:47, Scott Fletcher wrote:
> I would need to use intval() to solve this problem
> 
> "Scott Fletcher" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > I'm referring to '08' and '09' that don't work
> >
> > "Chris Shiflett" <[EMAIL PROTECTED]> wrote in message
> > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > > --- Scott Fletcher <[EMAIL PROTECTED]> wrote:
> > > > Found a PHP bug
> > > ...
> > > > if ($month == 01)
> > >
> > > I guess you mean:
> > >
> > > if ($month == '01')
> > >
> > > If so, this is not a bug. Otherwise, please explain what
> > > you think is wrong.
> > >
> > > Chris
> >
> >


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




Re: [PHP] Found a PHP bug!!!!!!!!!

2003-01-27 Thread Scott Fletcher
I would need to use intval() to solve this problem

"Scott Fletcher" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I'm referring to '08' and '09' that don't work
>
> "Chris Shiflett" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > --- Scott Fletcher <[EMAIL PROTECTED]> wrote:
> > > Found a PHP bug
> > ...
> > > if ($month == 01)
> >
> > I guess you mean:
> >
> > if ($month == '01')
> >
> > If so, this is not a bug. Otherwise, please explain what
> > you think is wrong.
> >
> > Chris
>
>



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




Re: [PHP] Found a PHP bug!!!!!!!!!

2003-01-27 Thread Scott Fletcher
Whoop!  FOund it,  it is doubleval()...


What does settype() do exactly


"Scott Fletcher" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I do know that integer, string, double, float, etc  are different..  I
> have been using hte appropriate method like in javascript and c
programming,
> like converting it to integer and so on  But when I start using PHP, I
> find no such document of it and I have been using it for 3 years without a
> problem.  I asked people is there such a thing as converting it by using
the
> function and they told me there is no such a thing and that it is done
> automatically...  Now my time is a little bit wasted.   So, I will correct
> the problem with the php script...
>
> I recently looked up on the manual as Jason Wong instructed me to.  I
> havne't found the answer since the document is a little bit mixed up.
>
> Okay, I'm going back to my old way as I did in javascript and c
programming.
> So for php, it would be
>
> floatval() for float...
> strval() for string
> settype() for whatever..
> intval() for integer
>
> Um, what about double???
>
> Thanks,
>  Scott F.
>
> "Chris Hayes" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> >
> >  >Re: [PHP] Found a PHP bug!
> > uh oh...
> >
> >
> > >I don't see why a string wouldn't work when I use "08" (string) and
match
> it
> > >against the integer 8, or 08.
> >
> > They're just different types. Normally PHP is veeery flexible with
> > types,  like javascript, but it just can't be flexible for you here
> because
> > it needs to choose the most logic to the entire pool of programmers, and
> then
> > "08" = a string
> >8 = a decimal integer
> >   08 = by definition an impossible octal integer, so 0.
> >
> > Since you cannot tell PHP that $var is of a certain type like in [other]
> > programming languages, for example you want it to be treated as an
> integer,
> > PHP will handle it as what seems to be the most logic.
> >
> >
> > You can try to use intval (does not alter a variable, only the value as
it
> > is used in a calculation or an if() statement) or settype (alters the
> > variable).
> >
> >
> >
> > >"Kirk Johnson" <[EMAIL PROTECTED]> wrote in message
> > >B11731D518B5D61183C700A0C98BE0D9FFBE5D@chef">news:B11731D518B5D61183C700A0C98BE0D9FFBE5D@chef...
> > > >
> > > > > -Original Message-
> > > > > From: Scott Fletcher [mailto:[EMAIL PROTECTED]]
> > > > >
> > > > > Found a PHP bug, I'm using PHP version 4.2.3.  I have been
> > > > > struggling with
> > > > > why PHP code failed to work with the month is August or
> > > > > September
> > > >
> > > > I stumbled into this one a short while ago myself. It is not a bug,
> but a
> > > > feature! ;) When passing values of 08 or 09 (Aug and Sep), PHP
> interprets
> > > > them as octal numbers (because of the leading 0). However, 08 and 09
> are
> > > > invalid octal numbers, so PHP converts them to zero.
> > > >
> > > > The fixes are numerous:
> > > >  - remove the leading zero;
> > > >  - add zero to them before passing (addition forces a type
conversion
> to
> > > > int);
> > > >  - force a type conversion to integer using (int);
> > > >  - quote them (when PHP converts a string to an integer, it removes
> the
> > > > leading zero);
> > > >
> > > > Kirk
> > >
> > >
> > >
> > >--
> > >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] phpMyAdmin for Microsoft SQL

2003-01-27 Thread Joshua E Minnie
Hey all,

Does any body know of anything similar to phpMyAdmin for MS SQL?  I have been doing 
some googling and haven't come across anything that would help me out.  I have also 
checked out www.sourceforge.net and can't seem to come across anything either.  I am 
looking for something that will be easy enough for my client to utilize to 
update/manipulate a database, rather than having me re-create the wheel so-to-speak.

-- 
Joshua Minnie
Advantage Computer Services, LLC
Senior Project Manager
[EMAIL PROTECTED]
www.advantagecomputerservices.com
Tel: 269.276.9690
Fax : 269.342.8750


Re: [PHP] Found a PHP bug!!!!!!!!!

2003-01-27 Thread Scott Fletcher
I do know that integer, string, double, float, etc  are different..  I
have been using hte appropriate method like in javascript and c programming,
like converting it to integer and so on  But when I start using PHP, I
find no such document of it and I have been using it for 3 years without a
problem.  I asked people is there such a thing as converting it by using the
function and they told me there is no such a thing and that it is done
automatically...  Now my time is a little bit wasted.   So, I will correct
the problem with the php script...

I recently looked up on the manual as Jason Wong instructed me to.  I
havne't found the answer since the document is a little bit mixed up.

Okay, I'm going back to my old way as I did in javascript and c programming.
So for php, it would be

floatval() for float...
strval() for string
settype() for whatever..
intval() for integer

Um, what about double???

Thanks,
 Scott F.

"Chris Hayes" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>
>  >Re: [PHP] Found a PHP bug!
> uh oh...
>
>
> >I don't see why a string wouldn't work when I use "08" (string) and match
it
> >against the integer 8, or 08.
>
> They're just different types. Normally PHP is veeery flexible with
> types,  like javascript, but it just can't be flexible for you here
because
> it needs to choose the most logic to the entire pool of programmers, and
then
> "08" = a string
>8 = a decimal integer
>   08 = by definition an impossible octal integer, so 0.
>
> Since you cannot tell PHP that $var is of a certain type like in [other]
> programming languages, for example you want it to be treated as an
integer,
> PHP will handle it as what seems to be the most logic.
>
>
> You can try to use intval (does not alter a variable, only the value as it
> is used in a calculation or an if() statement) or settype (alters the
> variable).
>
>
>
> >"Kirk Johnson" <[EMAIL PROTECTED]> wrote in message
> >B11731D518B5D61183C700A0C98BE0D9FFBE5D@chef">news:B11731D518B5D61183C700A0C98BE0D9FFBE5D@chef...
> > >
> > > > -Original Message-
> > > > From: Scott Fletcher [mailto:[EMAIL PROTECTED]]
> > > >
> > > > Found a PHP bug, I'm using PHP version 4.2.3.  I have been
> > > > struggling with
> > > > why PHP code failed to work with the month is August or
> > > > September
> > >
> > > I stumbled into this one a short while ago myself. It is not a bug,
but a
> > > feature! ;) When passing values of 08 or 09 (Aug and Sep), PHP
interprets
> > > them as octal numbers (because of the leading 0). However, 08 and 09
are
> > > invalid octal numbers, so PHP converts them to zero.
> > >
> > > The fixes are numerous:
> > >  - remove the leading zero;
> > >  - add zero to them before passing (addition forces a type conversion
to
> > > int);
> > >  - force a type conversion to integer using (int);
> > >  - quote them (when PHP converts a string to an integer, it removes
the
> > > leading zero);
> > >
> > > Kirk
> >
> >
> >
> >--
> >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] Found a PHP bug!!!!!!!!!

2003-01-27 Thread Scott Fletcher
I'm referring to '08' and '09' that don't work

"Chris Shiflett" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> --- Scott Fletcher <[EMAIL PROTECTED]> wrote:
> > Found a PHP bug
> ...
> > if ($month == 01)
>
> I guess you mean:
>
> if ($month == '01')
>
> If so, this is not a bug. Otherwise, please explain what
> you think is wrong.
>
> Chris



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




Re: [PHP] Found a PHP bug!!!!!!!!!

2003-01-27 Thread Chris Hayes

>Re: [PHP] Found a PHP bug!
uh oh...



I don't see why a string wouldn't work when I use "08" (string) and match it
against the integer 8, or 08.


They're just different types. Normally PHP is veeery flexible with 
types,  like javascript, but it just can't be flexible for you here because 
it needs to choose the most logic to the entire pool of programmers, and then
"08" = a string
  8 = a decimal integer
 08 = by definition an impossible octal integer, so 0.

Since you cannot tell PHP that $var is of a certain type like in [other] 
programming languages, for example you want it to be treated as an integer, 
PHP will handle it as what seems to be the most logic.


You can try to use intval (does not alter a variable, only the value as it 
is used in a calculation or an if() statement) or settype (alters the 
variable).



"Kirk Johnson" <[EMAIL PROTECTED]> wrote in message
B11731D518B5D61183C700A0C98BE0D9FFBE5D@chef">news:B11731D518B5D61183C700A0C98BE0D9FFBE5D@chef...
>
> > -Original Message-
> > From: Scott Fletcher [mailto:[EMAIL PROTECTED]]
> >
> > Found a PHP bug, I'm using PHP version 4.2.3.  I have been
> > struggling with
> > why PHP code failed to work with the month is August or
> > September
>
> I stumbled into this one a short while ago myself. It is not a bug, but a
> feature! ;) When passing values of 08 or 09 (Aug and Sep), PHP interprets
> them as octal numbers (because of the leading 0). However, 08 and 09 are
> invalid octal numbers, so PHP converts them to zero.
>
> The fixes are numerous:
>  - remove the leading zero;
>  - add zero to them before passing (addition forces a type conversion to
> int);
>  - force a type conversion to integer using (int);
>  - quote them (when PHP converts a string to an integer, it removes the
> leading zero);
>
> Kirk



--
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] Found a PHP bug!!!!!!!!!

2003-01-27 Thread Cal Evans
Scott,

Because "8" != 8. "8" (and "08") is a string with the numerals representing
the number eight. It is not the number eight. (think back to basic math, the
difference between a number and a numeral)

PHP does some conversions for you automatically but that just saves you from
yourself. (Personally, I wish it wouldn't. People have more trouble
*because* of the automatic conversions than they would if they had to do the
converting themselves.)

To keep from running into this simply do the conversions yourself before you
do comparisons.

intval("08")==8

=C=

*
* Cal Evans
* Stay plugged into your audience.
* http://www.christianperformer.com
*


-Original Message-
From: Scott Fletcher [mailto:[EMAIL PROTECTED]]
Sent: Monday, January 27, 2003 2:14 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Found a PHP bug!


I don't see why a string wouldn't work when I use "08" (string) and match it
against the integer 8, or 08.


"Kirk Johnson" <[EMAIL PROTECTED]> wrote in message
B11731D518B5D61183C700A0C98BE0D9FFBE5D@chef">news:B11731D518B5D61183C700A0C98BE0D9FFBE5D@chef...
>
> > -Original Message-
> > From: Scott Fletcher [mailto:[EMAIL PROTECTED]]
> >
> > Found a PHP bug, I'm using PHP version 4.2.3.  I have been
> > struggling with
> > why PHP code failed to work with the month is August or
> > September
>
> I stumbled into this one a short while ago myself. It is not a bug, but a
> feature! ;) When passing values of 08 or 09 (Aug and Sep), PHP interprets
> them as octal numbers (because of the leading 0). However, 08 and 09 are
> invalid octal numbers, so PHP converts them to zero.
>
> The fixes are numerous:
>  - remove the leading zero;
>  - add zero to them before passing (addition forces a type conversion to
> int);
>  - force a type conversion to integer using (int);
>  - quote them (when PHP converts a string to an integer, it removes the
> leading zero);
>
> Kirk



--
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] Found a PHP bug!!!!!!!!!

2003-01-27 Thread Chris Shiflett
--- Scott Fletcher <[EMAIL PROTECTED]> wrote:
> Found a PHP bug
...
> if ($month == 01)

I guess you mean:

if ($month == '01')

If so, this is not a bug. Otherwise, please explain what
you think is wrong.

Chris

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




Re: [PHP] Found a PHP bug!!!!!!!!!

2003-01-27 Thread Scott Fletcher
I don't see why a string wouldn't work when I use "08" (string) and match it
against the integer 8, or 08.


"Kirk Johnson" <[EMAIL PROTECTED]> wrote in message
B11731D518B5D61183C700A0C98BE0D9FFBE5D@chef">news:B11731D518B5D61183C700A0C98BE0D9FFBE5D@chef...
>
> > -Original Message-
> > From: Scott Fletcher [mailto:[EMAIL PROTECTED]]
> >
> > Found a PHP bug, I'm using PHP version 4.2.3.  I have been
> > struggling with
> > why PHP code failed to work with the month is August or
> > September
>
> I stumbled into this one a short while ago myself. It is not a bug, but a
> feature! ;) When passing values of 08 or 09 (Aug and Sep), PHP interprets
> them as octal numbers (because of the leading 0). However, 08 and 09 are
> invalid octal numbers, so PHP converts them to zero.
>
> The fixes are numerous:
>  - remove the leading zero;
>  - add zero to them before passing (addition forces a type conversion to
> int);
>  - force a type conversion to integer using (int);
>  - quote them (when PHP converts a string to an integer, it removes the
> leading zero);
>
> Kirk



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




RE: [PHP] Found a PHP bug!!!!!!!!!

2003-01-27 Thread Johnson, Kirk

> -Original Message-
> From: Scott Fletcher [mailto:[EMAIL PROTECTED]]
> 
> Found a PHP bug, I'm using PHP version 4.2.3.  I have been 
> struggling with
> why PHP code failed to work with the month is August or 
> September

I stumbled into this one a short while ago myself. It is not a bug, but a
feature! ;) When passing values of 08 or 09 (Aug and Sep), PHP interprets
them as octal numbers (because of the leading 0). However, 08 and 09 are
invalid octal numbers, so PHP converts them to zero.

The fixes are numerous:
 - remove the leading zero;
 - add zero to them before passing (addition forces a type conversion to
int);
 - force a type conversion to integer using (int);
 - quote them (when PHP converts a string to an integer, it removes the
leading zero);

Kirk

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




Re: [PHP] Found a PHP bug!!!!!!!!!

2003-01-27 Thread Jason Wong
On Tuesday 28 January 2003 03:56, Scott Fletcher wrote:
> Found a PHP bug, I'm using PHP version 4.2.3.  I have been struggling with
> why PHP code failed to work with the month is August or September, so I
> have been playing around it and found the problem.  I recently wrote a demo
> script for you all to play around with.  Let me know which PHP version does
> this bug not affected you  I'm going to file a PHP bug at
> http://bug.php.net..  I'll let you know where PHP bug # is it.  To tell
> you the truth, I don't know how to search for existing bug on this one if
> there is any because I don't know if it is an if-statement issue or if it
> is something else  Feel free to submit a patch if you know how.
>
> Let me know what you found and post it here...
>
> --clip--

[snip]

>   if ($month == 01) { echo "It's a Match!!"; } else { echo "It's
> not a Match!!"; }
>   if ($month == 02) { echo "It's a Match!!"; } else { echo "It's
> not a Match!!"; }
>   if ($month == 03) { echo "It's a Match!!"; } else { echo "It's
> not a Match!!"; }
>   if ($month == 04) { echo "It's a Match!!"; } else { echo "It's
> not a Match!!"; }
>   if ($month == 05) { echo "It's a Match!!"; } else { echo "It's
> not a Match!!"; }
>   if ($month == 06) { echo "It's a Match!!"; } else { echo "It's
> not a Match!!"; }
>   if ($month == 07) { echo "It's a Match!!"; } else { echo "It's
> not a Match!!"; }
>   if ($month == 08) { echo "It's a Match!!"; } else { echo "It's
> not a Match!!"; }
>   if ($month == 09) { echo "It's a Match!!"; } else { echo "It's
> not a Match!!"; }


Have a look at the manual > Types > Integers

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

/*
I'm having a BIG BANG THEORY!!
*/


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




[PHP] Found a PHP bug!!!!!!!!!

2003-01-27 Thread Scott Fletcher
Found a PHP bug, I'm using PHP version 4.2.3.  I have been struggling with
why PHP code failed to work with the month is August or September, so I have
been playing around it and found the problem.  I recently wrote a demo
script for you all to play around with.  Let me know which PHP version does
this bug not affected you  I'm going to file a PHP bug at
http://bug.php.net..  I'll let you know where PHP bug # is it.  To tell
you the truth, I don't know how to search for existing bug on this one if
there is any because I don't know if it is an if-statement issue or if it is
something else  Feel free to submit a patch if you know how.

Let me know what you found and post it here...

--clip--
";

  if ($month == 01) { echo "It's a Match!!"; } else { echo "It's not
a Match!!"; }
  if ($month == 02) { echo "It's a Match!!"; } else { echo "It's not
a Match!!"; }
  if ($month == 03) { echo "It's a Match!!"; } else { echo "It's not
a Match!!"; }
  if ($month == 04) { echo "It's a Match!!"; } else { echo "It's not
a Match!!"; }
  if ($month == 05) { echo "It's a Match!!"; } else { echo "It's not
a Match!!"; }
  if ($month == 06) { echo "It's a Match!!"; } else { echo "It's not
a Match!!"; }
  if ($month == 07) { echo "It's a Match!!"; } else { echo "It's not
a Match!!"; }
  if ($month == 08) { echo "It's a Match!!"; } else { echo "It's not
a Match!!"; }
  if ($month == 09) { echo "It's a Match!!"; } else { echo "It's not
a Match!!"; }
  if ($month == 10) { echo "It's a Match!!"; } else { echo "It's not
a Match!!"; }
  if ($month == 11) { echo "It's a Match!!"; } else { echo "It's not
a Match!!"; }
  if ($month == 12) { echo "It's a Match!!"; } else { echo "It's not
a Match!!"; }

  echo "";
   }

   //Strange Workaround to 08 and 09 ===
   echo "Strange Workaround to the Problem!!";

   $month = substr($VARIABLE[7],5,2);
   echo "The # of month is 08";
   if (trim($month) == 8) {
  echo "It's working!!!";
   }

   $month = substr($VARIABLE[8],5,2);
   echo "The # of month is 09";
   if (trim($month) == 9) {
  echo "It's working!!!";
   }

   //Testing (Should this be working or not??) =
   echo "";
   $month = substr($VARIABLE[0],5,2);
   echo "The # of month is 1";
   if (trim($month) == 1) { //With "1" as an integer...
  echo "It's working!!!";
   }

   echo "";
   $month = substr($VARIABLE[0],5,2);
   echo "The # of month is 01";
   if (trim($month) == 01) { //With "01" as an integer
  echo "It's working!!!";
   }

   echo "";
   $month = substr($VARIABLE[0],5,2);
   echo "The # of month is 1";
   if (trim($month) == "1") { //With "1" as an integer...
  echo "It's working!!!";
   }

   echo "";
   $month = substr($VARIABLE[0],5,2);
   echo "The # of month is 01";
   if (trim($month) == "01") { //With "01" as an integer
  echo "It's working!!!";
   }
?>
--clip--



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




Re: [PHP] IE 'Back' Button problem + SELECT dropdowns

2003-01-27 Thread Andre Dubuc
Thanks John,

I sort of thought that it should work. Will do as you suggest.

Regards,
Andre

On Monday 27 January 2003 12:28 pm, John W. Holmes wrote:
> > I tried to pick up the values from $_POST (as above).  In Linux, it
>
> works:
> > (i.e. I can pick them up, display them, and manipulate them using the
>
> code
>
> > above), but in IE something like $_POST['bday'] never shows up. Any
>
> idea
>
> > why
> > there's such a difference between OS behavior?
>
> No. $_POST['bday'] should always show up, regardless of OS, if the
> scripts and PHP version are the same. Double check your logic.
>
> ---John W. Holmes...
>
> PHP Architect - A monthly magazine for PHP Professionals. Get your copy
> today. http://www.phparch.com/

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




Re: [PHP] IFRAMES & PHP

2003-01-27 Thread Greg
Thank you guys for all the help, I'll try a few of these things, if not I'll
just redesign the page.
-Greg

"Adrian [EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote in
message 00e001c2c631$b402e160$1a8f43d9@ADE2">news:00e001c2c631$b402e160$1a8f43d9@ADE2...
> hmm.. it'll get real ugly with javascript,but this works with newer
> browsers.
> ...iframe has a name
> ...main page has a hidden form field with id   checkbox in the iframe has
id
> also
>
> iframe.php
> 
> 
> 
>  function submit_form(){
>
>  if(frames["myiframe"].document.getElementById("one").checked ==
true){//see
> if the checkbox in iframe is checked
> // if it is checked assign it's value to the hidden field in this page
> document.getElementById("one_copy").value =
> frames["myiframe"].document.getElementById("one").value;
> }
>   document.form1.submit();
> }
> 
> 
>
> 
>  if($_POST['test1']){
> echo $_POST['test1'] . '' . $_POST['one_copy'];
> }
> ?>
>  
>  
>
>  
>  
>  
>  
> 
> 
>
>
> iframetest.htm
> 
> 
>  
>  
>  
> 
> 
>
>
>
> - Original Message -
> From: "John W. Holmes" <[EMAIL PROTECTED]>
> To: "'Greg'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
> Sent: Monday, January 27, 2003 5:31 PM
> Subject: RE: [PHP] IFRAMES & PHP
>
>
> > > Unfortunatly, that gets rid of the reason I have the iframe in there
> > to
> > > begin with.  I need a scrollable iframe with a set of buttons that
> > perform
> > > certain actions at the top, that have to always be at the top.
> > > -Greg
> >
> > Then put the entire  into the iframe.
> >
> > ---John W. Holmes...
> >
> > PHP Architect - A monthly magazine for PHP Professionals. Get your copy
> > today. http://www.phparch.com/
> >
> >
> >
> > --
> > 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] Simple Solution To Login And Upload

2003-01-27 Thread 1LT John W. Holmes
> Hi guys, I am looking for a very simple login script that logs a person
> in with a unique login username/password and then logs them into a very
> basic control panel where they can upload image files and delete them.
> Can anybody help me out that would be much appreciated.

www.hotscripts.com
www.sourceforge.net
www.phpclasses.org

Unless you want to send me a very simple check to write it for you?? :)

---John Holmes...

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




[PHP] Simple Solution To Login And Upload

2003-01-27 Thread Randum Ian
Hi guys, I am looking for a very simple login script that logs a person
in with a unique login username/password and then logs them into a very
basic control panel where they can upload image files and delete them.
Can anybody help me out that would be much appreciated.

Cheers, Ian.


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




Re: [PHP] IFRAMES & PHP

2003-01-27 Thread adrian [EMAIL PROTECTED]
hmm.. it'll get real ugly with javascript,but this works with newer
browsers.
...iframe has a name
...main page has a hidden form field with id   checkbox in the iframe has id
also

iframe.php



 function submit_form(){

 if(frames["myiframe"].document.getElementById("one").checked == true){//see
if the checkbox in iframe is checked
// if it is checked assign it's value to the hidden field in this page
document.getElementById("one_copy").value =
frames["myiframe"].document.getElementById("one").value;
}
  document.form1.submit();
}




' . $_POST['one_copy'];
}
?>
 
 

 
 
 
 




iframetest.htm


 
 
 





- Original Message -
From: "John W. Holmes" <[EMAIL PROTECTED]>
To: "'Greg'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Monday, January 27, 2003 5:31 PM
Subject: RE: [PHP] IFRAMES & PHP


> > Unfortunatly, that gets rid of the reason I have the iframe in there
> to
> > begin with.  I need a scrollable iframe with a set of buttons that
> perform
> > certain actions at the top, that have to always be at the top.
> > -Greg
>
> Then put the entire  into the iframe.
>
> ---John W. Holmes...
>
> PHP Architect - A monthly magazine for PHP Professionals. Get your copy
> today. http://www.phparch.com/
>
>
>
> --
> 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] Do php extension need to be thread-safe?

2003-01-27 Thread Joshua Moore-Oliva
Do php extension need to be thread-safe?  I am running php on apache2.  I 
would guess that since it's compiled in as a module, it would need to be 
thread-safe correct?

Josh.

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




RE: [PHP] IFRAMES & PHP

2003-01-27 Thread Jon Haworth
Hi Greg,

> But the buttons are outside of the iframe, so that no matter how 
> large the frame gets, the buttons are always in the same place :/

So stick an image of the button outside the , wrap it in an , and
use the onclick handler to call a javascript function that submits the form.
Of course, this will break for anyone who doesn't have javascript enabled
(some estimates put this as high as 20%, but it depends on your audience).

Alternatively, put your form inside a  with a fixed height and width,
and the overflow property set to "scroll" or "auto". This should behave in
much the same way as your , but with everything on the same page.
Again, this will break for some users (those whose browsers
*cough*NN4*cough* don't support fixed positioning and overflow), but at
least it degrades more gracefully than the scripted solution.

Thirdly, if you provide a link to a sample page, someone might be able to
come up with a way to rework your form so you can avoid all this entirely
:-)

Cheers
Jon

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




Re: [PHP] question about GD and colors

2003-01-27 Thread Philipp
Hi Adrian,

thank you very much, that solved my problem.


Regards,
Philipp



- Original Message -
From: "adrian [EMAIL PROTECTED]" <[EMAIL PROTECTED]>
To: "Philipp" <[EMAIL PROTECTED]>; "Jean-François Marseaut"
<[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Monday, January 27, 2003 6:10 PM
Subject: Re: [PHP] question about GD and colors


> try imagecreatetruecolor()  instead of imagecreate()
>
> - Original Message -
> From: "Philipp" <[EMAIL PROTECTED]>
> To: "Jean-François Marseaut" <[EMAIL PROTECTED]>;
> <[EMAIL PROTECTED]>
> Sent: Monday, January 27, 2003 4:21 PM
> Subject: Re: [PHP] question about GD and colors
>
>
> > Hi experienced the same problem with the new
> > bundled version of GD.
> >
> > regards,
> > philipp
> >
> >
> > - Original Message -
> > From: "Jean-François Marseaut" <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Monday, January 27, 2003 5:15 PM
> > Subject: [PHP] question about GD and colors
> >
> >
> > > With this script under, I get resized image in only 16 colors. with an
> old
> > > version of gd, I got 16 million colors images. Has someone a response
?
> > >
> > >
> > >  > > /***
> > > file [string] -> filename jpg
> > > w [int] -> width
> > > /
> > >
> > > header("Content-type: image/png");
> > >
> > > $file = urldecode($file);
> > > $file = "../".$file;
> > >
> > > $infofile = getimagesize($file);
> > > $long = $infofile[1];
> > > $haut = $infofile[0];
> > > $type = $infofile[2];
> > >
> > > if ($long<$w) $w=$long;
> > >
> > >
> > > $ratio = $haut / $w;
> > > $h = $long / $ratio;
> > >
> > > if ($h>$w)
> > > {
> > >   $h = $w;
> > >   $ratio = $long / $w;
> > >   $w = $haut / $ratio;
> > > }
> > >
> > >
> > > $h = (int)$h;
> > >
> > > $dst_img = ImageCreate($w, $h);
> > > $background_color = ImageColorAllocate ($dst_img, 0, 0, 0);
> > >
> > > switch ($type)
> > > {
> > > case 1 :
> > > $src_img=ImageCreateFromGif($file);
> > > break;
> > > case 2 :
> > > $src_img=ImageCreateFromJpeg($file);
> > > break;
> > > case 3 :
> > > $src_img=ImageCreateFromPng($file);
> > > break;
> > > case 6 :
> > > $src_img=imagecreatefromwbmp($file);
> > > break;
> > > default :
> > > ImagePng($dst_img);
> > >
> > > }
> > >
> > > imagecopyresampled($dst_img, $src_img, 0, 0, 0, 0, $w, $h,
> > > ImageSX($src_img), ImageSY($src_img));
> > > imagepng($dst_img);
> > >
> > >
> > > --
> > > 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] IFRAMES & PHP

2003-01-27 Thread Sean Burlington
Greg wrote:

Unfortunatly, that gets rid of the reason I have the iframe in there to
begin with.  I need a scrollable iframe with a set of buttons that perform
certain actions at the top, that have to always be at the top.
-Greg




in that case you either need to try getting some javascript to pass the 
info between frames - or see if there is some style sheet wizadry (fixed 
size divs, visible area, clipping ...???) that will produce the same 
effect on an acceptable proportion of browsers



"Sean Burlington" <[EMAIL PROTECTED]

.uk> wrote in message

[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...


Greg wrote:


Here's the basic layout of my html page, this isn't the real html, just


the


basic idea.











Now inside iframetest.php I have a few check boxes that I want test.php


to


be able to access.  Is there any way to do this?
Thanks!!




not directly ..

 the form does not 'contain' the iframe - in fact the iframe is a
different page ...

so form elements within the iframe page will not be a part of the form
submission process

you /might/ be able to do something with javascript inter-frame
communication - but I doubt you would want to (and the iframe doesn't
sound like a valid page which could cause problems)

what would probably make more sense would be to make the 'html' page
include iframetest.php'

html.php
--







 
 
 

-

then you form elements will be properly contained within the form

--

Sean










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




Re: [PHP] IFRAMES & PHP

2003-01-27 Thread Greg
But the buttons are outside of the iframe, so that no matter how large the
frame gets, the buttons are always in the same place :/
-Greg

"John W. Holmes" <[EMAIL PROTECTED]> wrote in message
000501c2c629$f98c8590$7c02a8c0@coconut">news:000501c2c629$f98c8590$7c02a8c0@coconut...
> > Unfortunatly, that gets rid of the reason I have the iframe in there
> to
> > begin with.  I need a scrollable iframe with a set of buttons that
> perform
> > certain actions at the top, that have to always be at the top.
> > -Greg
>
> Then put the entire  into the iframe.
>
> ---John W. Holmes...
>
> PHP Architect - A monthly magazine for PHP Professionals. Get your copy
> today. http://www.phparch.com/
>
>



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




Re: [PHP] Question about SSL/php globals

2003-01-27 Thread Wei Weng
Thanks for the prompt reply!

One more question, do you know how PHP implements this variable? In other words,
how does PHP detect whether the connection is SSLed or not? (Specific to apache)

Thanks!

Wei


- Original Message -
From: "Philip Olson" <[EMAIL PROTECTED]>
To: "Wei Weng" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Monday, January 27, 2003 12:19 PM
Subject: Re: [PHP] Question about SSL/php globals


>
> On Mon, 27 Jan 2003, Wei Weng wrote:
>
> > Is there any environment/Global variable in PHP that indicates whether the
> > server port you connect to is SSL port?
>
> $_SERVER['HTTPS']
>
> Regards,
> Philip
>
>
> --
> 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] IFRAMES & PHP

2003-01-27 Thread John W. Holmes
> Unfortunatly, that gets rid of the reason I have the iframe in there
to
> begin with.  I need a scrollable iframe with a set of buttons that
perform
> certain actions at the top, that have to always be at the top.
> -Greg

Then put the entire  into the iframe.

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/



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




Re: [PHP] IFRAMES & PHP

2003-01-27 Thread Chris Boget
> It's probably an HTML thing. I don't know how iframes are interpreted,
> but it's probably not really a part of your form, even though it looks
> like it is when you view it.

The contents of an IFRAME, by definition, is a totally different document.
It behaves for all intents and purposes as a normal frame except that it
appears inline.  You may or may not be able to access the contents via
the DOM of the document it is part of - I've never tried.  But in any case,
it will not be posted as part of the form.

Chris


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




Re: [PHP] IFRAMES & PHP

2003-01-27 Thread Greg
Unfortunatly, that gets rid of the reason I have the iframe in there to
begin with.  I need a scrollable iframe with a set of buttons that perform
certain actions at the top, that have to always be at the top.
-Greg


"Sean Burlington" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Greg wrote:
> > Here's the basic layout of my html page, this isn't the real html, just
the
> > basic idea.
> >
> > 
> > 
> > 
> >
> > 
> >
> > 
> > 
> > 
> >
> > Now inside iframetest.php I have a few check boxes that I want test.php
to
> > be able to access.  Is there any way to do this?
> > Thanks!!
> >
> >
>
> not directly ..
>
>   the form does not 'contain' the iframe - in fact the iframe is a
> different page ...
>
> so form elements within the iframe page will not be a part of the form
> submission process
>
> you /might/ be able to do something with javascript inter-frame
> communication - but I doubt you would want to (and the iframe doesn't
> sound like a valid page which could cause problems)
>
> what would probably make more sense would be to make the 'html' page
> include iframetest.php'
>
> html.php
> --
>
> 
> 
> 
>
> 
>
>   
>   
>   
>
> -
>
> then you form elements will be properly contained within the form
>
> --
>
> Sean
>



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




RE: [PHP] IE 'Back' Button problem + SELECT dropdowns

2003-01-27 Thread John W. Holmes

> I tried to pick up the values from $_POST (as above).  In Linux, it
works:
> (i.e. I can pick them up, display them, and manipulate them using the
code
> above), but in IE something like $_POST['bday'] never shows up. Any
idea
> why
> there's such a difference between OS behavior?

No. $_POST['bday'] should always show up, regardless of OS, if the
scripts and PHP version are the same. Double check your logic.

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/



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




RE: [PHP] IFRAMES & PHP

2003-01-27 Thread John W. Holmes
> Here's the basic layout of my html page, this isn't the real html,
just
> the
> basic idea.
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> Now inside iframetest.php I have a few check boxes that I want
test.php to
> be able to access.  Is there any way to do this?

If you set a hidden form element in iframetest.php, does it show up when
you do a print_r($_POST) in test.php ?

It's probably an HTML thing. I don't know how iframes are interpreted,
but it's probably not really a part of your form, even though it looks
like it is when you view it.

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/



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




Re: [PHP] IFRAMES & PHP

2003-01-27 Thread Sean Burlington
Greg wrote:

Here's the basic layout of my html page, this isn't the real html, just the
basic idea.











Now inside iframetest.php I have a few check boxes that I want test.php to
be able to access.  Is there any way to do this?
Thanks!!




not directly ..

 the form does not 'contain' the iframe - in fact the iframe is a 
different page ...

so form elements within the iframe page will not be a part of the form 
submission process

you /might/ be able to do something with javascript inter-frame 
communication - but I doubt you would want to (and the iframe doesn't 
sound like a valid page which could cause problems)

what would probably make more sense would be to make the 'html' page 
include iframetest.php'

html.php
--







 
 
 

-

then you form elements will be properly contained within the form

--

Sean


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



Re: [PHP] Strip_Tags @ php 4.3

2003-01-27 Thread Philip Olson
On Mon, 27 Jan 2003, George E. Papadakis wrote:

> Hello,
> 
> Has anyone noticed strange behaviour in strap_tags @ php 4.3?
> We did upgrade to the latest snap yet the problem remains. For some reason
> strip_tags acts weird..

Please be specific with a short self-contained example
that demonstrates your definition of "weird"

Regards,
Philip


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




Re: [PHP] Question about SSL/php globals

2003-01-27 Thread Philip Olson

On Mon, 27 Jan 2003, Wei Weng wrote:

> Is there any environment/Global variable in PHP that indicates whether the
> server port you connect to is SSL port?

$_SERVER['HTTPS']

Regards,
Philip


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




[PHP] Question about SSL/php globals

2003-01-27 Thread Wei Weng
Is there any environment/Global variable in PHP that indicates whether the
server port you connect to is SSL port?

Thanks!


Wei


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




Re: [PHP] question about GD and colors

2003-01-27 Thread adrian [EMAIL PROTECTED]
try imagecreatetruecolor()  instead of imagecreate()

- Original Message -
From: "Philipp" <[EMAIL PROTECTED]>
To: "Jean-François Marseaut" <[EMAIL PROTECTED]>;
<[EMAIL PROTECTED]>
Sent: Monday, January 27, 2003 4:21 PM
Subject: Re: [PHP] question about GD and colors


> Hi experienced the same problem with the new
> bundled version of GD.
>
> regards,
> philipp
>
>
> - Original Message -
> From: "Jean-François Marseaut" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Monday, January 27, 2003 5:15 PM
> Subject: [PHP] question about GD and colors
>
>
> > With this script under, I get resized image in only 16 colors. with an
old
> > version of gd, I got 16 million colors images. Has someone a response ?
> >
> >
> >  > /***
> > file [string] -> filename jpg
> > w [int] -> width
> > /
> >
> > header("Content-type: image/png");
> >
> > $file = urldecode($file);
> > $file = "../".$file;
> >
> > $infofile = getimagesize($file);
> > $long = $infofile[1];
> > $haut = $infofile[0];
> > $type = $infofile[2];
> >
> > if ($long<$w) $w=$long;
> >
> >
> > $ratio = $haut / $w;
> > $h = $long / $ratio;
> >
> > if ($h>$w)
> > {
> >   $h = $w;
> >   $ratio = $long / $w;
> >   $w = $haut / $ratio;
> > }
> >
> >
> > $h = (int)$h;
> >
> > $dst_img = ImageCreate($w, $h);
> > $background_color = ImageColorAllocate ($dst_img, 0, 0, 0);
> >
> > switch ($type)
> > {
> > case 1 :
> > $src_img=ImageCreateFromGif($file);
> > break;
> > case 2 :
> > $src_img=ImageCreateFromJpeg($file);
> > break;
> > case 3 :
> > $src_img=ImageCreateFromPng($file);
> > break;
> > case 6 :
> > $src_img=imagecreatefromwbmp($file);
> > break;
> > default :
> > ImagePng($dst_img);
> >
> > }
> >
> > imagecopyresampled($dst_img, $src_img, 0, 0, 0, 0, $w, $h,
> > ImageSX($src_img), ImageSY($src_img));
> > imagepng($dst_img);
> >
> >
> > --
> > 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] IFRAMES & PHP

2003-01-27 Thread Greg
Here's the basic layout of my html page, this isn't the real html, just the
basic idea.











Now inside iframetest.php I have a few check boxes that I want test.php to
be able to access.  Is there any way to do this?
Thanks!!



"Chris Shiflett" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> --- Greg <[EMAIL PROTECTED]> wrote:
> > Hi, I have a form with an IFRAME nested in it. When
> > the form is submitted, I can't get the values of the
> > checkboxes in the IFRAME, is there any way to do
> > this?
>
> Well, I think (I could be wrong) you're looking at this
> wrong.
>
> Forms submit to resources identified by URLs. You specify
> this with the action attribute of the form tag. There is no
> idea of frames here.
>
> If you mean that the resource that your iframe loads does
> not have access to the form variables, then change your
> action attribute to that resource, and then it will.
>
> Chris



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




Re: [PHP] IE 'Back' Button problem + SELECT dropdowns

2003-01-27 Thread Andre Dubuc
On Monday 27 January 2003 11:46 am, 1LT John W. Holmes wrote:
> > I've managed to get Windows IE to pick up on most of my $_SESSION
>
> variables
>
> > once a user clicks the 'Back' button using the following code in the base
> > form:
> >
> > 'value= > ?>'
> >
> > However, when I try this approach for a muliple SELECT dropdown box that
>
> is
>
> > loaded by a 'require' statement, it doesn't pass the info. I've tried to
> > isolate the individual components:
> >
> >  >
> > if(!empty($_PST['bday'])) echo $_POST['bday'];
> > if(!empty($_POST['bmonth'])) echo $_POST['bmonth'];
> > if(!empty($_POST['birth'])) echo $_POST['birth'];
> >
> > if(!empty($_POST['dday'])) echo $_POST['dday'];
> > if(!empty($_POST['dmonth'])) echo $_POST['dmonth'];
> > if(!empty($_POST['death'])) echo $_POST['death'];
> > ?>
> >
> > Btw, the base form calls another form, which displays an error message.
>
> Once
>
> > the 'Back' button is clicked, the base form reappears. [I've also tried
> > putting a  around each if(!empty . . .); statement above
>
> with
>
> > same result.]
> >
> > Any ideas what I'm doing wrong? I've been at this one for a couple of
>
> weeks,
>
> > and nothing seems top work. Is it possible to pass the info back to the
>
> base
>
> > form?
>
> SELECT boxes work differently from text boxes. To set a select box to a
> certain value, you need to put SELECTED into the option tag, like:
>
> Text Value
>
> So, you need to create some loop or test to see where you should put the
> SELECTED. For short lists, doing something like:
>
>  $_SESSION['select'] == 'some_value') { echo " SELECTED"; }?>>Text
> Value
>
> For larger lists, it's easier to put the values into an array and make a
> function that loops through and test each value for where to put the
> SELECTED text.
>
> Hope that helps.
>
> ---John Holmes...


Thanks John,

Great to get your excellent advice again. I've been off-list for a few months.

Never thought of doing the extra coding IN the require file! That's probably 
why it didn't work. 

I tried to pick up the values from $_POST (as above).  In Linux, it works: 
(i.e. I can pick them up, display them, and manipulate them using the code 
above), but in IE something like $_POST['bday'] never shows up. Any idea why 
there's such a difference between OS behavior?

Tia,
Andre

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




Re: [PHP] IE 'Back' Button problem + SELECT dropdowns

2003-01-27 Thread 1LT John W. Holmes
> I've managed to get Windows IE to pick up on most of my $_SESSION
variables
> once a user clicks the 'Back' button using the following code in the base
> form:
>
> 'value='
>
> However, when I try this approach for a muliple SELECT dropdown box that
is
> loaded by a 'require' statement, it doesn't pass the info. I've tried to
> isolate the individual components:
>
> 
> if(!empty($_PST['bday'])) echo $_POST['bday'];
> if(!empty($_POST['bmonth'])) echo $_POST['bmonth'];
> if(!empty($_POST['birth'])) echo $_POST['birth'];
>
> if(!empty($_POST['dday'])) echo $_POST['dday'];
> if(!empty($_POST['dmonth'])) echo $_POST['dmonth'];
> if(!empty($_POST['death'])) echo $_POST['death'];
> ?>
>
> Btw, the base form calls another form, which displays an error message.
Once
> the 'Back' button is clicked, the base form reappears. [I've also tried
> putting a  around each if(!empty . . .); statement above
with
> same result.]
>
> Any ideas what I'm doing wrong? I've been at this one for a couple of
weeks,
> and nothing seems top work. Is it possible to pass the info back to the
base
> form?

SELECT boxes work differently from text boxes. To set a select box to a
certain value, you need to put SELECTED into the option tag, like:

Text Value

So, you need to create some loop or test to see where you should put the
SELECTED. For short lists, doing something like:

>Text
Value

For larger lists, it's easier to put the values into an array and make a
function that loops through and test each value for where to put the
SELECTED text.

Hope that helps.

---John Holmes...


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




[PHP] IE 'Back' Button problem + SELECT dropdowns

2003-01-27 Thread Andre Dubuc
Hi,

I've managed to get Windows IE to pick up on most of my $_SESSION variables 
once a user clicks the 'Back' button using the following code in the base 
form:

'value='

However, when I try this approach for a muliple SELECT dropdown box that is 
loaded by a 'require' statement, it doesn't pass the info. I've tried to 
isolate the individual components:



Btw, the base form calls another form, which displays an error message. Once 
the 'Back' button is clicked, the base form reappears. [I've also tried 
putting a  around each if(!empty . . .); statement above with 
same result.]

Any ideas what I'm doing wrong? I've been at this one for a couple of weeks, 
and nothing seems top work. Is it possible to pass the info back to the base 
form?

Tia,
Andre

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




Re: [PHP] question about GD and colors

2003-01-27 Thread Philipp
Hi experienced the same problem with the new
bundled version of GD.

regards,
philipp


- Original Message -
From: "Jean-François Marseaut" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, January 27, 2003 5:15 PM
Subject: [PHP] question about GD and colors


> With this script under, I get resized image in only 16 colors. with an old
> version of gd, I got 16 million colors images. Has someone a response ?
>
>
>  /***
> file [string] -> filename jpg
> w [int] -> width
> /
>
> header("Content-type: image/png");
>
> $file = urldecode($file);
> $file = "../".$file;
>
> $infofile = getimagesize($file);
> $long = $infofile[1];
> $haut = $infofile[0];
> $type = $infofile[2];
>
> if ($long<$w) $w=$long;
>
>
> $ratio = $haut / $w;
> $h = $long / $ratio;
>
> if ($h>$w)
> {
>   $h = $w;
>   $ratio = $long / $w;
>   $w = $haut / $ratio;
> }
>
>
> $h = (int)$h;
>
> $dst_img = ImageCreate($w, $h);
> $background_color = ImageColorAllocate ($dst_img, 0, 0, 0);
>
> switch ($type)
> {
> case 1 :
> $src_img=ImageCreateFromGif($file);
> break;
> case 2 :
> $src_img=ImageCreateFromJpeg($file);
> break;
> case 3 :
> $src_img=ImageCreateFromPng($file);
> break;
> case 6 :
> $src_img=imagecreatefromwbmp($file);
> break;
> default :
> ImagePng($dst_img);
>
> }
>
> imagecopyresampled($dst_img, $src_img, 0, 0, 0, 0, $w, $h,
> ImageSX($src_img), ImageSY($src_img));
> imagepng($dst_img);
>
>
> --
> 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] IFRAMES & PHP

2003-01-27 Thread Chris Shiflett
--- Greg <[EMAIL PROTECTED]> wrote:
> Hi, I have a form with an IFRAME nested in it. When
> the form is submitted, I can't get the values of the
> checkboxes in the IFRAME, is there any way to do
> this?

Well, I think (I could be wrong) you're looking at this
wrong.

Forms submit to resources identified by URLs. You specify
this with the action attribute of the form tag. There is no
idea of frames here.

If you mean that the resource that your iframe loads does
not have access to the form variables, then change your
action attribute to that resource, and then it will.

Chris

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




[PHP] question about GD and colors

2003-01-27 Thread Jean-François Marseaut
With this script under, I get resized image in only 16 colors. with an old
version of gd, I got 16 million colors images. Has someone a response ?


 filename jpg
w [int] -> width
/

header("Content-type: image/png");

$file = urldecode($file);
$file = "../".$file;

$infofile = getimagesize($file);
$long = $infofile[1];
$haut = $infofile[0];
$type = $infofile[2];

if ($long<$w) $w=$long;


$ratio = $haut / $w;
$h = $long / $ratio;

if ($h>$w)
{
  $h = $w;
  $ratio = $long / $w;
  $w = $haut / $ratio;
}


$h = (int)$h;

$dst_img = ImageCreate($w, $h);
$background_color = ImageColorAllocate ($dst_img, 0, 0, 0);

switch ($type)
{
case 1 :
$src_img=ImageCreateFromGif($file);
break;
case 2 :
$src_img=ImageCreateFromJpeg($file);
break;
case 3 :
$src_img=ImageCreateFromPng($file);
break;
case 6 :
$src_img=imagecreatefromwbmp($file);
break;
default :
ImagePng($dst_img);

}

imagecopyresampled($dst_img, $src_img, 0, 0, 0, 0, $w, $h,
ImageSX($src_img), ImageSY($src_img));
imagepng($dst_img);


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




[PHP] IFRAMES & PHP

2003-01-27 Thread Greg
Hi, I have a form with an IFRAME nested in it.  When the form is submitted,
I can't get the values of the checkboxes in the IFRAME, is there any way to
do this?  Thanks!
-Greg



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




  1   2   >