[PHP] Alternative to cURL

2003-10-14 Thread Paul van Schayck
Hello everyone,

I want to send a form to a different server without user input. Auto fill a  
form ($_POST or $_GET). People will still click a link. So it could be a 
client-side sollution. cURL is the logical sollution but is there an 
alternative, client or server side.
I was thinking about FSockOpen and putting a header() inside so the 
location in the browser looks like the other domain. Would this be 
possible.

Regards,
Paul van Schayck

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



php-general Digest 14 Oct 2003 09:57:11 -0000 Issue 2354

2003-10-14 Thread php-general-digest-help

php-general Digest 14 Oct 2003 09:57:11 - Issue 2354

Topics (messages 166014 through 166048):

Re: what is the best PHP editor?
166014 by: Ryan A
166016 by: Daniel Guerrier
166017 by: Chris Boget
166019 by: Rob Adams
166021 by: Jonathan Villa
166022 by: Scott Fletcher
166045 by: Davy Obdam

Re: FTP resumepos
166015 by: Curt Zirzow

Re: provide flag -X when connecting to mysql
166018 by: Marek Kilimajer

header() function for displaying an opened PDF document.
166020 by: Scott Fletcher
166023 by: Kevin Stone
166029 by: Scott Fletcher
166031 by: Kevin Stone
166032 by: Bertrand Moulard
166033 by: Bertrand Moulard

Re: php variable
166024 by: Scott Fletcher
166025 by: Scott Fletcher
166039 by: Tom Rogers

Re: Restarting Apache without screwing up running scripts?
166026 by: Scott Fletcher

Re: php convert html to pdf
166027 by: Scott Fletcher
166030 by: Scott Fletcher
166038 by: hycn office

Re: Problem with session_destroy() don't work
166028 by: Scott Fletcher

Slow searches in large database
166034 by: Adrian Teasdale
166035 by: Chris W. Parker
166036 by: Miles Thompson
166046 by: Rory McKinley

(newbie) How to keep files ?
166037 by: Sudheer Palaparambil
166041 by: Mohamed Lrhazi

Re: \n \t don't work!!!
166040 by: Chris Shiflett

Passing variables between pages
166042 by: Rashini Jayasinghe
166043 by: Raditha Dissanayake
166044 by: John Nichel

Foreach Array Help
166047 by: Jed R. Brubaker

Alternative to cURL
166048 by: Paul van Schayck

Administrivia:

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

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

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


--
--- Begin Message ---
Hey Chris,
After reading your post I too downloaded SlickEdit...I personally use a mix
of Zend and EditPlus
Just opened slickEdit and it seems a bit complicated but more java
oriented...mind telling me why you have such a preference for this?

Cheers,
-Ryan A
http://bestwebhosters.com




> I am not sure what you would consider reasonably priced, but the best
> editor I've come across is Visual Slick Edit.  Bar none, the best and
> most feature rich editor I've come across in the last few years.

Hmm.. I downloaded Slick Edit and didn't think it was any better than
the free HTML-Kit. Have you ever used HTML-Kit and if so, what do you
think is so great about VSE?

I didn't spend a huge amount of time with the configuration of VSE but I
couldn't get it to view my Japanese pages properly. Can you set the
character encoding in VSE?



Chris.

p.s. My vote is for HTML-Kit from www.chami.com.

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

It's good.
How good, is up to you.

--- Rob Adams <[EMAIL PROTECTED]> wrote:
> I like EditPlus too, but recently I've been using
> UltraEdit.
> http://www.ultraedit.com/
> $35 registration.  Has great column mode support.  I
> use the macros and
> templates all the time.  Has a word file for PHP.
> 
>   -- Rob
> 
> 
> 
> "Dougd" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> > I currently use EditPlus - and like it -- is there
> anything else out there
> > that is better and still reasonably priced.
> >
> > Thanks.
> >
> > -Doug
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


__
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com
--- End Message ---
--- Begin Message ---
> Hey Chris,
> After reading your post I too downloaded SlickEdit...I personally use a mix
> of Zend and EditPlus
> Just opened slickEdit and it seems a bit complicated but more java
> oriented...mind telling me why you have such a preference for this?

It's actually C/C++/Java oriented.  But you can set up and configure a PHP
extension.
As to why I like VSE, it is highly configurable and has a fairly powerful macro
language.  Just about every piece of internal functionality (ie, any of the menu
options, highlight text, cursor movements, etc) are set up as macro functions.
As a result, you can assign them to any custom button or add them to just about
any right click menu (right click and select 'Edit This Menu' at the bottom).

Little useful toys such as paren & brace matching, automatic indent (even for cut 
and pasted code), customizable syntax highlighting, JavaDoc comments aware, 
different emulation styles (emacs, VC++, etc), Tagging[1], etc.

As I said before, it has definitely increased my productivity.

Chris

Re: [PHP] Foreach Array Help

2003-10-14 Thread Marek Kilimajer
foreach(array_expression as $key => $value)

So you are looping the array key and it is a scalar value (int).

Jed R. Brubaker wrote:
Okay, total newbie when it comes to arrays, and I could really use some
help. I sure this will be an easy one for you veterans out there.
Here is the array ($code):
array(2) {
  ["total"]=>
  int(1)
  ["assign"]=>
  array(1) {
[1]=>
array(3) {
  ["type"]=>
  string(10) "Transcript"
  ["rows"]=>
  string(3) "603"
  ["codeapply"]=>
  array(1) {
[1]=>
array(3) {
  ["codeset"]=>
  string(23) "FFT 6 Level Code System"
  ["code_rows"]=>
  string(3) "302"
  ["code_complete"]=>
  string(1) "2"
}
  }
}
  }
}
Here is the output code:
foreach ($this->code['assign'] as $assign => $details)
{
foreach ($assign['codeapply'] as $codeapply => $ca_details)
{
echo "";
echo"";
echo$details['type']." ".$assign;
echo"";
echo"";
echo"";
echo$ca_details['codeset'];
echo"";
echo"";
echo
$ca_details['code_complete']."/".$ca_details['code_rows']." Items Coded";
echo"";
echo"";
printf  (" %.0d%%",
($ca_details['code_complete']/$ca_details['code_rows'])*100);
echo"";
echo "";
}
}
Output error:
Warning: Cannot use a scalar value as an array
Warning: Invalid argument supplied for foreach()
Conceptually and practically I have been struggling with how to navigate
levels of the arrays which are defined by a variable (e.g.
$code['assign'][$i] for the assign ID and $code['assign'][$i][$j] for the
codeapply ID on the assign ID).
Thanks in advance!

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


[PHP] where is my session data on my new server?

2003-10-14 Thread David T-G
Hi, all --

We have some existing code running under php 4.2.3 on a FreeBSD 4.5
server and we just lit up a new php 4.3rc1 FBSD 4.8 server to handle our
growth (yay! :-)

All of our scripts source a central include file which sets lots of
things including some session variables, one of which is $pw.  When you
get to a password-protected page, we check $pw and if it is correct you
continue ahead but if not (either empty or wrong) it's unset and then
you're prompted.  We session.save at the end of the page.

On the first server when you enter the password and hit the button the
page comes back up with $pw set and in you go.  On the second server $pw
is always empty and we are endlessly prompted.

I ran a phpinfo() comparison and didn't see anything markedly different
(except for how the output is formatted, which made things delightfully
more challenging), but I also don't know for what I'm looking.  I also
don't know what other information I should provide, but I'm hesitant to
bomb the list with two phpinfo() outputs :-) so I'll hold off on that
until someone asks for them.

Do you have any pointers to what I hope is a very simple fix?


TIA & HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!



pgp0.pgp
Description: PGP signature


RE: [PHP] newbie question

2003-10-14 Thread Ford, Mike [LSS]
On 13 October 2003 13:49, 'Eugene Lee' wrote:

> On Mon, Oct 13, 2003 at 10:32:18AM +0100, Ford, Mike
>  [LSS] wrote:
> > 
> > On 12 October 2003 23:36, Eugene Lee wrote:
> > > 
> > > The PHP manual is vague in several sections.  I wonder how bug
> > > reports get submitted for it?
> > 
> > http://bugs.php.net/report.php and select "Documentation problem"
> > from the "Type of bug" drop-down.  (But read the bug-reporting
> > guidelines at http://php.bugs.php.net/ first!)
> 
> Thanks Mike, I'll give it a read when I get free!

Whoops! -- that second URL should, of course, be just http://bugs.php.net/.

Cheers!

Mike

-
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730  Fax:  +44 113 283 3211 

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



RE: [PHP] where is my session data on my new server?

2003-10-14 Thread Ford, Mike [LSS]
On 14 October 2003 11:26, David T-G wrote:


> On the first server when you enter the password and hit the button the
> page comes back up with $pw set and in you go.  On the second
> server $pw
> is always empty and we are endlessly prompted.
> 
> I ran a phpinfo() comparison and didn't see anything markedly
> different (except for how the output is formatted, which made things
> delightfully more challenging), but I also don't know for what I'm
> looking.  I also don't know what other information I should provide,
> but I'm 
> hesitant to
> bomb the list with two phpinfo() outputs :-)

Well, rather than post two complete phpinfos, can you hone it down to just those 
entries which *are* different.  I'd particularly be looking at all the session.* 
entries (obviously!), as well as register_globals, and possibly variables_order.

It might also help to post a (short!) fragment of the relevant code.

Cheers!

Mike

-
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730  Fax:  +44 113 283 3211 

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



Re: [PHP] ftp_connect() issues

2003-10-14 Thread Burhan Khalid
Could it be that your script is timing out? Did the php version change?

--
Burhan Khalid
phplist[at]meidomus[dot]com
http://www.meidomus.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Help needed - Dynamically Zip Files & Sub-Directories

2003-10-14 Thread TWSC HQ
Hi everybody -

What is wrong with this php zip class (file : phpzip.inc.php)?

I've got this code on one page:

require("phpzip.inc.php");
 $z = new PHPZip();
 $z -> Zip("directory_name/", "out.zip");

where all files and sub-directories + files should be zipped into the zip
file called out.zip

trouble is the class does zip the files in the "directory_name" directory
but does not include the subdirectories and their files.
Works on Windows server but not on unix server

Thanks!

this is the class:

 GetFileList($dir);
   }

   if ((!empty($dir))&&(!is_array($dir))&&(file_exists($dir))) chdir($dir);
   else chdir($curdir);

   if (count($filelist)>0)
   {
foreach($filelist as $filename)
{
 if (is_file($filename))
 {
  $fd = fopen ($filename, "r");
  $content = fread ($fd, filesize ($filename));
  fclose ($fd);

  if (is_array($dir)) $filename = basename($filename);
  $this -> addFile($content, $filename);
 }
}
$out = $this -> file();

chdir($curdir);
$fp = fopen($zipfilename, "w");
fwrite($fp, $out, strlen($out));
fclose($fp);
   }
   return 1;
  }
  else return 0;
 }

 function GetFileList($dir)
 {
  if (file_exists($dir))
  {
   $args = func_get_args();
   $pref = $args[1];

   $dh = opendir($dir);
   while($files = readdir($dh))
   {
if (($files!=".")&&($files!=".."))
{
 if (is_dir($dir.$files))
 {
  $curdir = getcwd();
  chdir($dir.$files);
  $file = array_merge($file, $this -> GetFileList("", "$pref$files/"));
  chdir($curdir);
 }
 else $file[]=$pref.$files;
}
   }
   closedir($dh);
  }
  return $file;
 }

var $datasec  = array();
var $ctrl_dir = array();
var $eof_ctrl_dir = "\x50\x4b\x05\x06\x00\x00\x00\x00";
var $old_offset   = 0;

/**
 * Converts an Unix timestamp to a four byte DOS date and time format
(date
 * in high two bytes, time in low two bytes allowing magnitude
comparison).
 *
 * @param  integer  the current Unix timestamp
 *
 * @return integer  the current date in a four byte DOS format
 *
 * @access private
 */
function unix2DosTime($unixtime = 0) {
$timearray = ($unixtime == 0) ? getdate() : getdate($unixtime);

if ($timearray['year'] < 1980) {
 $timearray['year']= 1980;
 $timearray['mon'] = 1;
 $timearray['mday']= 1;
 $timearray['hours']   = 0;
 $timearray['minutes'] = 0;
 $timearray['seconds'] = 0;
} // end if

return (($timearray['year'] - 1980) << 25) | ($timearray['mon'] <<
21) | ($timearray['mday'] << 16) |
($timearray['hours'] << 11) | ($timearray['minutes'] << 5) |
($timearray['seconds'] >> 1);
} // end of the 'unix2DosTime()' method


/**
 * Adds "file" to archive
 *
 * @param  string   file contents
 * @param  string   name of the file in the archive (may contains the
path)
 * @param  integer  the current timestamp
 *
 * @access public
 */
function addFile($data, $name, $time = 0)
{
$data = str_replace("\x0a", "\x0d\x0a", $data);
$name = str_replace('\\', '/', $name);

$dtime= dechex($this->unix2DosTime($time));
$hexdtime = '\x' . $dtime[6] . $dtime[7]
  . '\x' . $dtime[4] . $dtime[5]
  . '\x' . $dtime[2] . $dtime[3]
  . '\x' . $dtime[0] . $dtime[1];
eval('$hexdtime = "' . $hexdtime . '";');

$fr   = "\x50\x4b\x03\x04";
$fr   .= "\x14\x00";// ver needed to extract
$fr   .= "\x00\x00";// gen purpose bit flag
$fr   .= "\x08\x00";// compression method
$fr   .= $hexdtime; // last mod time and date

// "local file header" segment
$unc_len = strlen($data);
$crc = crc32($data);
$zdata   = gzcompress($data);
$c_len   = strlen($zdata);
$zdata   = substr(substr($zdata, 0, strlen($zdata) - 4), 2); // fix
crc bug
$fr  .= pack('V', $crc); // crc32
$fr  .= pack('V', $c_len);   // compressed filesize
$fr  .= pack('V', $unc_len); // uncompressed filesize
$fr  .= pack('v', strlen($name));// length of filename
$fr  .= pack('v', 0);// extra field length
$fr  .= $name;

// "file data" segment
$fr .= $zdata;

// "data descriptor" segment (optional but necessary if archive is
not
// served as file)
$fr .= pack('V', $crc); // crc32
$fr .= pack('V', $c_len);   // compressed filesize
$fr .= pack('V', $unc_len); // uncompressed filesize

// add this entry to array
$this -> datasec[] = $fr;
$new_offset= strlen(implode('', $this->datasec));

// now add to central directory record
$cdrec

Re: [PHP] header() function for displaying an opened PDF document.

2003-10-14 Thread Marek Kilimajer
Are you using sessions? Then you need 
session_cache_limiter('private_no_expire');

Scott Fletcher wrote:

I seem to be having problem with sending the PDF document to the browser to
be open on screen.  I kept getting the error message, it say 'Windows cannot
open this file'.  Here's my sample script, so what am I doing wrong?...
--snip--
header("Content-Type: application/pdf");
header("Content-Length: '40736'");
header("Content-Disposition: inline; filename='junk.pdf'");
--snip--
Thanks,
 Scott F.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] header() function for displaying an opened PDF document.

2003-10-14 Thread Scott Fletcher
Not using the session.  :-)  Oh well...

"Marek Kilimajer" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Are you using sessions? Then you need
> session_cache_limiter('private_no_expire');
>
> Scott Fletcher wrote:
>
> > I seem to be having problem with sending the PDF document to the browser
to
> > be open on screen.  I kept getting the error message, it say 'Windows
cannot
> > open this file'.  Here's my sample script, so what am I doing wrong?...
> >
> > --snip--
> > header("Content-Type: application/pdf");
> > header("Content-Length: '40736'");
> > header("Content-Disposition: inline; filename='junk.pdf'");
> > --snip--
> >
> > Thanks,
> >  Scott F.
> >

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



Re: [PHP] header() function for displaying an opened PDF document.

2003-10-14 Thread Scott Fletcher
Sound like a good idea.  I'll see if I can find this on the Internet and see
what happen.

"Bertrand Moulard" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> now that I'm rethinking of it, I solved the problem by using the brilliant
> python program tcpwatch, which logs all the http data going in and out
your
> browser. Very easy to run and so handy (not only for this problem). Would
> find the url for dld if you want.
>
> cheers
>
> .b
>
> -Original Message-
> From: Scott Fletcher [mailto:[EMAIL PROTECTED]
> Sent: 13 October 2003 22:15
> To: [EMAIL PROTECTED]
> Subject: [PHP] header() function for displaying an opened PDF document.
>
>
> I seem to be having problem with sending the PDF document to the browser
to
> be open on screen.  I kept getting the error message, it say 'Windows
cannot
> open this file'.  Here's my sample script, so what am I doing wrong?...
>
> --snip--
> header("Content-Type: application/pdf");
> header("Content-Length: '40736'");
> header("Content-Disposition: inline; filename='junk.pdf'");
> --snip--
>
> Thanks,
>  Scott F.
>
> --
> 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: header() function for displaying an opened PDF document.

2003-10-14 Thread Scott Fletcher
Well, now, I get an unknown file type.  I have already specified the
application type.  This was yesterday.  Today, I get the file type as
'Acrobat Control for Active X'.  That doesn't look right...  Oh well...
Will have to play around and see what can I do to make it work better.  A
couple of months ago, I worked on making hte downloading and/or opening the
executable file from the website and had this similiar problem.  What helped
me to solve this problem is not to use the readfile() function, but with
fopen() instead.  We had customers calling about problem with downloading
but we got fewer customers calling us if I use the fopen() function instead.
I put in more header script and it also reduced the problem for IE user.
Then finally solved most of the problem by putting in the exit() function at
the end of hte header script.  It seem that IE don't know how to tell if the
downloading or opening/running had begun.  Kind of suck, though

"Kevin Stone" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I'm sorry but it can't be done.  You cannot output a file without printing
it to the output buffer.  You cannot print a file to the output buffer
without opening the file into memory.  You cannot open a file into memory
without using a function like fopen() or readfile().  It's as simple as
that.
>
> There must be something wrong with Internet Explorer on your end.  Corrupt
files perhaps?  Try installing the latest update, or use system restore to
go back a few weeks, or reinstall the components from the Windows CD.
That's my best advice.  But I guarentee this is not a PHP problem and that
there is no work around for it other than to fix what's wrong on your
system.  Good luck.
>
> Once everything is working you will see the PDF open in the browser plugin
when you set the Content-type header.  And you should see a download prompt
when you set the Content-disposition header.
>
> - Kevin
>
> "Scott Fletcher" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> > I can't do readfile() because of lots of bug in IE (Internet
Explorer)
> >
> > "Kevin Stone" <[EMAIL PROTECTED]> wrote in message
> > news:[EMAIL PROTECTED]
> > > Forget the content length and disposition headers.  Just set the
content
> > type then output the file..
> > >
> > > header("Content-type: application/pdf");
> > > readfile("junk.pdf");
> > >
> > > - Kevin
> > >
> > > "Scott Fletcher" <[EMAIL PROTECTED]> wrote in message
> > news:[EMAIL PROTECTED]
> > > > I seem to be having problem with sending the PDF document to the
browser
> > to
> > > > be open on screen.  I kept getting the error message, it say
'Windows
> > cannot
> > > > open this file'.  Here's my sample script, so what am I doing
wrong?...
> > > >
> > > > --snip--
> > > > header("Content-Type: application/pdf");
> > > > header("Content-Length: '40736'");
> > > > header("Content-Disposition: inline; filename='junk.pdf'");
> > > > --snip--
> > > >
> > > > Thanks,
> > > >  Scott F.
> > >
>

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



Re: [PHP] Re: header() function for displaying an opened PDF document.

2003-10-14 Thread Chris Hayes
It might help to have a peek at how the php Pdf libraries are doing this 
(www.php.net/pdflib, fpdf.org, www.ros.co.nz/pdf) . There are a lot 
of  things to worry about with pdf, not the least the fact that older 
acrobat readers will give plenty of errors when the page is not send fast 
enough  and many other reasons.
The safest workaround might be to save the pdf on the server, and then use 
headers to tell the browser where to find it.

At 14:55 14-10-03, you wrote:
Well, now, I get an unknown file type.  I have already specified the
> > > "Scott Fletcher" <[EMAIL PROTECTED]> wrote in message
> > news:[EMAIL PROTECTED]
> > > > I seem to be having problem with sending the PDF document to the 
browser to
> > > > be open on screen.  I kept getting the error message, it say 
'Windows cannot open this file'.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: php convert html to pdf

2003-10-14 Thread Scott Fletcher
Not sure why you're thinking of installing.  So, I downloaded the zipped
file and extract it.  All I see are a couple of files in PHP.  All you can
do is to upload the file, 'HTML_ToPDF.php' and perhap one other file to the
Web Hosting account you have there.  Then on your existing webpage, you just
insert the include file into that php script, whip up some scripts and
voila, you have a working feature...

I looked up in the readme file and it said
--snip--
Installation



There is no real installation other than requiring the file. See the

examples directory for help in how to use the class.

--snip--

But then if the Web Host service doesn't support hte PHP pear, then from the
readme file showed a link to the PHP Pear website and you can safely get a
couple of files to be upload to the Web Host.

They all are only a scripting file, not a installation file or anything.

Scott F.

"Hycn Office" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> but i cant install html2ps
> and fpdf cant convert , need to build from scratch
>
> i think only solution is need to setup a server  no choice
>
> thanks ~
> "Scott Fletcher" <[EMAIL PROTECTED]> ¦b¶l¥ó
> news:[EMAIL PROTECTED] ¤¤¼¶¼g...
> > Hey, Hey, Hey, found it on the Internet on converting HTML to PDF.  Take
a
> > look at this at
> >
> > http://www.rustyparts.com/pdf.php
> >
> >
> > "Hycn Office" <[EMAIL PROTECTED]> wrote in message
> > news:[EMAIL PROTECTED]
> > > hi all ~
> > >
> > > where can find the free of charge complete script ?
> > >
> > > remarks : i am using web hosting , so cant install anything
> > >
> > > thank you "-_-
> >
> >

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



Re: [PHP] where is my session data on my new server?

2003-10-14 Thread zerof
You can bypass any configuration using:
session_save_path ('path/to/session_folder');
--
zerof
-

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



Re: [PHP] where is my session data on my new server?

2003-10-14 Thread David T-G
Mike, et al --

...and then Ford, Mike   [LSS] said...
% 
% On 14 October 2003 11:26, David T-G wrote:
% 
% > I ran a phpinfo() comparison and didn't see anything markedly
% > different (except for how the output is formatted, which made things
% > delightfully more challenging), but I also don't know for what I'm
% > looking.  I also don't know what other information I should provide,
% > but I'm 
% > hesitant to
% > bomb the list with two phpinfo() outputs :-)

[Dude, what did you do to my paragraph formatting?!?]


% 
% Well, rather than post two complete phpinfos, can you hone it down to just those 
entries which *are* different.  I'd particularly be looking at all the session.* 
entries (obviously!), as well as register_globals, and possibly variables_order.

With a lot of work...  diff(1) can't handle completely jumbled inputs :-/

Here, I'll just paste some sections.

OLD:

   Configuration

  PHP Core  

  Directive  Local Value   Master Value
   register_globals 
  On On 
   variables_order  
EGPCS   EGPCS   

  session   

  Session Support enabled   

 DirectiveLocal Value Master Value  
session.auto_start  
Off   Off   
   session.cache_expire 
180   180   
   session.cache_limiter
  nocache   nocache 
   session.cookie_domain
 no value  no value 
  session.cookie_lifetime   
 0 0
session.cookie_path 
 / /
   session.cookie_secure
Off   Off   
   session.entropy_file 
 no value  no value 
  session.entropy_length
 0 0
  session.gc_maxlifetime
   1440  1440   
  session.gc_probability
 1 1
   session.name 
 PHPSESSID PHPSESSID
   session.referer_check
 no value  no value 
   session.save_handler 
   files files  
 session.save_path  
   /tmp  /tmp   
 session.serialize_handler  
php   php   
session.use_cookies 
OnOn
   session.use_trans_sid
 1 1

NEW:

Configuration   

Re: [PHP] Re: header() function for displaying an opened PDF document.

2003-10-14 Thread Scott Fletcher
I'm using the library from www.fpdf.org.  I currently using the method on
storing the file to the server because of two features.  One so I can have
php script to use the email to pick up the file and send it to my boss.
Two, an optional option to view the billing invoice.  I am beginning to
think that it might not be a browser problem after all.  But something with
the fpdf library.  One way to test my theory is to grab a working pdf file
on my machine and put it on the server, have php point to it and see if it
can be display without a problem.  If there's problem then it had to do with
the poor scripting I made on the php header.

Right now, I'm thinking of using hte HTML conversion to PDF feature.  I
haven't found this feature on the Internet until recently when I saw an
earlier PHP newsgroup post yesterday.  The reason is because it's quicker
that way, I'm trying to finish the project so I can leave my job.  So, I
would like to make this project be simpilier for any future hired web
programmer.

Scott F.

"Chris Hayes" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
>
> It might help to have a peek at how the php Pdf libraries are doing this
> (www.php.net/pdflib, fpdf.org, www.ros.co.nz/pdf) . There are a lot
> of  things to worry about with pdf, not the least the fact that older
> acrobat readers will give plenty of errors when the page is not send fast
> enough  and many other reasons.
> The safest workaround might be to save the pdf on the server, and then use
> headers to tell the browser where to find it.
>
>
> At 14:55 14-10-03, you wrote:
> >Well, now, I get an unknown file type.  I have already specified the
> > > > > "Scott Fletcher" <[EMAIL PROTECTED]> wrote in message
> > > > news:[EMAIL PROTECTED]
> > > > > > I seem to be having problem with sending the PDF document to the
> > browser to
> > > > > > be open on screen.  I kept getting the error message, it say
> > 'Windows cannot open this file'.

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



[PHP] Re: Foreach Array Help

2003-10-14 Thread Rob Adams

"Jed R. Brubaker" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Okay, total newbie when it comes to arrays, and I could really use some
> help. I sure this will be an easy one for you veterans out there.
>
> Here is the array ($code):
> array(2) {
>   ["total"]=>
>   int(1)
>   ["assign"]=>
>   array(1) {
> [1]=>
> array(3) {
>   ["type"]=>
>   string(10) "Transcript"
>   ["rows"]=>
>   string(3) "603"
>   ["codeapply"]=>
>   array(1) {
> [1]=>
> array(3) {
>   ["codeset"]=>
>   string(23) "FFT 6 Level Code System"
>   ["code_rows"]=>
>   string(3) "302"
>   ["code_complete"]=>
>   string(1) "2"
> }
>   }
> }
>   }
> }
>
> Here is the output code:
> foreach ($this->code['assign'] as $assign => $details)
> {
> foreach ($assign['codeapply'] as $codeapply => $ca_details)
> {
> echo "";
> echo"";
> echo$details['type']." ".$assign;
> echo"";
> echo"";
> echo"";
> echo$ca_details['codeset'];
> echo"";
> echo"";
> echo
> $ca_details['code_complete']."/".$ca_details['code_rows']." Items Coded";
> echo"";
> echo"";
> printf  (" %.0d%%",
> ($ca_details['code_complete']/$ca_details['code_rows'])*100);
> echo"";
> echo "";
> }
> }
>
> Output error:
> Warning: Cannot use a scalar value as an array
> Warning: Invalid argument supplied for foreach()
>
> Conceptually and practically I have been struggling with how to navigate
> levels of the arrays which are defined by a variable (e.g.
> $code['assign'][$i] for the assign ID and $code['assign'][$i][$j] for the

if $code['assign'][$i] has some integer value, then it is not an array.
if $code['assign'][$i][$j] has some integer value, then $code['assign'][$i]
is an array.

You have two mutually exclusive possibilities there.

Probably, what you want to do is something like:

$code['assign'][$i]['aid'] = (assign ID);
$code['assign'][$i][$j] = (whatever you want here);

(which, for simplicity, translates into something like:)

$code['assign'][1]['aid'] = 1;
$code['assign'][1]['1'] = 11;
$code['assign'][1]['2'] = 12;
$code['assign'][1]['3'] = 13;
$code['assign'][1]['4'] = 14;
$code['assign'][1]['5'] = 15;
etc.

  -- Rob




> codeapply ID on the assign ID).
>
> Thanks in advance!

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



Re: [PHP] where is my session data on my new server?

2003-10-14 Thread David T-G
zerof --

...and then zerof said...
% 
% You can bypass any configuration using:
% session_save_path ('path/to/session_folder');

Well, it's the same on both servers, and /tmp is writable (there are
session files in there, even), so that doesn't seem to be it.  Thanks,
though.


% --
% zerof
% -


HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!



pgp0.pgp
Description: PGP signature


[PHP] Pidget - The PHP5 Widget Library

2003-10-14 Thread Luke Ehresman
Hi Everyone,

I'm fairly new to this list, but have been around PHP for a very long
time.  I'm the original author of SquirrelMail, the webmail client
written in PHP4.  As I have been doing web development, I noticed the
alarming trend that most web applications have a hacked-together
interface.  It is hard to create a standardized, unified interface in
web programming languages like PHP.  As a solution to this, and to test
out the wonderful new capabilities of PHP5, I wrote Pidget -- The PHP
Widget Library.

Pidget is a library of graphical widgets that get rendered in HTML.  If
you have done any GUI programming in QT or MFC, it is very similar.
There are layout engines and widgets that interact with it.  Anyhow, it
is completely in PHP5 using the great new object oriented features.  As
far as I know, this is the first large-scale project that is fully PHP5.

Why amd I writing to this list?  The company that I work for, and who
sponsored Pidget's development, CommNav, has decided to create an open
source project out of Pidget.  It is my hope that as PHP5 gains
adoption, so will Pidget.  Web applications designed with Pidget have a
much cleaner separation of display and logic (HTML is not printed out
inline).  For more information, visit the website!

http://www.pidget.org

Thanks,
Luke
-- 
Luke Ehresman
luke[at]ehresman.org
http://www.luke.ehresman.org

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



[PHP] Re: Did anyone have success with the require() function??

2003-10-14 Thread Scott Fletcher
Thanks...
"Curt Zirzow" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> On Fri, 10 Oct 2003 13:09:16 -0400, Scott Fletcher <[EMAIL PROTECTED]>
wrote:
>
> > Hi Fellas!
> >
> > Did anyone have success with making the required function work if using
> > this sample code.  It didn't work for me.
> >
> > --snip--
> > require("$_REQUEST['PDF_LIB_PATH']");
> > --snip--
>
> When you access an array inside of a string you half to tell php that it
> is a variable by enclosing it with curly brackets:
>
>   require("{$_REQUEST['PDF_LIB_PATH']}");
>
>
> Now the question is, what happens if I access your site like so:
>
>   http://yoursite.com/yourfile.php?PDF_LIB_PATH=%2fetc%2fpasswd
>
>
> Always verify your data that is passed in by the user, you might
> want to read:
>
>   http://php.net/manual/en/security.filesystem.php
>
> HTH,
>
> Curt
> --

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



Re: [PHP] Re: Did anyone have success with the require() function??

2003-10-14 Thread Scott Fletcher
Thanks...
"Tom Rogers" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi,
>
> Saturday, October 11, 2003, 3:33:05 AM, you wrote:
> CZ> On Fri, 10 Oct 2003 13:09:16 -0400, Scott Fletcher <[EMAIL PROTECTED]>
wrote:
>
> >> Hi Fellas!
> >>
> >> Did anyone have success with making the required function work if using
> >> this sample code.  It didn't work for me.
> >>
> >> --snip--
> >> require("$_REQUEST['PDF_LIB_PATH']");
> >> --snip--
>
> CZ> When you access an array inside of a string you half to tell php that
it
> CZ> is a variable by enclosing it with curly brackets:
>
> CZ>   require("{$_REQUEST['PDF_LIB_PATH']}");
>
>
> CZ> Now the question is, what happens if I access your site like so:
>
> CZ>   http://yoursite.com/yourfile.php?PDF_LIB_PATH=%2fetc%2fpasswd
>
>
> CZ> Always verify your data that is passed in by the user, you might
> CZ> want to read:
>
> CZ>   http://php.net/manual/en/security.filesystem.php
>
> CZ> HTH,
>
> CZ> Curt
> CZ> --
>
>
> Or drop the quotes they are not needed if there are only variables
involved
>
> -- 
> regards,
> Tom

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



[PHP] Re: php convert html to pdf

2003-10-14 Thread Scott Fletcher
I'm begging to see this now.  That's a lot of other 3rd party installation
being required.  Now, I'm thinking of going to scratch that (HTML conversion
to PDF) and go back to fpdf library...

Yea, look like you would need your own machine for this...

"Scott Fletcher" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Not sure why you're thinking of installing.  So, I downloaded the zipped
> file and extract it.  All I see are a couple of files in PHP.  All you can
> do is to upload the file, 'HTML_ToPDF.php' and perhap one other file to
the
> Web Hosting account you have there.  Then on your existing webpage, you
just
> insert the include file into that php script, whip up some scripts and
> voila, you have a working feature...
>
> I looked up in the readme file and it said
> --snip--
> Installation
>
> 
>
> There is no real installation other than requiring the file. See the
>
> examples directory for help in how to use the class.
>
> --snip--
>
> But then if the Web Host service doesn't support hte PHP pear, then from
the
> readme file showed a link to the PHP Pear website and you can safely get a
> couple of files to be upload to the Web Host.
>
> They all are only a scripting file, not a installation file or anything.
>
> Scott F.
>
> "Hycn Office" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> > but i cant install html2ps
> > and fpdf cant convert , need to build from scratch
> >
> > i think only solution is need to setup a server  no choice
> >
> > thanks ~
> > "Scott Fletcher" <[EMAIL PROTECTED]> ¦b¶l¥ó
> > news:[EMAIL PROTECTED] ¤¤¼¶¼g...
> > > Hey, Hey, Hey, found it on the Internet on converting HTML to PDF.
Take
> a
> > > look at this at
> > >
> > > http://www.rustyparts.com/pdf.php
> > >
> > >
> > > "Hycn Office" <[EMAIL PROTECTED]> wrote in message
> > > news:[EMAIL PROTECTED]
> > > > hi all ~
> > > >
> > > > where can find the free of charge complete script ?
> > > >
> > > > remarks : i am using web hosting , so cant install anything
> > > >
> > > > thank you "-_-
> > >
> > >

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



Re: [PHP] Re: header() function for displaying an opened PDF document.

2003-10-14 Thread Scott Fletcher
Aw, scratch that HTML conversion to PDF feature.  It require an installation
of a couple of other stuffs.  I'm going to stick back to fpdf library for
now.

"Scott Fletcher" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I'm using the library from www.fpdf.org.  I currently using the method on
> storing the file to the server because of two features.  One so I can have
> php script to use the email to pick up the file and send it to my boss.
> Two, an optional option to view the billing invoice.  I am beginning to
> think that it might not be a browser problem after all.  But something
with
> the fpdf library.  One way to test my theory is to grab a working pdf file
> on my machine and put it on the server, have php point to it and see if it
> can be display without a problem.  If there's problem then it had to do
with
> the poor scripting I made on the php header.
>
> Right now, I'm thinking of using hte HTML conversion to PDF feature.  I
> haven't found this feature on the Internet until recently when I saw an
> earlier PHP newsgroup post yesterday.  The reason is because it's quicker
> that way, I'm trying to finish the project so I can leave my job.  So, I
> would like to make this project be simpilier for any future hired web
> programmer.
>
> Scott F.
>
> "Chris Hayes" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> >
> > It might help to have a peek at how the php Pdf libraries are doing this
> > (www.php.net/pdflib, fpdf.org, www.ros.co.nz/pdf) . There are a lot
> > of  things to worry about with pdf, not the least the fact that older
> > acrobat readers will give plenty of errors when the page is not send
fast
> > enough  and many other reasons.
> > The safest workaround might be to save the pdf on the server, and then
use
> > headers to tell the browser where to find it.
> >
> >
> > At 14:55 14-10-03, you wrote:
> > >Well, now, I get an unknown file type.  I have already specified the
> > > > > > "Scott Fletcher" <[EMAIL PROTECTED]> wrote in message
> > > > > news:[EMAIL PROTECTED]
> > > > > > > I seem to be having problem with sending the PDF document to
the
> > > browser to
> > > > > > > be open on screen.  I kept getting the error message, it say
> > > 'Windows cannot open this file'.

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



[PHP] header() function...

2003-10-14 Thread Tristan . Pretty
We've just moved sites, to a new URL...
on the home page of the old url, I simply had a page that was;

http://www.newsite.com);
?>

All good, any requests to that page, were cleanly redirected to the new 
site.
I know this cause I tested it many times...

Now on the stats for the new site, we can record no referals from 
http://www.oldsite.com
yet I know I (and my co-workers) went to http://www.oldsite.com and got 
redirected to http://www.newsite.com
Can someone confirm:

Does this method or redirection interfere with the web server logging 
visits?

Cheers,
Tris...

*
The information contained in this e-mail message is intended only for 
the personal and confidential use of the recipient(s) named above.  
If the reader of this message is not the intended recipient or an agent
responsible for delivering it to the intended recipient, you are hereby 
notified that you have received this document in error and that any
review, dissemination, distribution, or copying of this message is 
strictly prohibited. If you have received this communication in error, 
please notify us immediately by e-mail, and delete the original message.
***



Re: [PHP] FTP resumepos

2003-10-14 Thread Andrei Popovici
So, resumepos is the number of bytes from wich the ftp_get will start
reading the 'remote_file' and writing to the 'local-file'?

Andrei.

"Curt Zirzow" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> * Thus wrote Andrei Popovici ([EMAIL PROTECTED]):
> > Can anyone help me understand how the parameter resumepos from ftp_get
> > function can be used?
>
> ftp_get will  first seek the value  'resumepos' within the
> 'remote_file', before it starts to write to 'local_file'.
>
> Curt
> --
> "My PHP key is worn out"
>
>   PHP List stats since 1997:
>   http://zirzow.dyndns.org/html/mlists/

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



[PHP] Invoking the PHP interpreter form a suexec CGI PHP program.

2003-10-14 Thread Andrey Petrov
Hi

I have configured successfully a PHP application to run as a CGI application
with apache/suexec.
The following program runs as expected:
#!/usr/bin/php -q


this program can be run from the command line, as a regular CGI script, or
as a suexec CGI script.

If we modify it like this:
#!/usr/bin/php -q

it works as a regular cgi program, or when run directly from the command
line or when run thru mod_php4. But it does NOT work as a suexec CGI
script.
It seems that you cannot launch another PHP interpreter process from within
a suexec CGI PHP script.
Any suggestions?

/usr/bin/httpd -v
Apache/1.3.27 (Unix)  (Red-Hat/Linux)

/usr/bin/php -v
PHP 4.3.3 (cgi) (built: Sep 17 2003 15:57:16)
Copyright (c) 1997-2003 The PHP Group
Zend Engine v1.3.0, Copyright (c) 1998-2003 Zend Technologies

p.s.
the same program written in perl:
#!/usr/bin/perl -w
print ("Content-type: text/html\n\n");
print (`/usr/bin/php -v`);

works perfectly as expected without any problems under suexec.

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



[PHP] Accessing HTTP_PC_REMOTE_ADDR var fails sporadically

2003-10-14 Thread Randall Perry
After a user submits a contract form I grab their IP from
$HTTP_SERVER_VARS["HTTP_PC_REMOTE_ADDR"] and then email the info.

This works sometimes, and sometimes I get a blank value for
$HTTP_SERVER_VARS["HTTP_PC_REMOTE_ADDR"].

Anyone know why this might happen? Should I be using a different global var
to grab a user's IP?

-- 
Randall Perry
sysTame

Xserve Web Hosting/Co-location
Website Development/Promotion
Mac Consulting/Sales

http://www.systame.com/

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



[PHP] Passing variables between pages

2003-10-14 Thread KB
Hi,

Simple one for anyone who wants to help out a novice.  How do you pass a
variable from one page to another?

Urgent help would be appreciated.

With thanks

Kevin

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



[PHP] Run the same php function several times in th background

2003-10-14 Thread KB
Hi NG

I would like to intiate the same function many times, running in the
background using php,

Thank you in advance for any suggestion

Kind regards

Charles



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



[PHP] Re: header() function...

2003-10-14 Thread Scott Fletcher
Web Server's log file or user defined log file (Sort of Like PHP Log)?

"Tristan Pretty" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> We've just moved sites, to a new URL...
> on the home page of the old url, I simply had a page that was;
>
>  header(Location: http://www.newsite.com);
> ?>
>
> All good, any requests to that page, were cleanly redirected to the new
> site.
> I know this cause I tested it many times...
>
> Now on the stats for the new site, we can record no referals from
> http://www.oldsite.com
> yet I know I (and my co-workers) went to http://www.oldsite.com and got
> redirected to http://www.newsite.com
> Can someone confirm:
>
> Does this method or redirection interfere with the web server logging
> visits?
>
> Cheers,
> Tris...
>
> *
> The information contained in this e-mail message is intended only for
> the personal and confidential use of the recipient(s) named above.
> If the reader of this message is not the intended recipient or an agent
> responsible for delivering it to the intended recipient, you are hereby
> notified that you have received this document in error and that any
> review, dissemination, distribution, or copying of this message is
> strictly prohibited. If you have received this communication in error,
> please notify us immediately by e-mail, and delete the original message.
> ***
>
>

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



[PHP] $PHP_SELF and include all variables?

2003-10-14 Thread Tristan . Pretty
I'm using $PHP_SELF, but need to automatically record what variables are 
in the URL at that time...
is that possible?

I've searched PHP.net, but cannot find this specific function...

Cheers,
Tris...

*
The information contained in this e-mail message is intended only for 
the personal and confidential use of the recipient(s) named above.  
If the reader of this message is not the intended recipient or an agent
responsible for delivering it to the intended recipient, you are hereby 
notified that you have received this document in error and that any
review, dissemination, distribution, or copying of this message is 
strictly prohibited. If you have received this communication in error, 
please notify us immediately by e-mail, and delete the original message.
***



RE: [PHP] Passing variables between pages

2003-10-14 Thread Jay Blanchard
[snip]
Simple one for anyone who wants to help out a novice.  How do you pass a
variable from one page to another?
[/snip]

Through either a $_POST or a $_GET variable array. 
onepage.php






another.php



Please RTFM, STFW, and STFA for PHP tutorials.

Thank you.

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



RE: [PHP] Run the same php function several times in th background

2003-10-14 Thread Jay Blanchard
[snip]
I would like to intiate the same function many times, running in the
background using php,
[/snip]

for($i = 0; $i < 1000; $i++){
foo($blork); // function runs one thousand times
}

Please RTFM, STFW, and STFA for PHP tutorials.

Thank you.

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



Re: [PHP] Run the same php function several times in th background

2003-10-14 Thread Mohamed Lrhazi
You're talking multithreading and/or forking extra processes? check the
docs for that... search for "fork"...

Mohamed~

On Tue, 2003-10-14 at 11:05, KB wrote:
> Hi NG
> 
> I would like to intiate the same function many times, running in the
> background using php,
> 
> Thank you in advance for any suggestion
> 
> Kind regards
> 
> Charles
> 
> 

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



Re: [PHP] Run the same php function several times in th background

2003-10-14 Thread KB
Dear Mohamed


Yes, I am looking for multithreading process , thank you for the suggestion

charles

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



[PHP] Re: $PHP_SELF and include all variables?

2003-10-14 Thread Shawn McKenzie
$_SERVER['GET'] will give an array of all get vars in the URL.

Or maybe:

$_SERVER['QUERY_STRING']

Which gives the entire get query string in the URL.

-Shawn

"Tristan Pretty" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I'm using $PHP_SELF, but need to automatically record what variables are
> in the URL at that time...
> is that possible?
>
> I've searched PHP.net, but cannot find this specific function...
>
> Cheers,
> Tris...
>
> *
> The information contained in this e-mail message is intended only for
> the personal and confidential use of the recipient(s) named above.
> If the reader of this message is not the intended recipient or an agent
> responsible for delivering it to the intended recipient, you are hereby
> notified that you have received this document in error and that any
> review, dissemination, distribution, or copying of this message is
> strictly prohibited. If you have received this communication in error,
> please notify us immediately by e-mail, and delete the original message.
> ***
>
>

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



Re: [PHP] Re: header() function...

2003-10-14 Thread Tristan . Pretty
Bog standard web server logs...
We're hosted on a windows server I think... (sadly)





"Scott Fletcher" <[EMAIL PROTECTED]> 
14/10/2003 16:25

To
[EMAIL PROTECTED]
cc

Subject
[PHP] Re: header() function...






Web Server's log file or user defined log file (Sort of Like PHP Log)?

"Tristan Pretty" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
.
> We've just moved sites, to a new URL...
> on the home page of the old url, I simply had a page that was;
>
>  header(Location: http://www.newsite.com);
> ?>
>
> All good, any requests to that page, were cleanly redirected to the new
> site.
> I know this cause I tested it many times...
>
> Now on the stats for the new site, we can record no referals from
> http://www.oldsite.com
> yet I know I (and my co-workers) went to http://www.oldsite.com and got
> redirected to http://www.newsite.com
> Can someone confirm:
>
> Does this method or redirection interfere with the web server logging
> visits?
>
> Cheers,
> Tris...
>
> *
> The information contained in this e-mail message is intended only for
> the personal and confidential use of the recipient(s) named above.
> If the reader of this message is not the intended recipient or an agent
> responsible for delivering it to the intended recipient, you are hereby
> notified that you have received this document in error and that any
> review, dissemination, distribution, or copying of this message is
> strictly prohibited. If you have received this communication in error,
> please notify us immediately by e-mail, and delete the original message.
> ***
>
>

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




*
The information contained in this e-mail message is intended only for 
the personal and confidential use of the recipient(s) named above.  
If the reader of this message is not the intended recipient or an agent
responsible for delivering it to the intended recipient, you are hereby 
notified that you have received this document in error and that any
review, dissemination, distribution, or copying of this message is 
strictly prohibited. If you have received this communication in error, 
please notify us immediately by e-mail, and delete the original message.
***



Re: [PHP] Re: header() function...

2003-10-14 Thread Curt Zirzow

I officially declare this thread foobar.

Curt
-- 
"My PHP key is worn out"

  PHP List stats since 1997: 
  http://zirzow.dyndns.org/html/mlists/

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



Re: [PHP] Passing variables between pages

2003-10-14 Thread Eugene Lee
On Tue, Oct 14, 2003 at 10:20:44AM -0500, Jay Blanchard wrote:
: "KB" <[EMAIL PROTECTED]> asked:
: > 
: > Simple one for anyone who wants to help out a novice.  How do you
: > pass a variable from one page to another?
: 
: Through either a $_POST or a $_GET variable array. 

And cookies and sessions and database backends oh my!

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



RE: [PHP] Passing variables between pages

2003-10-14 Thread Jay Blanchard
[snip]
: > Simple one for anyone who wants to help out a novice.  How do you
: > pass a variable from one page to another?
: 
: Through either a $_POST or a $_GET variable array. 

And cookies and sessions and database backends oh my!
[/snip]

Aww Genethat is for intermediates, not novi! 

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



Re: [PHP] Re: header() function...

2003-10-14 Thread Scott Fletcher
In that case, you most likely would find the 'www.oldsite.com' in the ACCESS
log or whatever it is.  As for the redirecting, nah, there shouldn't be any
interference.  The webserver just record the browser's request into the log
file, then come the header() for redirecting, then the webserver retrieve
whatever the file is as specified by the header() redirect then record the
data into the log file, then send the webpage back to the web browser.

The webserver just recorded whatever is requested by the browser and
whatever is specified from the PHP Module/CGI/ISAPI, and/or user defined
script from the webpage.  Unless there is a configuration setting somewhere
that said otherwise about the log files.


"Tristan Pretty" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Bog standard web server logs...
> We're hosted on a windows server I think... (sadly)
>
>
>
>
>
> "Scott Fletcher" <[EMAIL PROTECTED]>
> 14/10/2003 16:25
>
> To
> [EMAIL PROTECTED]
> cc
>
> Subject
> [PHP] Re: header() function...
>
>
>
>
>
>
> Web Server's log file or user defined log file (Sort of Like PHP Log)?
>
> "Tristan Pretty" <[EMAIL PROTECTED]> wrote in message
>
news:[EMAIL PROTECTED]
> .
> > We've just moved sites, to a new URL...
> > on the home page of the old url, I simply had a page that was;
> >
> >  > header(Location: http://www.newsite.com);
> > ?>
> >
> > All good, any requests to that page, were cleanly redirected to the new
> > site.
> > I know this cause I tested it many times...
> >
> > Now on the stats for the new site, we can record no referals from
> > http://www.oldsite.com
> > yet I know I (and my co-workers) went to http://www.oldsite.com and got
> > redirected to http://www.newsite.com
> > Can someone confirm:
> >
> > Does this method or redirection interfere with the web server logging
> > visits?
> >
> > Cheers,
> > Tris...
> >
> > *
> > The information contained in this e-mail message is intended only for
> > the personal and confidential use of the recipient(s) named above.
> > If the reader of this message is not the intended recipient or an agent
> > responsible for delivering it to the intended recipient, you are hereby
> > notified that you have received this document in error and that any
> > review, dissemination, distribution, or copying of this message is
> > strictly prohibited. If you have received this communication in error,
> > please notify us immediately by e-mail, and delete the original message.
> > ***
> >
> >
>
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
>
> *
> The information contained in this e-mail message is intended only for
> the personal and confidential use of the recipient(s) named above.
> If the reader of this message is not the intended recipient or an agent
> responsible for delivering it to the intended recipient, you are hereby
> notified that you have received this document in error and that any
> review, dissemination, distribution, or copying of this message is
> strictly prohibited. If you have received this communication in error,
> please notify us immediately by e-mail, and delete the original message.
> ***
>
>

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



[PHP] Re: Passing variables between pages

2003-10-14 Thread Gabriel Peugnet
Like John said:

You can use:

In the second page:
$user = $_POST['username'];// sent by the first page
...
echo "

...
";

So, when you submit the form, in the third page you will be able to get the
username.
$user = $_POST['username'];

Yo can do this in N number of pages. If you always pass and obtain the
variable via POST or GET no matter how much pages yo use. In the 20th page
you'll get the variable.



"Rashini Jayasinghe" <[EMAIL PROTECTED]> escribió en el mensaje
news:[EMAIL PROTECTED]

Hi,

I want to pass a variable between three pages. I tried to get a username
from the first page through a form. Use that username in a select statement
in the second page to query a table.Everything is fine up to that point. now
I want to pass the same username to the third page where I have to use it to
select a table name by that username and it doesn't work. I tried
$_POST['username'] and the value is not passed to the third page. Is there a
way of doing this?
Please help.

Thank You.

Rashini

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



Re: [PHP] Run the same php function several times in th background

2003-10-14 Thread John Nichel
Jay Blanchard wrote:

[snip]
I would like to intiate the same function many times, running in the
background using php,
[/snip]
for($i = 0; $i < 1000; $i++){
foo($blork); // function runs one thousand times
}
Please RTFM, STFW, and STFA for PHP tutorials.

Thank you.
This is not what he asked.  He wants to run the process in the background.

PHP's process control functions may do what you need

http://us3.php.net/manual/en/ref.pcntl.php

--
By-Tor.com
It's all about the Rush
http://www.by-tor.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] Run the same php function several times in th background

2003-10-14 Thread Jay Blanchard
[snip]
This is not what he asked.  He wants to run the process in the
background.

PHP's process control functions may do what you need

http://us3.php.net/manual/en/ref.pcntl.php
[/snip]

My badunder the influence of anti-histamines and other cold
medicines.

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



[PHP] Pulling variables from a URL

2003-10-14 Thread Frank Tudor
I have a URL including variables...  It looks like this:

http://registration.php?username=11&[EMAIL PROTECTED]

But I can't pullit into the next page's form

Here is what is in the form and other things I have tried:

$username = $_HTTP_POST_VARS['username'];

echo $_GET['$username'];

echo $_POST['$username'];

This page sumbits with PHP_SELF if that helps with this puzzle.

Can someone tell me what I'm doing wrong?

Also I do have an include file that looks for session
information but Ihave disabled it to see if I can pass
variables.

Frank

__
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com

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



Re: [PHP] Pulling variables from a URL

2003-10-14 Thread Daniel Guerrier
It should be:
echo $_GET['username'];

You shouldn't have the dollar sign in the brackets.
$ represents a variable the entire $_GET['username']
is the variable.


--- Frank Tudor <[EMAIL PROTECTED]> wrote:
> I have a URL including variables...  It looks like
> this:
> 
>
http://registration.php?username=11&[EMAIL PROTECTED]
> 
> But I can't pullit into the next page's form
> 
> Here is what is in the form and other things I have
> tried:
> 
> $username = $_HTTP_POST_VARS['username'];
> 
> echo $_GET['$username'];
> 
> echo $_POST['$username'];
> 
> This page sumbits with PHP_SELF if that helps with
> this puzzle.
> 
> Can someone tell me what I'm doing wrong?
> 
> Also I do have an include file that looks for
> session
> information but Ihave disabled it to see if I can
> pass
> variables.
> 
> Frank
> 
> __
> Do you Yahoo!?
> The New Yahoo! Shopping - with improved product
> search
> http://shopping.yahoo.com
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


__
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com

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



Re: [PHP] Pulling variables from a URL

2003-10-14 Thread Chris Shiflett
--- Frank Tudor <[EMAIL PROTECTED]> wrote:
> I have a URL including variables...  It looks like this:
> 
> http://registration.php?username=11&[EMAIL PROTECTED]
> 
> But I can't pullit into the next page's form
> 
> Here is what is in the form and other things I have tried:
> 
> $username = $_HTTP_POST_VARS['username'];
> 
> echo $_GET['$username'];
> 
> echo $_POST['$username'];
> 
> This page sumbits with PHP_SELF if that helps with this puzzle.
> 
> Can someone tell me what I'm doing wrong?

I see a few things:

1. Pullit is not a word. :-)
2. http://registration.php is not a valid URL (until php becomes a TLD).
3. $_GET['$username'] refers to a variable named $username, not username. You
should try $_GET['username'] instead.

Hope that helps.

Chris

=
My Blog
 http://shiflett.org/
HTTP Developer's Handbook
 http://httphandbook.org/
RAMP Training Courses
 http://www.nyphp.org/ramp

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



RE: [PHP] Pulling variables from a URL

2003-10-14 Thread Carl Furst
If you are using the variable $username as a variable variable type thing..
like you don't know what username is going to be each time...

Use double quotes:

$_GET["$username"];

that will make PHP interpolate the variable and use whatever value $username
is as the name of the $_GET var. Single quotes ''' tells PHP 'take the
$tring as is and don't interpolate anything'

you HAVE to do that.. you can't do... if you have the register_globals
directive on for example ${$username}.. no no no. Doesn't like that.


double quotes say "interpolate $variables". However I have discovered (at
least in php 4.2.3) that you cannot use subarrays in double quotes like "my
var in the subarray subarray: $array['subarray']['subarray']" That doesn't
seem to work.. it comes up blank.



Carl Furst


-Original Message-
From: Frank Tudor [mailto:[EMAIL PROTECTED]
Sent: Tuesday, October 14, 2003 1:16 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Pulling variables from a URL

I have a URL including variables...  It looks like this:

http://registration.php?username=11&[EMAIL PROTECTED]

But I can't pullit into the next page's form

Here is what is in the form and other things I have tried:

$username = $_HTTP_POST_VARS['username'];

echo $_GET['$username'];

echo $_POST['$username'];

This page sumbits with PHP_SELF if that helps with this puzzle.

Can someone tell me what I'm doing wrong?

Also I do have an include file that looks for session
information but Ihave disabled it to see if I can pass
variables.

Frank

__
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.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] Pulling variables from a URL

2003-10-14 Thread Adrian
lol variables in quotes - especialli when there is only the variable
are really ugly.
you should use $_GET[$username]...

> Use double quotes:
> $_GET["$username"];

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



[PHP] Session question

2003-10-14 Thread Susan Ator
What would cause the loss of a session in these circumstances:

php page with search form - session good
search form calls perl script
php page with search results - php wrapper for perl search form
displaying output - session good
php page gotten to from link on php search results page in perl
search form output - session lost | new SID set but SID cookie not displayed
when showing phpinfo. Same php page gotten to from another direction -
session good.

This is pretty slim as far as details go but it pretty much sums up the
problem.

Does anyone have any idea where the session information is getting hosed?

Thanks,

Susan

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



Re: [PHP] Pidget - The PHP5 Widget Library

2003-10-14 Thread Leif K-Brooks
Luke Ehresman wrote:

Hi Everyone,
 

It doesn't seem to be very standards-compliant. Good PHP is important to 
me, but good HTML is too.

Also, I can't find any examples, but it doesn't really seem to seperate 
logic from presentation - it just provides another means of presentation.

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


[PHP] header() refresh vs location

2003-10-14 Thread Chris Hubbard
All,
I have done a number of searches.
I have read the online documentation and user supplied comments.

I recently ran into problem using:

-some code here to create session and set variables-
header('Location: index.php');

where the sessions would sometimes get "lost", they wouldn't make it to the
index.php page.  A print_r on $_SESSION would display an empty array.  And
yes the sessions are getting set properly.  The same code works on three
different servers, with no modifications.

So a friend recommended using:
header ("Refresh: 0; url=index.php");

I haven't seen documentation for "refresh" in the header function.  Is there
any reason to use one in lieu of the other?  Any comments on 'refresh'?

As I said, I've looked at the online documentation:
this page: http://us4.php.net/manual/en/function.header.php doesn't have the
word "refresh" on it.
this page: http://www.w3.org/Protocols/rfc2616/rfc2616 doesn't have the word
"refresh" on it.
this page: http://us4.php.net/manual/en/function.headers-sent.php does have
the word "refresh" but it's not relevant.

Thanks in advance.

Chris Hubbard
[EMAIL PROTECTED]
www.wildcharacters.com
425 481 2020

php based web application development

Y! [EMAIL PROTECTED]
MSN [EMAIL PROTECTED]
AIM ganeshacph

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



[PHP] Re: header() refresh vs location

2003-10-14 Thread Kevin Stone
The Refresh directive is a valid header.  I've used it for many years and it seems to 
be supported by the majority of browsers.  However I've never read anything that would 
indicate that Refresh works any differently than Location.  The only difference is 
that Refresh allows you to set a number of seconds before redirecting to the given 
URL.  As to whether or not it will solve your problem is something only you can answer.

- Kevin

"Chris Hubbard" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]
> All,
> I have done a number of searches.
> I have read the online documentation and user supplied comments.
> 
> I recently ran into problem using:
> 
> -some code here to create session and set variables-
> header('Location: index.php');
> 
> where the sessions would sometimes get "lost", they wouldn't make it to the
> index.php page.  A print_r on $_SESSION would display an empty array.  And
> yes the sessions are getting set properly.  The same code works on three
> different servers, with no modifications.
> 
> So a friend recommended using:
> header ("Refresh: 0; url=index.php");
> 
> I haven't seen documentation for "refresh" in the header function.  Is there
> any reason to use one in lieu of the other?  Any comments on 'refresh'?
> 
> As I said, I've looked at the online documentation:
> this page: http://us4.php.net/manual/en/function.header.php doesn't have the
> word "refresh" on it.
> this page: http://www.w3.org/Protocols/rfc2616/rfc2616 doesn't have the word
> "refresh" on it.
> this page: http://us4.php.net/manual/en/function.headers-sent.php does have
> the word "refresh" but it's not relevant.
> 
> Thanks in advance.
> 
> Chris Hubbard
> [EMAIL PROTECTED]
> www.wildcharacters.com
> 425 481 2020
> 
> php based web application development
> 
> Y! [EMAIL PROTECTED]
> MSN [EMAIL PROTECTED]
> AIM ganeshacph


[PHP] BUG: sprintf(%u) and ip2long

2003-10-14 Thread Daevid Vincent
Could be my not understanding of something, but I think there is a bug in
using ip2long() and sprintf(%u) as indicated on this page:
http://us4.php.net/manual/en/function.ip2long.php

Look at the example below:

//this conversion seems broken
//  $startIP_long = sprintf("%u",ip2long($QRange1));
//  $endIP_long = sprintf("%u",ip2long($QRange2));

$startIP_long = ip2long($QRange1);
$endIP_long = ip2long($QRange2);

echo "QRange1 = ".$QRange1." and QRange2 = ".$QRange2."";
echo "startIP_long = ".$startIP_long." and endIP_long =
".$endIP_long."";
echo "startIP_long = ".long2ip($startIP_long)." and endIP_long =
".long2ip($endIP_long)."";


The first //commented block will give:

QRange1 = 192.169.12.40 and QRange2 = 192.169.20.40
startIP_long = 3232304168 and endIP_long = 3232306216  
startIP_long = 127.255.255.255 and endIP_long = 127.255.255.255

(wtf did the "127.255.255.255" come from?!)

While the second works properly...

QRange1 = 192.169.12.40 and QRange2 = 192.169.20.40
startIP_long = -1062663128 and endIP_long = -1062661080 
startIP_long = 192.169.12.40 and endIP_long = 192.169.20.40

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



[PHP] Finally, PDF Header for PDF stuffs that work....

2003-10-14 Thread Scott Fletcher
Finally got some PHP header to force IE to display the PDF document right
from the file from the server.  Due to most of IE bugs, this script will
help.  It can be either getting a file from the webserver as this script is
or you can change the PHP header to use the attachment instead.

--snip--

--snip--

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



Re: [PHP] Slow searches in large database

2003-10-14 Thread Cesar Cordovez
Hi!

I think that you will need a "keyword" table to speed up this procedure. 
 The basic idea is to create an index of words in your fields, 
therefore you will not use "like" but "=" making things run much, much 
faster.

The steps for doing this are:

1.  Every time you save a record in the table docs, take all the text 
fields in it and separate it into words.  You can use explode to do 
this.  Like for example: $words = explode(" ", $record["fieldone"] . " " 
.$record["fieldtwo"], {etc, etc});

2. save in the keyword table the non repeating words in the array with a 
reference to the original document, for example the document id.

3.  Then, if you want to search for, let say, people you will do:

select distinct(docid) from keywords where word='people'

and you will have a list (cursor) with all the documents that have the 
word "people".

Very fast.

For an example of this, go to http://www.alenet.com and search for 
something.  With very little more effort you can add a spelling thingy 
(type peeple on the search field) and "porcentajes" for each document.

I use the exactly the same procedure in a 5000 record database, and the 
time it uses to search is about the same that in alenet.com

Cesar

An example of one of our search strings is:

select docs.* from docs where 1 and CY IN ('GB')  and (TI like
'%searchstring%' or PD like '%searchstring%' or ND like '%searchstring%'
or DR like '%searchstring%' or DS like '%searchstring%' or DD like
'%searchstring%' or DT like '%searchstring%' or RN like '%searchstring%'
or HD like '%searchstring%' or TD like '%searchstring%' or NC like
'%searchstring%' or PR like '%searchstring%' or RP like '%searchstring%'
or AA like '%searchstring%' or TY like '%searchstring%' or AC like
'%searchstring%' or PC like '%searchstring%' or RC like '%searchstring%'
or RG like '%searchstring%' or AU like '%searchstring%' or TW like
'%searchstring%' or CO like '%searchstring%' or AB like '%searchstring%'
or TX like '%searchstring%')
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Re: header() refresh vs location

2003-10-14 Thread Chris Shiflett
--- Kevin Stone <[EMAIL PROTECTED]> wrote:
> The Refresh directive is a valid header.  I've used it for many
> years and it seems to be supported by the majority of browsers.

My experience has been the same.

> However I've never read anything that would indicate that Refresh
> works any differently than Location.

Well, it does, though the difference may not be so obvious. The Location header
accompanies a response with a status code of 3xx, which tells the Web client
that the resource has moved. This matters when it comes to things like Google
indexing your site. Google will fetch the new resource and consider it the same
as the original resource as long as the status code was 3xx.

It is also more transparent; a 3xx response does not exist in the client's
history mechanism (well, it's not supposed to), so a user who clicks back won't
be sent forward immediately (making the back button appear broken or disabled).
I'm not sure if Refresh is interpreted as being transparent in the history as
well, but in my current browser (Galeon), it is definitely not.

Oh, and the original problem was likely due to a relative URL being used in the
Location header. This is a violation of the protocol and can cause problems
with certain clients.

Hope that helps.

Chris

=
My Blog
 http://shiflett.org/
HTTP Developer's Handbook
 http://httphandbook.org/
RAMP Training Courses
 http://www.nyphp.org/ramp

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



Re: [PHP] header() refresh vs location

2003-10-14 Thread Chris Shiflett
--- Chris Hubbard <[EMAIL PROTECTED]> wrote:
> header('Location: index.php');

The Location header requires an absolute URL. This example demonstrates a
violation of the specification and can have unknown results.

Chris

=
My Blog
 http://shiflett.org/
HTTP Developer's Handbook
 http://httphandbook.org/
RAMP Training Courses
 http://www.nyphp.org/ramp

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



Re: [PHP] header() refresh vs location

2003-10-14 Thread Matt Babineau
In this example, index.php would be a violation i think. however you
don't need to provide an absolute URL, you could provide / or ever
/index.php

I say this because the header specifying the Host had already been sent.

so you could do Location: Host + Relative_URL or Location: Relative_URL
since the browser already knows what Host you are connected to.

I could be totally wrong, just my experience in the path month or so.

Cheers!
Matt

On Tue, 2003-10-14 at 15:08, Chris Shiflett wrote:
> --- Chris Hubbard <[EMAIL PROTECTED]> wrote:
> > header('Location: index.php');
> 
> The Location header requires an absolute URL. This example demonstrates a
> violation of the specification and can have unknown results.
> 
> Chris
> 
> =
> My Blog
>  http://shiflett.org/
> HTTP Developer's Handbook
>  http://httphandbook.org/
> RAMP Training Courses
>  http://www.nyphp.org/ramp

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



[PHP] Re: Foreach Array Help

2003-10-14 Thread Jed R. Brubaker
First of all, thanks for the response.

Here is where I am getting lost:
In $code['assign'][1] - "1" is the assignment ID, and I would like the array
to be able to hold a billion of these different assignments all with
conceivably a billion codeapply ID as in $code['assign'][1]['codeapply'][3],
where "3" is the codeapply value. In other words, because each of these
items directly under assign and codeapply are arrays because they hold
sub-info, I have made the keys of these items the values.

So - am I approaching this whole array thing wrong?

Thanks.

"Rob Adams" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
>
> "Jed R. Brubaker" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> > Okay, total newbie when it comes to arrays, and I could really use some
> > help. I sure this will be an easy one for you veterans out there.
> >
> > Here is the array ($code):
> > array(2) {
> >   ["total"]=>
> >   int(1)
> >   ["assign"]=>
> >   array(1) {
> > [1]=>
> > array(3) {
> >   ["type"]=>
> >   string(10) "Transcript"
> >   ["rows"]=>
> >   string(3) "603"
> >   ["codeapply"]=>
> >   array(1) {
> > [1]=>
> > array(3) {
> >   ["codeset"]=>
> >   string(23) "FFT 6 Level Code System"
> >   ["code_rows"]=>
> >   string(3) "302"
> >   ["code_complete"]=>
> >   string(1) "2"
> > }
> >   }
> > }
> >   }
> > }
> >
> > Here is the output code:
> > foreach ($this->code['assign'] as $assign => $details)
> > {
> > foreach ($assign['codeapply'] as $codeapply => $ca_details)
> > {
> > echo "";
> > echo"";
> > echo$details['type']." ".$assign;
> > echo"";
> > echo"";
> > echo"";
> > echo$ca_details['codeset'];
> > echo"";
> > echo"";
> > echo
> > $ca_details['code_complete']."/".$ca_details['code_rows']." Items
Coded";
> > echo"";
> > echo"";
> > printf  (" %.0d%%",
> > ($ca_details['code_complete']/$ca_details['code_rows'])*100);
> > echo"";
> > echo "";
> > }
> > }
> >
> > Output error:
> > Warning: Cannot use a scalar value as an array
> > Warning: Invalid argument supplied for foreach()
> >
> > Conceptually and practically I have been struggling with how to navigate
> > levels of the arrays which are defined by a variable (e.g.
> > $code['assign'][$i] for the assign ID and $code['assign'][$i][$j] for
the
>
> if $code['assign'][$i] has some integer value, then it is not an array.
> if $code['assign'][$i][$j] has some integer value, then
$code['assign'][$i]
> is an array.
>
> You have two mutually exclusive possibilities there.
>
> Probably, what you want to do is something like:
>
> $code['assign'][$i]['aid'] = (assign ID);
> $code['assign'][$i][$j] = (whatever you want here);
>
> (which, for simplicity, translates into something like:)
>
> $code['assign'][1]['aid'] = 1;
> $code['assign'][1]['1'] = 11;
> $code['assign'][1]['2'] = 12;
> $code['assign'][1]['3'] = 13;
> $code['assign'][1]['4'] = 14;
> $code['assign'][1]['5'] = 15;
> etc.
>
>   -- Rob
>
>
>
>
> > codeapply ID on the assign ID).
> >
> > Thanks in advance!

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



Re: [PHP] Display a JPG Image (continued)

2003-10-14 Thread Pushpinder Singh Garcha
Hello all again,

  I am still having trouble opening a jpg image using

header("Content-type: image/jpg");
$file = "docs/picture1.jpg";
header("Content-disposition: attachment; filename=$file" );
readfile($file);
The reason being that IE on the win platform does not seem to recognize 
the file extension. Mozilla on the Win and Mac Platform behave 
properly. Someone, suggested that just using image/jpeg. Even that duz 
not werk for me.
Suggestion welcome. Thanks in advance.

Pushpinder



On Friday, October 10, 2003, at 01:25 PM, Jon Shoberg wrote:

On Fri, 10 Oct 2003, Bertrand Moulard wrote:

try image/jpeg

cheers

.b


--
http://jon.shoberg.net
--
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: Foreach Array Help

2003-10-14 Thread Jed R. Brubaker
Never mind - I figured it out.

While I was traversing like this:

foreach ($this->code['assign'] as $assign => $details)
{
foreach ($assign['codeapply'] as $codeapply => $ca_details)
{

}
}

I had set up $assign to be the key value, and likewise not be an array. I
changed it to:

foreach ($this->code['assign'] as $assign => $details)
{
foreach ($details['codeapply'] as $codeapply => $ca_details)
{

}
}

and it worked beautifully. Thanks to all of you who got me going in the
right direction.



"Jed R. Brubaker" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Okay, total newbie when it comes to arrays, and I could really use some
> help. I sure this will be an easy one for you veterans out there.
>
> Here is the array ($code):
> array(2) {
>   ["total"]=>
>   int(1)
>   ["assign"]=>
>   array(1) {
> [1]=>
> array(3) {
>   ["type"]=>
>   string(10) "Transcript"
>   ["rows"]=>
>   string(3) "603"
>   ["codeapply"]=>
>   array(1) {
> [1]=>
> array(3) {
>   ["codeset"]=>
>   string(23) "FFT 6 Level Code System"
>   ["code_rows"]=>
>   string(3) "302"
>   ["code_complete"]=>
>   string(1) "2"
> }
>   }
> }
>   }
> }
>
> Here is the output code:
> foreach ($this->code['assign'] as $assign => $details)
> {
> foreach ($assign['codeapply'] as $codeapply => $ca_details)
> {
> echo "";
> echo"";
> echo$details['type']." ".$assign;
> echo"";
> echo"";
> echo"";
> echo$ca_details['codeset'];
> echo"";
> echo"";
> echo
> $ca_details['code_complete']."/".$ca_details['code_rows']." Items Coded";
> echo"";
> echo"";
> printf  (" %.0d%%",
> ($ca_details['code_complete']/$ca_details['code_rows'])*100);
> echo"";
> echo "";
> }
> }
>
> Output error:
> Warning: Cannot use a scalar value as an array
> Warning: Invalid argument supplied for foreach()
>
> Conceptually and practically I have been struggling with how to navigate
> levels of the arrays which are defined by a variable (e.g.
> $code['assign'][$i] for the assign ID and $code['assign'][$i][$j] for the
> codeapply ID on the assign ID).
>
> Thanks in advance!

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



Re: [PHP] header() refresh vs location

2003-10-14 Thread Chris Shiflett
--- Matt Babineau <[EMAIL PROTECTED]> wrote:
> In this example, index.php would be a violation i think. however you
> don't need to provide an absolute URL, you could provide / or ever
> /index.php
> 
> I say this because the header specifying the Host had already been sent.

In HTTP/1.1, the Host header is required, but not in HTTP/1.0. Also, the
specification is not for us to decide; it has already been written. The
Location header requires an absolute URL.

Chris

=
My Blog
 http://shiflett.org/
HTTP Developer's Handbook
 http://httphandbook.org/
RAMP Training Courses
 http://www.nyphp.org/ramp

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



[PHP] PHP 4.3.3 and Apache 2

2003-10-14 Thread Mike Morton
I know this has been discussed in the past - but I wanted to check in with
the group to see if anything has changed.

I have the opportunity to start with a clean webserver running Apache
22.0.40 with PHP 4.3.3

This is a fairly high volume site that will be run on here - with a great
deal of MYSQL interaction.

In the past I have read that php is not ready for apache 2 (or vice versa -
whatever the case...) and there are some problems with stability.

Is this still the case?  Is it time to run a production site with this
combo?  Any experiences with other high volume sites running an apache 2/php
combo?

Any suggestions are appreciated :)

TIA 

--
Cheers

Mike Morton


*
* Tel: 905-465-1263
* Email: [EMAIL PROTECTED]
*


"Indeed, it would not be an exaggeration to describe the history of the
computer industry for the past decade as a massive effort to keep up with
Apple."
- Byte Magazine

Given infinite time, 100 monkeys could type out the complete works of
Shakespeare. Win 98 source code? Eight monkeys, five minutes.
-- NullGrey 

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



[PHP] Re: Foreach Array Help

2003-10-14 Thread Rob Adams

"Jed R. Brubaker" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> First of all, thanks for the response.
>
> Here is where I am getting lost:
> In $code['assign'][1] - "1" is the assignment ID, and I would like the
array
> to be able to hold a billion of these different assignments all with
> conceivably a billion codeapply ID as in
$code['assign'][1]['codeapply'][3],
> where "3" is the codeapply value. In other words, because each of these
> items directly under assign and codeapply are arrays because they hold
> sub-info, I have made the keys of these items the values.
>
> So - am I approaching this whole array thing wrong?

I still don't understand exactly what you want to do, but see below...

>
> Thanks.
>
> "Rob Adams" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> >
> > "Jed R. Brubaker" <[EMAIL PROTECTED]> wrote in message
> > news:[EMAIL PROTECTED]
> > > Okay, total newbie when it comes to arrays, and I could really use
some
> > > help. I sure this will be an easy one for you veterans out there.
> > >
> > > Here is the array ($code):
> > > array(2) {
> > >   ["total"]=>
> > >   int(1)
> > >   ["assign"]=>
> > >   array(1) {
> > > [1]=>
> > > array(3) {
> > >   ["type"]=>
> > >   string(10) "Transcript"
> > >   ["rows"]=>
> > >   string(3) "603"
> > >   ["codeapply"]=>
> > >   array(1) {
> > > [1]=>
> > > array(3) {
> > >   ["codeset"]=>
> > >   string(23) "FFT 6 Level Code System"
> > >   ["code_rows"]=>
> > >   string(3) "302"
> > >   ["code_complete"]=>
> > >   string(1) "2"
> > > }
> > >   }
> > > }
> > >   }
> > > }
> > >
> > > Here is the output code:
> > > foreach ($this->code['assign'] as $assign => $details)
> > > {

Here, $assign is a key from the $this->code['assign'] array.  Since,
according to the array above, assign has only one element, and the key to
that element is '1', $assign will always be one and this code run through
just once.  $details is an array with three key/value pairs.  They are
'type' => 'Transcript', 'rows' => '603', and 'codeapply' => (an array).

> > > foreach ($assign['codeapply'] as $codeapply =>
$ca_details)
> > > {

So, looking at this it looks like what you actually want to do is:
  foreach($details['codeapply'] ... )

$details['codeapply'] has a single key/value pair, which is ('1' => (an
array)).  This array can be reached by using $ca_details['codeset']... etc.

> > > echo "";
> > > echo"";
> > > echo$details['type']." ".$assign;
> > > echo"";
> > > echo"";
> > > echo"";
> > > echo$ca_details['codeset'];
> > > echo"";
> > > echo"";
> > > echo
> > > $ca_details['code_complete']."/".$ca_details['code_rows']." Items
> Coded";
> > > echo"";
> > > echo"";
> > > printf  (" %.0d%%",
> > > ($ca_details['code_complete']/$ca_details['code_rows'])*100);
> > > echo"";
> > > echo "";
> > > }
> > > }
> > >
> > > Output error:
> > > Warning: Cannot use a scalar value as an array
> > > Warning: Invalid argument supplied for foreach()
> > >
> > > Conceptually and practically I have been struggling with how to
navigate
> > > levels of the arrays which are defined by a variable (e.g.
> > > $code['assign'][$i] for the assign ID and $code['assign'][$i][$j] for
> the
> >
> > if $code['assign'][$i] has some integer value, then it is not an array.
> > if $code['assign'][$i][$j] has some integer value, then
> $code['assign'][$i]
> > is an array.
> >
> > You have two mutually exclusive possibilities there.
> >
> > Probably, what you want to do is something like:
> >
> > $code['assign'][$i]['aid'] = (assign ID);
> > $code['assign'][$i][$j] = (whatever you want here);
> >
> > (which, for simplicity, translates into something like:)
> >
> > $code['assign'][1]['aid'] = 1;
> > $code['assign'][1]['1'] = 11;
> > $code['assign'][1]['2'] = 12;
> > $code['assign'][1]['3'] = 13;
> > $code['assign'][1]['4'] = 14;
> > $code['assign'][1]['5'] = 15;
> > etc.
> >
> >   -- Rob
> >
> >
> >
> >
> > > codeapply ID on the assign ID).
> > >
> > > Thanks in advance!

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



Re: [PHP] Re: header() refresh vs location

2003-10-14 Thread Curt Zirzow
* Thus wrote Chris Shiflett ([EMAIL PROTECTED]):
> --- Kevin Stone <[EMAIL PROTECTED]> wrote:
> > The Refresh directive is a valid header.  I've used it for many
> > years and it seems to be supported by the majority of browsers.
> 
> My experience has been the same.
> 
> > However I've never read anything that would indicate that Refresh
> > works any differently than Location.
> 
> Well, it does, though the difference may not be so obvious. The Location header
> accompanies a response with a status code of 3xx, which tells the Web client
> that the resource has moved. This matters when it comes to things like Google
> indexing your site. Google will fetch the new resource and consider it the same
> as the original resource as long as the status code was 3xx.
> 
> It is also more transparent; a 3xx response does not exist in the client's
> history mechanism (well, it's not supposed to), so a user who clicks back won't
> be sent forward immediately (making the back button appear broken or disabled).
> I'm not sure if Refresh is interpreted as being transparent in the history as
> well, but in my current browser (Galeon), it is definitely not.

Correct. Also, a 3xx response should not render the content that is
included with the response, unless the client doesn't support 3xx
(rare) or the user wishes that the browser not to redirect
automatically.

The refresh header will render the html and start the timer for the
refresh once the rendering is done, which does effect the history
of the browser.


Curt
-- 
"My PHP key is worn out"

  PHP List stats since 1997: 
  http://zirzow.dyndns.org/html/mlists/

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



Re: [PHP] Pulling variables from a URL

2003-10-14 Thread Daniel Guerrier
Who keeps telling people to use :)
$_GET[$username]

it should be $_GET['username']
$_GET is a key value pair array.
the key is the name of the html form variable in this
case username and the value is the value entered in
the form.

 
--- Adrian <[EMAIL PROTECTED]> wrote:
> lol variables in quotes - especialli when there is
> only the variable
> are really ugly.
> you should use $_GET[$username]...
> 
> > Use double quotes:
> > $_GET["$username"];
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


__
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com

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



Re: [PHP] Pulling variables from a URL

2003-10-14 Thread Comex
<[EMAIL PROTECTED]>
Daniel Guerrier:
> Who keeps telling people to use :)
> $_GET[$username]

$_GET[$username]???
http://whatever.com/whatever.php?username=blah&blah=value???

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



[PHP] Server Slow After PHP Error

2003-10-14 Thread Weston
Whenever I access a PHP script from the web that contains an error (such as
a parsing error, etc...) The server will not respond to any request (php or
not) for about 2-3 minutes. This only happens over the web though, if i try
to run a php file using command line, the error loads immedaitely. Any help?
My system information is listed below.

RedHat Linux 7.3
Apache 1.3.27
PHP 4.1.2

Thanx
Weston

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



[PHP] Re: Pulling variables from a URL

2003-10-14 Thread Gabriel Peugnet
Every body have already gave you the answers.
Just one more thing:

the method you are useing is GET because you are passing variables in the
URL so use of $_POST doesn't work.

the only line you need is
$username = $_GET['username'];

after this you can do any thing with $username.

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



Re: [PHP] BUG: sprintf(%u) and ip2long

2003-10-14 Thread Curt Zirzow
* Thus wrote Daevid Vincent ([EMAIL PROTECTED]):
> Could be my not understanding of something, but I think there is a bug in
> using ip2long() and sprintf(%u) as indicated on this page:
> http://us4.php.net/manual/en/function.ip2long.php

What version of php? It works find in 4.3.3.

echo long2ip(3232304168);
---
192.169.12.40

Curt
-- 
"My PHP key is worn out"

  PHP List stats since 1997: 
  http://zirzow.dyndns.org/html/mlists/

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



Re: [PHP] Finally, PDF Header for PDF stuffs that work....

2003-10-14 Thread Curt Zirzow
* Thus wrote Scott Fletcher ([EMAIL PROTECTED]):
> //Can't use readfile() due to poor controlling of the file download.
> //(IE have this problems)...
> //readfile($filepath);

readfile has no effect on how IE handles downloads.

> 
> //use fopen() instead of readfile...
> $fp = fopen($filepath, 'rb');
> $pdf_buffer = fread($fp, $filesize);
> fclose ($fp);
> 
> print $pdf_buffer;

Loading the whole file in memory and not doing anything with it
before sending it to the client doesn't make much sense.

> 
> //Required, to keep IE from running into problems
> //when opening the file while downloading or downloading...
> //(IE been acting strange...)
> exit();

This also doesn't effect IE.


Curt
-- 
"My PHP key is worn out"

  PHP List stats since 1997: 
  http://zirzow.dyndns.org/html/mlists/

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



[PHP] Trying to get mysql_fetch_array data into phplot.

2003-10-14 Thread Jamie Dahl
I'm trying to track progress etc..say running and how each run gets' 
progressivly longer etc...or the time decreases as the distance stays 
the same etc..

Anyway, when doing the mysql_fetch_array, I need that data to somehow 
not get lost once the while loop has completed, also, I need to stack 
the array so that phplot can run w/ it... The data that gets passed to 
phplot.php should look like the following, but..that's only b/c I'm 
printr inside the while loop...You cannot pass the DrawGraph function 
inside the loop and expect it to function it correctly.

If someone would like to give me some ideas/tips/pointers it would be 
greatly appreciated!

-jamied



--
"Thousands of tired, nerve-shaken, over-civilized people are beginning 
to find out that going to the mountains is going home; that wilderness 
is a necessity; and that mountain parks and reservations are useful not 
only as fountains of timber and irrigating rivers, but as fountains of 
life." --John Muir

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


Re: [PHP] Server Slow After PHP Error

2003-10-14 Thread Timothy Hitchens
I would suggest that your Apache process has not finished with PHP
processing eg. loop etc etc

Remember that HTTP/1.0 allows (4) four connections and HTTP/1.1 allows (2)
two connections so if you have a long process eg a HTTP/1.1 stream coming
from the server or the server believes that the connection has yet to
finish then it would appear to you as the server is slow ... when this
happens next try from another box and you should see no problems.


Timothy Hitchens (HiTCHO)
[EMAIL PROTECTED]


Weston said:
> Whenever I access a PHP script from the web that contains an error (such
> as
> a parsing error, etc...) The server will not respond to any request (php
> or
> not) for about 2-3 minutes. This only happens over the web though, if i
> try
> to run a php file using command line, the error loads immedaitely. Any
> help?
> My system information is listed below.
>
> RedHat Linux 7.3
> Apache 1.3.27
> PHP 4.1.2
>
> Thanx
> Weston
>
> --
> 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] BUG: sprintf(%u) and ip2long

2003-10-14 Thread Daevid Vincent
Good point...

v4.1.2, Linux stripples.devel.redhat.com 2.4.18-11smp #1 SMP Thu Aug 15
06:41:59 EDT 2002 i686 unknown
This program makes use of the Zend Scripting Language Engine:
Zend Engine v1.1.1, Copyright (c) 1998-2001 Zend Technologies
with Zend Optimizer v2.1.0, Copyright (c) 1998-2003, by Zend
Technologies
Apache/1.3.22

Also, if you notice, in my example, the problem was using the sprintf (%u)
as per the example on the php website. Just doing like you did works for me
too...

> -Original Message-
> From: Curt Zirzow [mailto:[EMAIL PROTECTED] 
> Sent: Tuesday, October 14, 2003 2:25 PM
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP] BUG: sprintf(%u) and ip2long
> 
> * Thus wrote Daevid Vincent ([EMAIL PROTECTED]):
> > Could be my not understanding of something, but I think 
> there is a bug in
> > using ip2long() and sprintf(%u) as indicated on this page:
> > http://us4.php.net/manual/en/function.ip2long.php
> 
> What version of php? It works find in 4.3.3.
> 
> echo long2ip(3232304168);
> ---
> 192.169.12.40

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



Re: [PHP] Re: Pulling variables from a URL(thanks)

2003-10-14 Thread Frank Tudor
Thanks eveyone for all the info.

I got it working!

:)

Frank


--- Gabriel Peugnet <[EMAIL PROTECTED]> wrote:
> Every body have already gave you the answers.
> Just one more thing:
> 
> the method you are useing is GET because you are passing
> variables in the
> URL so use of $_POST doesn't work.
> 
> the only line you need is
> $username = $_GET['username'];
> 
> after this you can do any thing with $username.
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


__
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com

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



[PHP] cURL > Authorize.Net > Super slow processing times!!

2003-10-14 Thread Matt Babineau
Hey All-

Just built a cart, and I want to connect it to Authorize.net with cURL
and I am able to do that fine. The problem is, it takes a while to
process the transaction. Sometimes the user's browser just sits there
for 5, 10 or even 30 seconds before the page finishes processing and
they are taken to their confirmation receipt. I was wondering if anyone
had any similar experiences with Authorize.net or would know how to
speed this process WAY up. Its just too darn slow.

It seems that my web server takes forever to process the transactions
which make it look like the page is timing out to the user. I have a
fast server, at a great hosting facility. Does anyone have any examples
of really fast authorize.net code?

Here is how my code works:

1. user enters payment info
2. hit sumbit and goes to payment processing page
3. pages sends transaction to authorize.net
4. user is redirected to receipt page using header(Location) upon
success otherwise back to payment page upon failure.

I am using an Authorize.net class off zend.com for the processing,
you'll find I submitted an updated version to them a few months ago.

Does anyone have a better way of doing this? or have any suggestion for
"the best" speed related solution?

Thanks!!
Matt

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



Re: [PHP] BUG: sprintf(%u) and ip2long

2003-10-14 Thread Curt Zirzow
* Thus wrote Daevid Vincent ([EMAIL PROTECTED]):
> Good point...
> 
> v4.1.2, Linux stripples.devel.redhat.com 2.4.18-11smp #1 SMP Thu Aug 15
> 06:41:59 EDT 2002 i686 unknown
> This program makes use of the Zend Scripting Language Engine:
> Zend Engine v1.1.1, Copyright (c) 1998-2001 Zend Technologies
> with Zend Optimizer v2.1.0, Copyright (c) 1998-2003, by Zend
> Technologies
> Apache/1.3.22
> 
> Also, if you notice, in my example, the problem was using the sprintf (%u)
> as per the example on the php website. Just doing like you did works for me
> too...

still works using sprintf() with 4.3.3
  http://zirzow.dyndns.org/html/php/tests/string/ip2long.php


Curt
-- 
"My PHP key is worn out"

  PHP List stats since 1997: 
  http://zirzow.dyndns.org/html/mlists/

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



Re: [PHP] Pulling variables from a URL

2003-10-14 Thread Chris Shiflett
--- Comex <[EMAIL PROTECTED]> wrote:
> $_GET[$username]???
> http://whatever.com/whatever.php?username=blah&blah=value???

Is this a question? If so, the answer is no. :-)

Chris

=
My Blog
 http://shiflett.org/
HTTP Developer's Handbook
 http://httphandbook.org/
RAMP Training Courses
 http://www.nyphp.org/ramp

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



Re: [PHP] Finally, PDF Header for PDF stuffs that work....

2003-10-14 Thread Mohamed Lrhazi
On Tue, 2003-10-14 at 17:33, Curt Zirzow wrote:
> > 
> > //use fopen() instead of readfile...
> > $fp = fopen($filepath, 'rb');
> > $pdf_buffer = fread($fp, $filesize);
> > fclose ($fp);
> > 
> > print $pdf_buffer;
> 
> Loading the whole file in memory and not doing anything with it
> before sending it to the client doesn't make much sense.

Are you saying readfile() somehow avoids loading the whole file into
memory? maybe it does, you learn everyday, I am just wondering...

Mohamed~

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



Re: [PHP] Finally, PDF Header for PDF stuffs that work....

2003-10-14 Thread Curt Zirzow
* Thus wrote Mohamed Lrhazi ([EMAIL PROTECTED]):
> On Tue, 2003-10-14 at 17:33, Curt Zirzow wrote:
> > > 
> > > //use fopen() instead of readfile...
> > > $fp = fopen($filepath, 'rb');
> > > $pdf_buffer = fread($fp, $filesize);
> > > fclose ($fp);
> > > 
> > > print $pdf_buffer;
> > 
> > Loading the whole file in memory and not doing anything with it
> > before sending it to the client doesn't make much sense.
> 
> Are you saying readfile() somehow avoids loading the whole file into
> memory? maybe it does, you learn everyday, I am just wondering...

Correct, readfile() doesn't load the whole file into memory.

Imagine if readfile did read the whole thing into memory. and you
have a script was sending 100MB files to the users and then 10 people
happend to come across your site at the same time. your system will
require, at minimum, 1000MB's of memory to send the files. And cross your
fingers the site doesn't get posted to a BBs.


Curt
-- 
"My PHP key is worn out"

  PHP List stats since 1997: 
  http://zirzow.dyndns.org/html/mlists/

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



[PHP] class/object design

2003-10-14 Thread Chris W. Parker
Hey peeps.

Let me try to make this simple. Right now I have a base db class that is
moved solely for interacting with the db. It opens the connection, runs
queries, and returns the results of those queries. Along with this class
I've got some other classes (I'll call them "upper" classes) that are
used to interact with different aspects of my project. For example I've
got a Products class (used to add/delete products, etc.) and a Category
class (used to add/delete categories, etc.).

Currently I'm extending the base db class into these "upper" classes.
i.e.

class DB
{
function dostuff ()
{
}
}

class Products extends DB
{
function dothings ()
{
$this->dostuff();
}
}

On this list I read a post that suggested I not do it this way but
instead instantiate a DB object within each method of the "upper" class
whenever necessary (as far as I understood the recommendation).

This sounds like a good idea except that this would mean I'd be creating
and destroying a DB object each time a method in an "upper" class needed
to access the db. The way I'm doing it now requires that I only
instantiate one object for the entire page and let any method in that
"upper" class to share the connection.

With my limited knowledge of OOP the only solution I can see would be to
use a constructor in the "upper" class to instantiate the object when
the "upper" class object is instantiated.

Am I making sense and does anyone have any suggestions or comments to
add? Maybe something to straighten me out?



Thanks,
Chris.

--
Don't like reformatting your Outlook replies? Now there's relief!
http://home.in.tum.de/~jain/software/outlook-quotefix/

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



[PHP] Unrouteable address(little 0-t)

2003-10-14 Thread Ryan A
Hi,
I was testing a script from one of our sites and then suddenly all emails to
that site is giving me this error:

"Unrouteable address"

and a hell of a lot of blah blahs

I also tried it from regular email and am getting the same problem.

What to do?

Cheers,
-Ryan

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



[PHP] Sessions Question

2003-10-14 Thread Jake McHenry
Hi everyone,

I've been trying to set up sessions, but have been having problems. I
created an online time clock for my company using php and a mysql
database. It's everything that my boss wanted. The only problem is, he
told me today that he is planning on selling it to our partners. The
actual software and database will reside on my server, but I will give
them their own database.

I started designing it about 2 years ago, and the machine that I was
working on at the time had register_globals=on, so I built my
scripting around that. I didn't know much about php at the time, but
have learned an immense amount since then.

Since a people are now going to be accessing the time clock from
outside my company, I need to turn register_globals off, and turn
sessions on. My problem is that all my variables are declared locally
in the individual files, and are being passed by forms to $PHP_SELF,
and all of the variables and their values can be seen in the address
bar.

This never concerned me while being inside my firewall, since it was
only my employees and I. I knew what was going on.

I've read a lot of documents on the net concerning sessions, but still
can't get it to work right. Whenever I try to go to another page, or
submit a time, it either doesn't work at all, or it works, but the
value that's in the variable is stuck there, and I can't change it
without closing the browser and starting over.

Can someone point me in the right direction here?

Thanks,
Jake McHenry
Nittany Travel MIS Coordinator
http://www.nittanytravel.com

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



RE: [PHP] Sessions Question

2003-10-14 Thread Chris Hubbard
Jake,
it would be helpful if we could see your code.

That said...

first you need to identify what information you need to track in the
sessions, and whether you're going to use php sessions (the $_SESSIONS
array) or build your own mysql based session tracker.

to use php sessions:
you will need some place where you set up/create the sessions.  typically
this is the login page.  let's assume you'll use the login page.  The logic
for the login page goes something like this:
1.  present a form for logging in (usually username/password)
2.  on post, clean the posted data (remove html, special characters, etc)
3.  check the cleaned username/password against the data in the database
4.  if the username/password is valid, create your session and assign
variables to it like this:
session_start();  //create the session
$id = session_id();  // create a unique session id
session_register("id");  // register id as a session variable
session_register("name");  // register name as a session variable
session_register("email");  // register email as a session variable
$_SESSION["id"] = $id;  // assign the unique session id to session array
$_SESSION["name"] = $data["name"];  // assign the username to session array
$_SESSION["email"] = $data["email"];  // assign additional values (after
regisering them) to session array

5.  now either redirect to your main application page, or create another
page with links to that main applicaiton page.  In either case every page
where you want to use sessions has to start with:
session_start();

for example:
http://www.mydomain.com/login.php";);
}else{
// the body of your code goes here.
}

7.  so with all that the pages you want to access session in should have a
structure similar to:



Hope this is helpful.

Chris

-Original Message-
From: Jake McHenry [mailto:[EMAIL PROTECTED]
Sent: Tuesday, October 14, 2003 4:00 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Sessions Question


Hi everyone,

I've been trying to set up sessions, but have been having problems. I
created an online time clock for my company using php and a mysql
database. It's everything that my boss wanted. The only problem is, he
told me today that he is planning on selling it to our partners. The
actual software and database will reside on my server, but I will give
them their own database.

I started designing it about 2 years ago, and the machine that I was
working on at the time had register_globals=on, so I built my
scripting around that. I didn't know much about php at the time, but
have learned an immense amount since then.

Since a people are now going to be accessing the time clock from
outside my company, I need to turn register_globals off, and turn
sessions on. My problem is that all my variables are declared locally
in the individual files, and are being passed by forms to $PHP_SELF,
and all of the variables and their values can be seen in the address
bar.

This never concerned me while being inside my firewall, since it was
only my employees and I. I knew what was going on.

I've read a lot of documents on the net concerning sessions, but still
can't get it to work right. Whenever I try to go to another page, or
submit a time, it either doesn't work at all, or it works, but the
value that's in the variable is stuck there, and I can't change it
without closing the browser and starting over.

Can someone point me in the right direction here?

Thanks,
Jake McHenry
Nittany Travel MIS Coordinator
http://www.nittanytravel.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] Who knows all the Header attributes.

2003-10-14 Thread Gabriel Peugnet
Could some one tell me where can I find the documentation for the Hedear()
function?

The manual does not provide it but just some examples.

I know Header( "Location: http..." ), Header( "Expires ..." ).

But want to know about:
Content...
Content-Disposition
etc.

Thanks.
Gabriel.

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



RE: [PHP] Sessions Question

2003-10-14 Thread Chris W. Parker
Jake McHenry 
on Tuesday, October 14, 2003 5:00 PM said:

[snip]

> Can someone point me in the right direction here?

I'd love to help you but you did not provide enough information.


What exactly are you trying to do and what is it failing? Try showing us
the code in question.

Are you receiving any errors messages?

Are you making sure to start the session with 'session_start();' on each
page the session needs to be accessed?



HTH,
Chris.

--
Don't like reformatting your Outlook replies? Now there's relief!
http://home.in.tum.de/~jain/software/outlook-quotefix/

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



[PHP] Re: Server Slow After PHP Error

2003-10-14 Thread Weston
Any ideas on how to correct the problem with reinstalling server software?

Thanx
-Weston

"Weston" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Whenever I access a PHP script from the web that contains an error (such
as
> a parsing error, etc...) The server will not respond to any request (php
or
> not) for about 2-3 minutes. This only happens over the web though, if i
try
> to run a php file using command line, the error loads immedaitely. Any
help?
> My system information is listed below.
>
> RedHat Linux 7.3
> Apache 1.3.27
> PHP 4.1.2
>
> Thanx
> Weston

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



Re: [PHP] Run the same php function several times in th background

2003-10-14 Thread John Nichel
Jay Blanchard wrote:
[snip]
This is not what he asked.  He wants to run the process in the
background.
PHP's process control functions may do what you need

http://us3.php.net/manual/en/ref.pcntl.php
[/snip]
My badunder the influence of anti-histamines and other cold
medicines.

Well, the RTFM, STFA, and STFW part still held true.  :)

--
By-Tor.com
It's all about the Rush
http://www.by-tor.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] Sessions Question

2003-10-14 Thread Mike Brum
One quick note - if you're starting a session then you can't user the
header() function afterwards. You'll get the lovel "headers already sent"
error. 

Be sure to use an alternate method of redirection if you're starting a
session before your redirect logic takes place.

-M

-Original Message-
From: Chris Hubbard [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, October 14, 2003 9:24 PM
To: [EMAIL PROTECTED]
Subject: RE: [PHP] Sessions Question


Jake,
it would be helpful if we could see your code.

That said...

first you need to identify what information you need to track in the
sessions, and whether you're going to use php sessions (the $_SESSIONS
array) or build your own mysql based session tracker.

to use php sessions:
you will need some place where you set up/create the sessions.  typically
this is the login page.  let's assume you'll use the login page.  The logic
for the login page goes something like this: 1.  present a form for logging
in (usually username/password) 2.  on post, clean the posted data (remove
html, special characters, etc) 3.  check the cleaned username/password
against the data in the database 4.  if the username/password is valid,
create your session and assign variables to it like this:
session_start();  //create the session
$id = session_id();  // create a unique session id
session_register("id");  // register id as a session variable
session_register("name");  // register name as a session variable
session_register("email");  // register email as a session variable
$_SESSION["id"] = $id;  // assign the unique session id to session
array
$_SESSION["name"] = $data["name"];  // assign the username to
session array
$_SESSION["email"] = $data["email"];  // assign additional values
(after regisering them) to session array

5.  now either redirect to your main application page, or create another
page with links to that main applicaiton page.  In either case every page
where you want to use sessions has to start with: session_start();

for example:
http://www.mydomain.com/login.php";);
}else{
// the body of your code goes here.
}

7.  so with all that the pages you want to access session in should have a
structure similar to: 


Hope this is helpful.

Chris

-Original Message-
From: Jake McHenry [mailto:[EMAIL PROTECTED]
Sent: Tuesday, October 14, 2003 4:00 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Sessions Question


Hi everyone,

I've been trying to set up sessions, but have been having problems. I
created an online time clock for my company using php and a mysql database.
It's everything that my boss wanted. The only problem is, he told me today
that he is planning on selling it to our partners. The actual software and
database will reside on my server, but I will give them their own database.

I started designing it about 2 years ago, and the machine that I was working
on at the time had register_globals=on, so I built my scripting around that.
I didn't know much about php at the time, but have learned an immense amount
since then.

Since a people are now going to be accessing the time clock from outside my
company, I need to turn register_globals off, and turn sessions on. My
problem is that all my variables are declared locally in the individual
files, and are being passed by forms to $PHP_SELF, and all of the variables
and their values can be seen in the address bar.

This never concerned me while being inside my firewall, since it was only my
employees and I. I knew what was going on.

I've read a lot of documents on the net concerning sessions, but still can't
get it to work right. Whenever I try to go to another page, or submit a
time, it either doesn't work at all, or it works, but the value that's in
the variable is stuck there, and I can't change it without closing the
browser and starting over.

Can someone point me in the right direction here?

Thanks,
Jake McHenry
Nittany Travel MIS Coordinator
http://www.nittanytravel.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 General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP 4.3.3 and Apache 2

2003-10-14 Thread John Nichel
Mike Morton wrote:
I know this has been discussed in the past - but I wanted to check in with
the group to see if anything has changed.
I have the opportunity to start with a clean webserver running Apache
22.0.40 with PHP 4.3.3
Apache 22?  Holy future release Batman.  :)

This is a fairly high volume site that will be run on here - with a great
deal of MYSQL interaction.
In the past I have read that php is not ready for apache 2 (or vice versa -
whatever the case...) and there are some problems with stability.
Is this still the case?  Is it time to run a production site with this
combo?  Any experiences with other high volume sites running an apache 2/php
combo?
Any suggestions are appreciated :)
To the best of my knowledge, Apache2 and PHP are still not good bedfellows.

--
By-Tor.com
It's all about the Rush
http://www.by-tor.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Who knows all the Header attributes.

2003-10-14 Thread Mike Migurski
>Could some one tell me where can I find the documentation for the
>Hedear() function?
>
>The manual does not provide it but just some examples.

Check the HTTP spec for a definitive listing:
http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14

-
michal migurski- contact info and pgp key:
sf/cahttp://mike.teczno.com/contact.html

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



RE: [PHP] Sessions Question

2003-10-14 Thread Jake McHenry
Sorry, I sent that last email directly to someone... Here it is again.

Here is my index file, it's the smallest of the set. This would be a
huge post if I would submit one of those. Config.php has config
options, time.php is basically getting the system time and then
manipulating it, instead of in each file.

I tried what you mentioned, almost exactly, missing the register id,
but I was using the $_SESSION for all my variables, and that's where I
ran into not being able to change them unless I would close the
browser and start over. And yes, I was using session_start() at the
beginning of all my files.

If the person puts in username: admin, then it basically dumps the
entire database onto the screen, with some manipulation of course,
otherwise, it only shows the individual employees data.

I also know I have to change the way people log in, I need to hash the
password and compare the two instead of all plain text.

Thanks,
Jake


Database Error: Not Logged In, please try
again";
}
  }
  else
  {
echo "Error: You are already clocked in!";
  }
}
else if ($inout == "out")
{
  if ($error != 0)
  {
$sql = "UPDATE $username SET `cotime`='$LogInOutTime',
`coampm`='$LogInOutAmPm' WHERE `ymd` LIKE
'$Year-$MonthNumber-$DayNumber' AND `cotime` LIKE '00:00:00' LIMIT 1";
$result = mysql_query($sql);

if ($result == 1)
{
  Header("Location:
userpage.php?uname=$username&fullname=$fullname&inout=$inout\n\n");
}
else
{
  echo "Database Error: Not Logged Out, please try
again";
}
  }
  else
  {
echo "Error: You are not clocked in!";
  }
}
else if ($inout == "timeoff")
{
Header("Location:
timeoff.php?uname=$username&fullname=$fullname&inout=$inout\n\n");
}
else
{
Header("Location:
userpage.php?uname=$username&fullname=$fullname&inout=$inout\n\n");
}
  }
  else
  {
echo "Error: invalid password!";
  }
}

echo < -Original Message-
> From: Chris Hubbard [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, October 14, 2003 9:24 PM
> To: [EMAIL PROTECTED]
> Subject: RE: [PHP] Sessions Question
> 
> 
> Jake,
> it would be helpful if we could see your code.
> 
> That said...
> 
> first you need to identify what information you need to track
> in the sessions, and whether you're going to use php sessions 
> (the $_SESSIONS
> array) or build your own mysql based session tracker.
> 
> to use php sessions:
> you will need some place where you set up/create the
> sessions.  typically this is the login page.  let's assume 
> you'll use the login page.  The logic for the login page goes 
> something like this: 1.  present a form for logging in 
> (usually username/password) 2.  on post, clean the posted 
> data (remove html, special characters, etc) 3.  check the 
> cleaned username/password against the data in the database 4. 
>  if the username/password is valid, create your session and 
> assign variables to it like this:
>   session_start();  //create the session
>   $id = session_id();  // create a unique session id
>   session_register("id");  // register id as a session variable
>   session_register("name");  // register name as a 
> session variable
>   session_register("email");  // register email as a 
> session variable
>   $_SESSION["id"] = $id;  // assign the unique session id 
> to session array
>   $_SESSION["name"] = $data["name"];  // assign the 
> username to session array
>   $_SESSION["email"] = $data["email"];  // assign 
> additional values (after regisering them) to session array
> 
> 5.  now either redirect to your main application page, or
> create another page with links to that main applicaiton page. 
>  In either case every page where you want to use sessions has 
> to start with: session_start();
> 
> for example:
>  session_start();
> the rest of your code.
> 
> 6.  I recommend that you add a check to your pages to make
> sure that the session is still the right one and it's intact, 
> something like this: if (!$_SESSION["id"])  // if no session 
> id, return to the login page {
>   header ("Refresh: 0; url=login.php");  //or
>   // header ("location:http://www.mydomain.com/login.php";);
> }else{
>   // the body of your code goes here.
> }
> 
> 7.  so with all that the pages you want to access session in
> should have a structure similar to:  (!$_SESSION["id"]) {
>   header ("Refresh: 0; url=login.php");
> }else{
>   // do all kinds of nifty time card things here
> }
> ?>
> 
> 
> Hope this is helpful.
> 
> Chris
> 
> -Original Message-
> From: Jake McHenry [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, October 14, 2003 4:00 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Sessions Question
> 
> 
> Hi everyone,
> 
> I've been trying to set up sessions, but have been having
> problems. I created an online time clock for my compan

RE: [PHP] Sessions Question

2003-10-14 Thread Chris Hubbard
Mike,
I don't get the "headers already sent" error.  here's the code I'm using:

if ($_POST)
{
$result = cleanData($_POST);
$sql = "SELECT `id`,`username`,`password`,`email` FROM `users` WHERE
(`username` = '". $result["username"] ."') AND (`password` = '".
md5($result["password"]) ."')";
if ($conn->query($sql))
{
// if name and password match
while (!$conn->movenext())
{
$data["id"] = $conn->value("id");
$data["name"] = $conn->value("username");
$data["email"] = $conn->value("email");
}
// Now create the session
session_start();
$id = session_id();
session_register("id");
session_register("name");
session_register("email");
session_register("sections");
$_SESSION["id"] = $id;
$_SESSION["name"] = $data["name"];
$_SESSION["email"] = $data["email"];
header("Location:
http://ubb.atlantic-records.com/gallery/admin/index.php";);
}else{
// if name and password don't match
header ("Refresh: 0; url=login.php");
}
}

-Original Message-
From: Mike Brum [mailto:[EMAIL PROTECTED]
Sent: Tuesday, October 14, 2003 4:31 PM
To: 'Chris Hubbard'; [EMAIL PROTECTED]
Subject: RE: [PHP] Sessions Question


One quick note - if you're starting a session then you can't user the
header() function afterwards. You'll get the lovel "headers already sent"
error.

Be sure to use an alternate method of redirection if you're starting a
session before your redirect logic takes place.

-M

-Original Message-
From: Chris Hubbard [mailto:[EMAIL PROTECTED]
Sent: Tuesday, October 14, 2003 9:24 PM
To: [EMAIL PROTECTED]
Subject: RE: [PHP] Sessions Question


Jake,
it would be helpful if we could see your code.

That said...

first you need to identify what information you need to track in the
sessions, and whether you're going to use php sessions (the $_SESSIONS
array) or build your own mysql based session tracker.

to use php sessions:
you will need some place where you set up/create the sessions.  typically
this is the login page.  let's assume you'll use the login page.  The logic
for the login page goes something like this: 1.  present a form for logging
in (usually username/password) 2.  on post, clean the posted data (remove
html, special characters, etc) 3.  check the cleaned username/password
against the data in the database 4.  if the username/password is valid,
create your session and assign variables to it like this:
session_start();  //create the session
$id = session_id();  // create a unique session id
session_register("id");  // register id as a session variable
session_register("name");  // register name as a session variable
session_register("email");  // register email as a session variable
$_SESSION["id"] = $id;  // assign the unique session id to session
array
$_SESSION["name"] = $data["name"];  // assign the username to
session array
$_SESSION["email"] = $data["email"];  // assign additional values
(after regisering them) to session array

5.  now either redirect to your main application page, or create another
page with links to that main applicaiton page.  In either case every page
where you want to use sessions has to start with: session_start();

for example:
http://www.mydomain.com/login.php";);
}else{
// the body of your code goes here.
}

7.  so with all that the pages you want to access session in should have a
structure similar to: 


Hope this is helpful.

Chris

-Original Message-
From: Jake McHenry [mailto:[EMAIL PROTECTED]
Sent: Tuesday, October 14, 2003 4:00 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Sessions Question


Hi everyone,

I've been trying to set up sessions, but have been having problems. I
created an online time clock for my company using php and a mysql database.
It's everything that my boss wanted. The only problem is, he told me today
that he is planning on selling it to our partners. The actual software and
database will reside on my server, but I will give them their own database.

I started designing it about 2 years ago, and the machine that I was working
on at the time had register_globals=on, so I built my scripting around that.
I didn't know much about php at the time, but have learned an immense amount
since then.

Since a people are now going to be accessing the time clock from outside my
company, I need to turn register_globals off, and turn sessions on. My
problem is that all my variables are declared locally in the individual
files, and are being passed by forms to $PHP_SELF, and all of the variables
and their values can be seen in the address bar.

This never concerned me while being inside my firewall, since

[PHP] session question

2003-10-14 Thread Frank Tudor
How do you make a session time out?

and how do you make a session end if a person leaves your site?

Frank

__
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com

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



RE: [PHP] session question

2003-10-14 Thread Jake McHenry
session_destroy() I'm pretty sure, from what I've read.

Jake McHenry
Nittany Travel MIS Coordinator
http://www.nittanytravel.com

> -Original Message-
> From: Frank Tudor [mailto:[EMAIL PROTECTED] 
> Sent: Tuesday, October 14, 2003 8:47 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] session question
> 
> 
> How do you make a session time out?
> 
> and how do you make a session end if a person leaves your site?
> 
> Frank
> 
> __
> Do you Yahoo!?
> The New Yahoo! Shopping - with improved product search 
http://shopping.yahoo.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] reading linux wtmp file

2003-10-14 Thread Michael P. Carel
Hi to all,

Have a problem here in reading the file wtmp in linux. Is there a way I can
view it using a php script?

Thanks in advance.


Mike

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



Re: [PHP] Who knows all the Header attributes.

2003-10-14 Thread Gabriel Peugnet
Mike, the site you refered me has the information I was looking for.

Thank you very much.
Gabriel.


"Mike Migurski" <[EMAIL PROTECTED]> escribió en el mensaje
news:[EMAIL PROTECTED]
> >Could some one tell me where can I find the documentation for the
> >Hedear() function?
> >
> >The manual does not provide it but just some examples.
>
> Check the HTTP spec for a definitive listing:
> http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14
>
> -
> michal migurski- contact info and pgp key:
> sf/cahttp://mike.teczno.com/contact.html

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



php-general@lists.php.net

2003-10-14 Thread Daevid Vincent
Okay, I thought the hack of doing this (scan.sh) might work, but running
some timing tests, it's apparent that it's not...
The more IP addresses I schedule to scan, the longer it takes to return my
browser page.

#!/bin/sh
/bin/scan &

And while if I run it on the command line in bash, it works just fine, PHP
seems to STILL wait until the /bin/scan is done. UGH!

I tried this exec() suggestion and that didn't work right either.
exec("/bin/scan & > /dev/null 2>/dev/null");

Then I thought I might try this
http://us2.php.net/manual/en/function.pcntl-fork.php
But frustratingly, "Process Control support in PHP is not enabled by
default. You have to compile the CGI or CLI version of PHP with
--enable-pcntl configuration option when compiling PHP to enable Process
Control support. " and I'm using RPMs without the ability to recompile, as
this PHP code is to be deployed on many boxes that are all ghost images of
the one I'm developing on.

Rasmus or someone in the know, please tell me how I can fire off a process
without having PHP wait for the return.

I'm doing:

$time_start = getmicrotime();
echo "executing scan.sh";
exec("/www/datasafe/scan.sh &");
$time_end = getmicrotime();
echo "command took: ".($time_end - $time_start)." seconds";

And I see things like 7, 14 and 28 seconds depending on if I use a /24, /22,
/21 CIDR range for the IP address subnet. Furthermore, calculating the list
of IP's to put in the db doesn't take more than a second or two in all
cases. And I don't think that the mySQL overhead is taking up the other
time.

Daevid.

> -Original Message-
> From: Marek Kilimajer [mailto:[EMAIL PROTECTED] 
> Sent: Saturday, October 11, 2003 5:02 AM
> To: Daevid Vincent
> Cc: [EMAIL PROTECTED]
> Subject: Re: [PHP] How to fire off a unix command WITHOUT 
> waiting for it to return (I want to use &)
> 
> Try
> exec("/bin/scan & > /dev/null 2>/dev/null");
> 
> Daevid Vincent wrote:
> > How can I cause PHP to fire off a unix program and NOT wait 
> for a reply.
> > Basically I want to use the "&" love the unix provides, but 
> it seems that
> > exec, passthrough, system and even ` ` all wait for a 
> return despite my
> > putting something like exec("/bin/scan &"); or `/bin/scan &`
> > 
> > *sigh*
> > 
> > The sitch is that I'm scanning/pinging/nmap a HUGE amount 
> of IP addresses.
> > Perhaps 254 - 65000 or more individual iP addresses. We 
> have a multithreaded
> > scanner that we wrote in C that can to this quickly, but 
> it's still a wait.
> > It pulls from a db the ips to scan and sets their up/down 
> flags. My php
> > scheduler page queries to get the ones that are up. 
> > 
> > So as you see, I don't want to wait for a return code, I 
> know the status via
> > the db and how many rows are done/need to be done. 
> > 
> > Daevid Vincent.
> > http://daevid.com
> > 
> 
> 

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



  1   2   >