[PHP] LDAP compile problem.

2001-07-17 Thread Johan Vikerskog (ECS)

When i try to activate ldap on a UNIX system something goes wrong but i dont even know 
were to begin looking.

i use the "--with-ldap" when i compile but it doesnt give me any errors and yet it 
doesnt work.
Any suggestions?

On my PC it worked great.

//Johan


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] count number of email sent to us

2001-07-17 Thread Jack

Dear people,
I have an email link on my page like this
mailto:[EMAIL PROTECTED]";> Big George 
and I want to know how may people click on on this particular link to keep the record, 
may be insert this record into a table as well ( but don't erally have to) Is there 
any technique at all to achieve this? 
cheers
Jack
[EMAIL PROTECTED]
"Love your enemies, it will drive them nuts"



[PHP] Re: Force new page in browser and wait commands

2001-07-17 Thread elias

a simple example:

";
}
?>

test!


name:




In this example you won't see the comment in the start of the page unless
the user processes the form.

"Hugh Danaher" <[EMAIL PROTECTED]> wrote in message
002501c10f17$876cbf40$2afeb3d1@default">news:002501c10f17$876cbf40$2afeb3d1@default...
Help, I'm new to php, and to writing software in general.  Enough said on
that.  What I want to do, is to have my program wait for user input on a
 and once data is submitted, to have the browser (IE5) generate a new
page.  Right now, my program runs straight through input forms and appends
everything to the existing page.  I now accomplish this by running several
connected php programs, but want to do it in one program.  I've looked
throughout the php manual and website but have yet to find the right
commands.
Your help is greatly appreciated.
Hugh




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Command line args HELP!!!

2001-07-17 Thread Paul A. Procacci

Hey all,
I tried passing an argument to a php script that had a plus sign (+)
in one of the arguments.  Observe the following:


http://altavista.com/sites/search/web?q=task+management&pg=q&kl=XX

As it turns out the argument gets split into two seperate arguments, but
I would like to keep it as one argument.  Does anyone know how to
accomplish this.  I posted a bug report to bugs.php.net, and they
responded by telling me to read:
http://www.php.net/manual/en/language.variables.external.php

But still after searching that page for the information I was looking
for, nothing seemed to work.  Am I missing something.  Please let me
know.

Thanks,
Paul


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: Cannot copy a file to a dynamic folder

2001-07-17 Thread elias

Hi!

when you use the "\" character in a string you have to escape it by putting
"\\" instead of one!

> $default_dir = ("D:\www\Proj\$textfield2\");
would become:
$default_dir = "D:\\www\\Proj\\$textfield2\\";

do the same for the $filename variable.

"Vincent Chew" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I get a parse error every time and I've modified the scripts a bunch of
> times already.
>
> // Make new directory function
> $default_dir = ("D:\www\Proj\$textfield2\");
> if(file_exists($default_dir)) rmdir($default_dir);
> mkdir($default_dir, 0777);
>
> // Copy template.html to new directory
> $filename = D:Automator\auto_2\Template.html;
> copy($filename, ($default_dir) .overview.html);
>
> Can I not have these two scripts run together? The mkdir function alone
> works. Can someone tell me what I'm doing wrong?
>
> Thank you.
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] PHP based statistics/Graphs

2001-07-17 Thread eschmid+sic

On Tue, Jul 17, 2001 at 10:48:24PM -0700, Rasmus Lerdorf wrote:
> I like Vagrant.  See http://vagrant.sourceforge.net

I prefer R :) http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html

It is IMHO the best language for statistic.

-Egon

> On Wed, 18 Jul 2001, Chris Aitken wrote:
> 
> > Hi everyone..
> >
> > Just wondering if anyone can suggest any methods, or even pre-made packages
> > which can be manipulated to show various statistics, charts, graphs etc on
> > a whole range of things.
> >
> > What im looking to do is run a whole bunch of statistics pages for where I
> > work. Client stats, plan popularity, monthly income etc etc.
> >
> > Just doing some research and figured you guys are the best place to get
> > some info.
> >
> >
> >
> > Cheers
> >
> >
> > Chris
> >
> >
> >
> > --
> >  Chris Aitken - Administration/Database Designer - IDEAL Internet
> >   email: [EMAIL PROTECTED]  phone: +61 2 4628   fax: +61 2 4628 8890
> >   __-__
> >*** Big Brother ***
> > It just shows that the dull will rule the world. And we will be watching it.
> >
> >
> >
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 

-- 
-- 
All known books about PHP and related books: http://php.net/books.php 
Concert Band of the University of Hohenheim: http://www.concert-band.de/
First and second bestselling book in German: http://www.php-buch.de/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] displaying icons

2001-07-17 Thread Dave Freeman

On 17 Jul 01, at 16:30, Yassel Omar Izquierdo Souchay wrote:

> Put the same text inside php example
>  echo "" the next code

and if you want it to work reliable do is this way:

echo "";

and away you go...

CYA, Dave


---
Outback Queensland Internet - Longreach, Outback Queensland - Australia
http://www.outbackqld.net.au  mailto:[EMAIL PROTECTED]
---

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] PHP and XHTML

2001-07-17 Thread Zak Greant

Hi Daniel,

Set short_open_tag = Off in your php.ini file and the problem will go away.

--zak

Rose, Daniel wrote:
> Hi,
> I have looked through the history of the list, and I see that several
people
> have said that PHP fully supports XHTML. I have some problems using XHTML
> with PHP, namely parse errors, such as a parse error on the first line of
> every XHTML doc.
> 
[...]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] PHP code produces ocasional segfaults.

2001-07-17 Thread Santiago Romero


 Hi all...

 I'm new to PHP and I needed to implement some PHP functions on
 a php webmail. I readed the PHP MANUAL and I found a code that
 suits my needs in an example, but it produces segfaults.
 I added the following code:

 $ds=ldap_connect("ldap.server.com");
 if ($ds) 
 { 
   $r=ldap_bind($ds);
   $busca="[EMAIL PROTECTED]";
   $sr=ldap_search($ds,"dc=midomain,dc=com", $busca);  
   if( ldap_count_entries($ds,$sr) < 1 )
 SetCookie( "can_use_attachs", "n", time()+3600 );
   else
   {
 $info = ldap_get_entries($ds, $sr);
 if( $info[0]["canuseattachs"][0] == 'y' )
   SetCookie( "can_use_attachs", "y", time()+3600 );
 else
   SetCookie( "can_use_attachs", "n", time()+3600 ); 
   }
   ldap_close($ds);
 }

 When I reload THOUSANDS of times the above page (using
 autoreload) and I've found that sometimes the above code
 produces an Apache Crash. I get a "Document contained
 no data" and apache/logs/error_log says:

 [notice] child pid 1234 exit with Segmentation Fault
 (core dump on /usr/apache).

 I have lots of them on different times:

[Wed Jul  4 09:10:22 2001] [notice] child pid 29834 exit
 signal Segmentation fault (11)
[Fri Jul  6 13:05:32 2001] [notice] child pid 30124 exit
 signal Segmentation fault (11)

  I did a backtrace on the core file:

(gdb) bt
#0  0xc01f2740 in kill () from /usr/lib/libc.2
#1  0x1a15a0 in sig_coredump ()
#2  
#3  0xcda50 in read_next_token (tcm=0x40049b20, token=0x77ff1eb8,
phplval=0x77ff1d58) at token_cache.c:161
#4  0xb2f68 in phplex (phplval=0x77ff1d58) at main.c:488
#5  0xbb9d8 in phpparse () at /usr/lib/bison.simple:432
#6  0xb5974 in php3_parse (yyin=0x40113c98) at main.c:1564
#7  0xb5ed8 in apache_php3_module_main (r=0x400cd840, fd=26,
display_source_mode=0, preprocessed=0) at main.c:1929
#8  0xb18a4 in send_php3 ()
#9  0xb1970 in send_parsed_php3 ()
#10 0x197204 in ap_invoke_handler ()
#11 0x1ab36c in process_request_internal ()
#12 0x1ab3ec in ap_process_request ()
#13 0x1a2ff8 in child_main ()
#14 0x1a3254 in make_child ()
#15 0x1a35b8 in perform_idle_server_maintenance ()
#16 0x1a3b78 in standalone_main ()
#17 0x1a45c8 in main ()

 The line 161 of token_cache.c contains:

GLOBAL(tc)->count++;
   }
-->*token = &GLOBAL(tc)->tokens[GLOBAL(tc)->pos++];
return (*token)->token_type;
}

 
 I think something with my above code is wrong, because If I
 comment it using /* and */, then I don't get segfaults (never).
 Any idea of rewriting the above code so that it works would
 be very appreciated. To code the above I copied & pasted the
 PHP manual LDAP functions example, and that's why I'm asking
 directly here.

 Thanks a lot.

-- 
Santiago Romero
Departamento de Sistemas
[EMAIL PROTECTED]

Av. Primado Reig 189, entlo
46020 Valencia - Spain
Telf. (+34) 96 332 12 00
Fax. (+34) 96 332 12 01
http://www.servicom2000.com


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] PHP based statistics/Graphs

2001-07-17 Thread Rasmus Lerdorf

I like Vagrant.  See http://vagrant.sourceforge.net

-Rasmus

On Wed, 18 Jul 2001, Chris Aitken wrote:

> Hi everyone..
>
> Just wondering if anyone can suggest any methods, or even pre-made packages
> which can be manipulated to show various statistics, charts, graphs etc on
> a whole range of things.
>
> What im looking to do is run a whole bunch of statistics pages for where I
> work. Client stats, plan popularity, monthly income etc etc.
>
> Just doing some research and figured you guys are the best place to get
> some info.
>
>
>
> Cheers
>
>
> Chris
>
>
>
> --
>  Chris Aitken - Administration/Database Designer - IDEAL Internet
>   email: [EMAIL PROTECTED]  phone: +61 2 4628   fax: +61 2 4628 8890
>   __-__
>*** Big Brother ***
> It just shows that the dull will rule the world. And we will be watching it.
>
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] PHP based statistics/Graphs

2001-07-17 Thread Chris Aitken

Hi everyone..

Just wondering if anyone can suggest any methods, or even pre-made packages 
which can be manipulated to show various statistics, charts, graphs etc on 
a whole range of things.

What im looking to do is run a whole bunch of statistics pages for where I 
work. Client stats, plan popularity, monthly income etc etc.

Just doing some research and figured you guys are the best place to get 
some info.



Cheers


Chris



--
 Chris Aitken - Administration/Database Designer - IDEAL Internet
  email: [EMAIL PROTECTED]  phone: +61 2 4628   fax: +61 2 4628 8890
  __-__
   *** Big Brother ***
It just shows that the dull will rule the world. And we will be watching it.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] how to include a remote file and change relative links to non-relative

2001-07-17 Thread Aral Balkan

I've been working on Hans Anderson's Browser class and I've adapted it to do
what you're looking for. It's not complete but there should be a lot here
for you to go on. Again, I haven't had time to fine tune things at all so
it's a very rough hack right now. Hope it helps.

The dirty on how to use it:

get_url(array(
  "url"=>"$file",
  "req_mthd"=>'GET',
  "protocol"=>'HTTP/1.1',
  "robot_rules"=>FALSE
 )
);

  if ($file_array["errcode"] == 1) {
   $file_text = $file_array["content"];

  // convert relative links to absolute
  $file_text = $browser->translate($file_text, $file);

?>

class_browser.php:

class Browser {

 /*
Class Browser by Hans Anderson.
This code is released under the GPL license.
Modifications by Aral Balkan

  06.22.01 - Added two new methods:

 (1) $string = translate_links($string, $url);

  Translates all relative links in argument $string to
  absolute links using the full URL to the page being
  accessed in the $url argument. Returns the translated
  string.

 (2) $string = translate_images($string, $url);

  Translates all relative image links in argument $string to
  absolute links using the full URL to the page being
  accessed in the $url argument. Returns the translated
  string.

 Aral Balkan ([EMAIL PROTECTED])
 */

 function get_url($array) {

  /* defaults (there is no default for 'url' or 'content') */
  $robot_rules = TRUE; /* follow the robots.txt standard */
  $req_mthd = 'GET';
  $protocol = 'HTTP/1.0';
  $user_agent = 'PHP3 Browser';
  $time_out = 10;

  /* for each argument set in the array, overwrite default */
  while(list($k,$v) = each($array)) {
   $$k=$v;
  }

  /* set up the cookies.  If it exists, the straight variable
 will be written above ($$k=$v). */

  if(is_array($cookies)) {
   $cookies2send = '';
   while(list($k,$v) = each($cookies) ) {
$cookies2send .= "Cookie: $k=" . urlencode($v) . "\n";
   }
  }

   if(!isset($url))
  return array("content"=>' ',"headers"=>' ',"errcode"=>-1,"errmsg"=>'Fatal
Error: No URL defined');

$parsed_url = parse_url("$url");

  if($robot_rules) {

   $robots_url = $parsed_url["scheme"] . "://" . $parsed_url["host"];
   if($parsed_url["port"]) $robots_url .= ":" . $parsed_url["port"];
   $robots_url .= "/robots.txt";
   if(!$this->robot_rules($url,$robots_url,$user_agent))
 return array("content"=>' ',"headers"=>'
',"errcode"=>0,"errmsg"=>"Non-fatal Error: Robot Rules do not permit this
browser to access $url");

  }

   $req_mthd = strtoupper($req_mthd); // 2068 rfc says it's case
sensitive.

  $host = $parsed_url["host"];

  if(!$host || $host=='' || !isset($host))
  array("content"=>' ',"headers"=>' ',"errcode"=>-1,"errmsg"=>'Fatal Error:
No URL defined');

  $path = $parsed_url["path"];
  if(!$path || $path=='' || !isset($path))
  $path = "/";

  $query = $parsed_url["query"];
  if($query!='')
  $path = "$path?$query";

  if(!isset($parsed_url["port"])) {
   $port = 80;
  } else {
   $port = $parsed_url["port"];
  }

  $timeout = time() + $time_out;

  $fp = fsockopen("$host",$port,$errno,$errstring,$time_out);

 if(!$fp) {
  return array("content"=>' ',"headers"=>'
',"errcode"=>0,"errmsg"=>"Non-Fatal Error: Could not make connection to url
$url (not found in DNS or you are not connected to the Internet)");
 } else {

   set_socket_blocking($fp,1); // aral: set to 1 for it to work on
Windows & Unix

   $REQUEST = "$req_mthd $path $protocol\n";
   if(eregi("^HTTP\/1\.[1-9]",$protocol)) $REQUEST .= "Host: $host\n";
   $REQUEST .= "User-Agent: $user_agent\n";
  if($referer) {
   $REQUEST .= "Referer: $referer\n";
  }
   $REQUEST .= "Connection: close\n";

  if($cookies) {
   $REQUEST .= $cookies2send;
  }

  if($req_mthd=="POST") {
   $REQUEST .= "Content-length: " . (strlen($content)) . "\n";
   $REQUEST .= "Content-type: application/x-www-form-urlencoded\n";
   $REQUEST .= "\n$content\n";
  }
  fputs($fp,"$REQUEST\n"); // complete the request
#  print "$REQUEST\n";

  if($timeout' ',"headers"=>'
',"errcode"=>0,"errmsg"=>"Non-Fatal Error: Timed out while downloading
page");
  while (!feof($fp) && time()<$timeout) {
  $output = fgets($fp,255);

  $view_output .= $output;

if(!isset($header)) {
   if($output=="\n" || $output == "\r\n" || $output == "\n\l") {
  $header = $view_output;
 $view_output = '';
   }
}

  }


 }

fclose($fp);

if(time()>$timeout)
 return
array("content"=>"$content","headers"=>"$headers","errcode"=>0,"errmsg"=>"No
n-Fatal Error: Timed out while downloading page");

return
array("content"=>"$view_output","headers"=>"$header","errcode"=>1,"errmsg"=>
"Success");

} // end function get_url

/* * */

function get_headers($h) {
  $array = exp

RE: [PHP] Regular expressions

2001-07-17 Thread Jack Dempsey

Checkout www.php.net/strtr

-Original Message-
From: Philip Murray [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, July 18, 2001 1:31 AM
To: PHP General List
Subject: [PHP] Regular expressions

In Perl you can do this:

$foo =~ tr/012/mpf/;

Which is the same as:

$foo = str_replace("0", "m", $foo);
$foo = str_replace("1", "p", $foo);
$foo = str_replace("2", "f", $foo);

in PHP.

Is there a more elegant way of doing this in PHP? I tried preg_replace
but
it didn't seem to like my regexp.

Any ideas?

 -  -- -  -   -
Philip Murray
[EMAIL PROTECTED]
- -  -- -   -


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Regular expressions

2001-07-17 Thread Philip Murray

In Perl you can do this:

$foo =~ tr/012/mpf/;

Which is the same as:

$foo = str_replace("0", "m", $foo);
$foo = str_replace("1", "p", $foo);
$foo = str_replace("2", "f", $foo);

in PHP.

Is there a more elegant way of doing this in PHP? I tried preg_replace but
it didn't seem to like my regexp.

Any ideas?

 -  -- -  -   -
Philip Murray
[EMAIL PROTECTED]
- -  -- -   -


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] PHP and XHTML

2001-07-17 Thread Rose, Daniel

Hi,
I have looked through the history of the list, and I see that several people
have said that PHP fully supports XHTML. I have some problems using XHTML
with PHP, namely parse errors, such as a parse error on the first line of
every XHTML doc.


Version of PHP is 4.0.6, and it was compiled like so:
'./configure' '--with-apxs=/usr/local/apache/bin/apxs' '--with-xml'
'--with-gd=/usr' '--with-jpeg-dir=/usr/local' '--with-png-dir=/usr/local'
'--with-zlib' '--with-mysql' '--enable-track-vars' '--with-mcrypt'
(all from phpinfo())

Does anyone have any ideas?
Please CC replies as I am not subscribed to the list
Sincerely,

Daniel Rose


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] To overwrite or unregister session variables

2001-07-17 Thread Joseph Blythe

Hey,

Was just wondering if it was better practice to unregister session variables
before writing new values to them or if it was fine to just overwrite their
values?

Regards,

Joseph


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] MySQL Query.....

2001-07-17 Thread py_sympatico

Try,
"select '$TableItem'.list where id = 1";

py

- Original Message -
From: Deependra B. Tandukar <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, July 18, 2001 12:14 AM
Subject: [PHP] MySQL Query.


> Greetings !
>
> I have following tables in MySQL:
>
> TableItem
> idlist
> 1 Banana
> 2 Orange
> 3 Mango
>
> Other tables are:
> Banana, Orange, Mango
>
> Instead of selecting Table Banana directly I need to select it as "select
> $TableItem.list where id=1" or something like that for editing or deleting
> items in Table Banana . I tried to do like this but doesn't work. Does it
> work somehow?
>
> Looking forward to hearing from you.
>
> Warm Regards,
> DT
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] MySQL Query.....

2001-07-17 Thread Deependra B. Tandukar

Greetings !

I have following tables in MySQL:

TableItem
idlist
1 Banana
2 Orange
3 Mango

Other tables are:
Banana, Orange, Mango

Instead of selecting Table Banana directly I need to select it as "select
$TableItem.list where id=1" or something like that for editing or deleting
items in Table Banana . I tried to do like this but doesn't work. Does it
work somehow?

Looking forward to hearing from you.

Warm Regards,
DT



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] how to include a remote file and change relative links to non-relative

2001-07-17 Thread Brett

I am trying to create a page that will get a remote file and email it to me.  All 
works fine using several different methods (include,file,fread) only relative links 
for images and links get my server address instead of the actual address the images 
should be retrieved from.

Is there a way I can get the remote file and make all relative links for images and 
such point where they should?

Thanks,
bubba



Re: [PHP] gd lib question.

2001-07-17 Thread Rasmus Lerdorf

> Just a quick question for anyone that uses GD-Lib prior to the
> latest true-colo(u)r version (specifically v. 1.6.1) - if I try to
> load a jpeg that has more than 256 colours in it, will it succeed? I
> know the obvious answer is to try it and see...but I don't have it
> here on my machine, and I don't want to retrofit it just to test this
> one thing out!

Yes, it will work but it will dither it down to 256 colours.

-Rasmus


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] note to PHP developers

2001-07-17 Thread Michael Hall

No, they're two seperate things. In addition to being incredibly easy to
install and configure, Postfix can be made fairly secure and it has a better
(=more 'open') license of some kind. 

Mick

On Wed, 18 Jul 2001, Jason Murray wrote:
> > Me too. I've never had a problem with Postfix. It just 
> > dropped in in Sendmail's place and has worked wonderfully 
> > ever since. Great piece of software.
> 
> I was led to believe Postfix is what Qmail evolved into?
> 
> Jason
> (running Postfix from day 1, no problems at all with it...)
> 
> -- 
> Jason Murray
> [EMAIL PROTECTED]
> Web Developer, Melbourne IT
> "Work now, freak later!"
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
-- 
Michael Hall
mulga.com.au
[EMAIL PROTECTED]
ph/fax (+61 8) 8953 1442
ABN 94 885 174 814

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] gd lib question.

2001-07-17 Thread Dave Mariner

Hi,
Just a quick question for anyone that uses GD-Lib prior to the latest 
true-colo(u)r version (specifically v. 1.6.1) - if I try to load a jpeg that has more 
than 256 colours in it, will it succeed? I know the obvious answer is to try it and 
see...but I don't have it here on my machine, and I don't want to retrofit it just to 
test this one thing out!

Thanks in advance,

Dave Mariner.





[PHP] Re: Problem

2001-07-17 Thread tttk

header("location:name_page.asp");

"Rhony V." <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> In Asp i have this
> response.redirect "name_page.asp", it's used to go to another page
>
> what is the similar function in PhP?
>
> Regards
>
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] email counter

2001-07-17 Thread Jack

> Try to use javascript:
>
> 
> x = window.open("mailto:", "Site");
> 
>
> It's easy to combine it with PHP to count the send mails.
>

In order to do the mail counter using javascript above, how would that work?
What is "Site" for? and Does this script execute when people click on the
link to send mail or something?
Jack
[EMAIL PROTECTED]
"Love your enemies, it will drive them nuts"
- Original Message -
From: Jorg Krause <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, July 17, 2001 2:53 AM
Subject: RE: [PHP] email counter


> Hi,
>
> > Brian White [mailto:[EMAIL PROTECTED]] wrote on Tuesday, July 17,
2001
> 5:52 AM
> > To: Jack; [EMAIL PROTECTED]
> > Subject: Re: [PHP] email counter
> >
> >
> > How about changing link to
> >
> >  Big George 
> >
> > Where mymailer.php is something like
> >
> >  > /*
> > Do whatever it is you need to do with $email
> >   */
> >
> > header("Location: mailto:$email"; );
> >
> > ?>
> >
>
> Works, but changes the previous open window into a empty sheet
> and displays "mailto:[EMAIL PROTECTED]";, so the old page
> disappears (the user has to click the back button). I think this
> solution is not really good for common usage.
>
> Try to use javascript:
>
> 
> x = window.open("mailto:", "Site");
> 
>
> It's easy to combine it with PHP to count the send mails.
>
> Joerg
> www.php.comzept.de
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Re: Known bugs with HTTP upload on Windows NT?

2001-07-17 Thread Adam_Whitehead


Hi Elias-

Yes I have write access on all directories. It doesn't seem to matter which
directory it copies to either.. because it crashes before the
is_uploaded_file()
and moveuploadedfile() calls.

-Adam



   
 
"elias"
 
cc:  
 
  Subject: [PHP] Re: Known bugs with 
HTTP upload on Windows NT? 
07/17/2001 09:13   
 
PM 
 
   
 
   
 




Hmm...
do you have write access on that directory?
IUSR_xxx and IWAM_ users must be appropriate writes on that folder...

"Adam Whitehead" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi All-
>
> I'm having trouble with a simple script that allows HTTP upload. It's a
> direct copy
> of the code available on the PHP web site.
>
> The script works fine on a UNIX machine running PHP 4.0.6 and a Windows
98
> machine running 4.0.6.
>
> However when I test it on a Windows NT machine running PHP 4.0.6, as soon
> as
> the submit button is clicked it causes a page fault in php.exe.
>
> Is this a known issue? In php.ini, the temporary upload path is set to a
> correct
> location and no amount of tweaking this path makes any difference.
>
> The script looks like this:
>
>  if (is_uploaded_file($userfile)) {
>   move_uploaded_file($userfile,"H:\\www\\uploadtest.txt");
>   echo "Done.";
> }
> ?>
>
> 
>   
> Send this file: 
> 
> 
>
> Regards,
> Adam Whitehead
>



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]






-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] mysql_query problem (FINALLY FIXED !!!!!!!)

2001-07-17 Thread Brad Wright

Hi all (he says with a sheepish grin:),

To all of those who tried to help with this thread, I thank you from the
bottom of my heart

Unfortunatly , the problem was not one of syntax, but rather one of gross
stupidity on my behalf. The Field where I had been keeping the (encrypted)
passwords was set to 6 spaces, thus chopping off at least 1/2 of the
encrypted password. So when it was looking for "password('a')" (which is
 60671c896665c3fa  BTW), it was only seeing 60671c in the field.therefor
NO MATCH.
 What a stupid mistake, delaying me for 1 1/2 days. At least I know I'm not
as crazey as I thought i was going.
I guess the lesson here is to step back once in a while and try looking
'around the edges' of a wall. Its amazing what you may find :).


Once again, thanks to all those kind souls who gave up there own time to try
to help this ol' fool.

Cheers,
Brad


> From: "Christopher Allen" <[EMAIL PROTECTED]>
> Date: Tue, 17 Jul 2001 09:11:05 -0500
> To: "Brad Wright" <[EMAIL PROTECTED]>
> Subject: Re: [PHP] mysql_query problem (more suggestions)
> 
> not right because this works in a live system:
> 
> 
> 
> $query1 =" SELECT *  FROM zip_base WHERE '$zip1' >= zip && '$zip1' <=
> CONCAT(SUBSTRING(zip, '1', LENGTH(zip)-LENGTH(range)), range)"
> 
> CONCAT, SUBSTRING and LENGTH are all mysql functions and they work fine in
> this query.
> 
> 
> 
>> the problem is (as i understand it), the password function is a mySQL
>> function and not a PHP function, therefor it works in the context of a
>> mysql_query, but not as a PHP function (which your suggested code calls).
>> Unless i have actually defined a function 'password()',  calling 'echo
>> password('$password') will (...does, i just double checked) causes a Fatal
>> Error 'Undefined Function'.
>> Nice try tho :)
> 
> 


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] question

2001-07-17 Thread Jochen Kaechelin

> In Asp i have this
>  response.redirect "name_page.asp", it's used to go to another page
> 
> what is the similar function in PhP?

header("Location: http://www.your.domain/foo.php";);

-- 
phpArbeitsgruppe in Gruendung - Jochen Kaechelin
Stuttgarter Str.3, D-73033 Goeppingen
Tel. 07161-92 95 94, Fax 07161-92 95 98
http://www.php-arbeitsgruppe.de, mailto:[EMAIL PROTECTED]


Re: [PHP] md5 crypt question

2001-07-17 Thread Jeremy Hansen

On Tue, 17 Jul 2001, tc lewis wrote:

>
> On Tue, 17 Jul 2001, Jeremy Hansen wrote:
> > On Tue, 17 Jul 2001, tc lewis wrote:
> > > try:
> > > 
> > > 
> > >
> > > or:
> > > 
> > > 
> > >
> > > you should get output of 12 and 1 (not 2 and 0) if md5 is supported in
> > > crypt(), i think.
> >
> > Yeah, I'm getting 2 and 0.  Lame.  What's the answer to this.
>
> i'm not sure.  i don't see any related configure flags or php.ini
> settings.  it seems to work with standard redhat 7.1 linux (i'm assuming
> you're using some redhat-ish system, as i know you):

This is confusing.  I'm actually using rh6.2 on this particular install.
Older glibc have something to do with crypt() implimentations?

thanks
-jeremy

> [tcl@jobo tcl]$ cat nog.php
> #!/usr/bin/php
> 
> 
> 
> 
> 
> 
> 
> 
> [tcl@jobo tcl]$ ./nog.php
> X-Powered-By: PHP/4.0.4pl1
> Content-type: text/html
>
> 2
> 1
> te4c1aD5wKOnM
> $1$testsalt$W00xFyq3oO6fDqto9qMY00
> [tcl@jobo tcl]$
>
> any suggestions from the rest of the list?
>
> you could try using the mhash library stuff instead.  blah.
>
> -tcl.
>
>
>

-- 
salad.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] question

2001-07-17 Thread Alex Piaz

At 20:19 17/7/2001 -0500, Rhony V. wrote:
>In Asp i have this
>  response.redirect "name_page.asp", it's used to go to another page
>
>what is the similar function in PhP?

A good look at the manual would satisfy your needs

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

header("location:wheredoyouwanttogo.php");

That's it

Regards


Alex Piaz
Webmaster
Global Map Internet Marketing
http://www.globalmap.com
"Be cool or be cast out"



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] md5 crypt question

2001-07-17 Thread tc lewis


On Tue, 17 Jul 2001, Jeremy Hansen wrote:
> On Tue, 17 Jul 2001, tc lewis wrote:
> > try:
> > 
> > 
> >
> > or:
> > 
> > 
> >
> > you should get output of 12 and 1 (not 2 and 0) if md5 is supported in
> > crypt(), i think.
>
> Yeah, I'm getting 2 and 0.  Lame.  What's the answer to this.

i'm not sure.  i don't see any related configure flags or php.ini
settings.  it seems to work with standard redhat 7.1 linux (i'm assuming
you're using some redhat-ish system, as i know you):

[tcl@jobo tcl]$ cat nog.php
#!/usr/bin/php








[tcl@jobo tcl]$ ./nog.php
X-Powered-By: PHP/4.0.4pl1
Content-type: text/html

2
1
te4c1aD5wKOnM
$1$testsalt$W00xFyq3oO6fDqto9qMY00
[tcl@jobo tcl]$

any suggestions from the rest of the list?

you could try using the mhash library stuff instead.  blah.

-tcl.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Problem

2001-07-17 Thread Rhony V.

In Asp i have this
response.redirect "name_page.asp", it's used to go to another page

what is the similar function in PhP?

Regards



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] question

2001-07-17 Thread Rhony V.

In Asp i have this
 response.redirect "name_page.asp", it's used to go to another page

what is the similar function in PhP?

Regards



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] passing variables from forms to the same page repetatively

2001-07-17 Thread Dave Freeman

On 17 Jul 01, at 0:11, Tim Olsen wrote:

> So far, I can only use variables on the next page (form) that is written
> out. After that those variables have no value.  Is there some way to submit 

Investigate using  form tages - very useful for 
passing around additional args between pages/forms.

CYA, Dave


---
Outback Queensland Internet - Longreach, Outback Queensland - Australia
http://www.outbackqld.net.au  mailto:[EMAIL PROTECTED]
---

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] method=post destroys PHPSESSID??

2001-07-17 Thread Dan Harrington

Hello all,

I'm having a heck of a time with a file uploader
page.  When I set method=post on the file uploader
form, the PHP session is somehow corrupted
during the upload, and any links made in the
in the resulting page (photoupload.php) don't
pass along the session even though they
have the exact same PHPSESSID value.

==
//upload request page


.
.
.
[snip]


==

The session and variables seem fine _IN_ photoupload.php,
but when I try to link to another page from the
photoupload.php page, it is broken.

But when I right-click on the links, copy the link
shortcut complete with PHPSESSID,
e.g.
(http://foo.bar.com/asdfsad.php?PHPSESSID=!@#$!@#$!@#$!@#$!@#$@!#$)

and then I take and paste that into the location: field in
a newly opened web browser, the session works and I
can continue to use it.
But when I try to click on the link inside of the photoupload.php,
the session dies and doesn't show any of the PHP session variables
even though I've checked and they exist and have values in the
session files on the hard drive on the server.

One more weird anomaly, is that when I change the method=post
to method=get in the html upload request page, I don't have
these problems with the session.  (I just have problems with the
file upload because it requires method=post).

Anyone have an idea to whats going on here?

Thanks

Dan


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] a simple question

2001-07-17 Thread Rasmus Lerdorf

$variable = << Hi,
>
> Can anyone tell me please what is the equivelant of this statement from
> perl, in PHP?
>
> $variable = qq~a value with any "quotes" which doesnt need \'\'s~;
>
> i use it to get away with all the s\lashes behind quotes. can anyone tell me
> how to do that in php?
>
> Regards
> Hamed
>
>
>
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] note to PHP developers

2001-07-17 Thread Jason Murray

> Me too. I've never had a problem with Postfix. It just 
> dropped in in Sendmail's place and has worked wonderfully 
> ever since. Great piece of software.

I was led to believe Postfix is what Qmail evolved into?

Jason
(running Postfix from day 1, no problems at all with it...)

-- 
Jason Murray
[EMAIL PROTECTED]
Web Developer, Melbourne IT
"Work now, freak later!"

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] passing variables from forms to the same page repetatively

2001-07-17 Thread Michael Hall

What about registering some session variables? Sessions use cookies and/or URLs
to propagate info across multiple pages. Not really secure, though, but they
are easy to use.

Mick


On Wed, 18 Jul 2001, Tim Olsen wrote:
> Yeah, I had thought about using hidden inputs, but hidden inputs are not 
> really hidden. They still exist on the HTML page, and although not visible 
> in the browser, are visible in the code. This may not be cool if you have 
> sensitive information that is passed, also if you have a lot of variables to 
> pass, thats just a lot of hidden inputs to pass.
> Is there no other way to accomplish this? No built in function? I guess it 
> makes sense that there is not, b/c the form submits the form and only the 
> form variables. Thanks.
> -Tim
> 
> 
> Original Message Follows
> From: David Robley <[EMAIL PROTECTED]>
> Reply-To: [EMAIL PROTECTED]
> To: "Tim Olsen" <[EMAIL PROTECTED]>, [EMAIL PROTECTED]
> Subject: Re: [PHP] passing variables from forms to the same page 
> repetatively
> Date: Tue, 17 Jul 2001 16:13:41 +0930
> 
> On Tue, 17 Jul 2001 15:41, Tim Olsen wrote:
>  > People,
>  > I have 4 forms in four seperate html pages included directly (no links
>  > to includes) in the same .php file, i have it so all the form actions
>  > is php.self, so when each form is submitted it goes on to display the
>  > next form in line, using if and else statements, of course. I want to
>  > be able to use variables created by the first form in the html part of
>  > the last form. What is the best way to do this?
>  >
>  > So far, I can only use variables on the next page (form) that is
>  > written out. After that those variables have no value.  Is there some
>  > way to submit all variables present and assigned with the submission of
>  > each form?  If I make the forms a seperate include file, instead of
>  > having them in-line, how does this change the ways variables are passed
>  > or submitted by each form? Thanks, - Tim
>  > _
> 
> 
> If I understand what you are saying: those variables don't exist until
> you SUBMIT the form. You can demonstrate this by looping through and
> displaying your POST or GET vars at the beginning of the form and see
> what happens when you first open the page, and when it calls itself.
> 
> And re-reading, I think what you may want is hidden fields. You want part
> one to call part 2, and retain values from part 1, etc? Echo the values
> into hidden fields in each step of the process.
> 
> 
> 
> --
> David Robley  Techno-JoaT, Web Maintainer, Mail List Admin, etc
> CENTRE FOR INJURY STUDIES  Flinders University, SOUTH AUSTRALIA
> 
> I always lie. In fact, I'm lying to you right now!
> 
> _
> Get your FREE download of MSN Explorer at http://explorer.msn.com
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
-- 
Michael Hall
mulga.com.au
[EMAIL PROTECTED]
ph/fax (+61 8) 8953 1442
ABN 94 885 174 814

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] note to PHP developers

2001-07-17 Thread Michael Hall


Me too. I've never had a problem with Postfix. It just dropped in in Sendmail's
place and has worked wonderfully ever since. Great piece of software.

Mick

On Wed, 18 Jul 2001, Christopher Allen wrote:
> Also, postfix works fine for me...
> 
> 
> > On a side note, qmail has a wrapper that pretends to be sendmail. You can
> > overwrite the /bin/mail with it and it will behave and accept mail just
> like
> > sendmail, but send it through qmail-smtp.
> >
> > > - changed php.ini path -> qmail path
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: a simple question

2001-07-17 Thread Philip Hallstrom

you can't.  at least the last time I wanted to you couldn't.  I think
Rasmus said it would require a lot of work in the parser...

If I'm wrong, I'll be very happy.

On Wed, 18 Jul 2001, Hamed wrote:

> Hi,
>
> Can anyone tell me please what is the equivelant of this statement from
> perl, in PHP?
>
> $variable = qq~a value with any "quotes" which doesnt need \'\'s~;
>
> i use it to get away with all the s\lashes behind quotes. can anyone tell me
> how to do that in php?
>
> Regards
> Hamed
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] md5 crypt question

2001-07-17 Thread Jeremy Hansen

On Tue, 17 Jul 2001, tc lewis wrote:

>
> try:
> 
> 
>
> or:
> 
> 
>
> you should get output of 12 and 1 (not 2 and 0) if md5 is supported in
> crypt(), i think.

Yeah, I'm getting 2 and 0.  Lame.  What's the answer to this.

-jeremy

> you compiled php on the system it's running on?  if you used a binary rpm
> or something, and the system it was compiled on didn't support md5, then
> it won't work.
>
> -tcl.
>
>
> On Tue, 17 Jul 2001, Jeremy Hansen wrote:
>
> >
> > Well, I'm assuming, perhaps incorrectly that the perl modules I used
> > derived its md5 capabilities from the system.  I did see all the comments
> > on the crypt() page and basically copied each one.  When passing a md5
> > looking salt, crypt() doesn't seem to do anything special with it and my
> > salt remains the same, first two character are taken like regular des.
> >
> > How would I go about testing the CRYPT_SALT_LENGTH and CRYPT_MD5
> > constants.
> >
> > Thanks
> > -jeremy
> >
> > On Tue, 17 Jul 2001, tc lewis wrote:
> >
> > >
> > > not sure if you've gotten any help on this yet.  perhaps test the
> > > CRYPT_SALT_LENGTH and CRYPT_MD5 constants to make sure that your system
> > > and compiled php support md5 via crypt().  also, what salts did you try?
> > > note the comments at the bottom of
> > > http://php.net/manual/en/function.crypt.php about double-quoting $1$ and
> > > how it may be interpreted and how to escape the $ characters.  also, i'm
> > > not sure if you need a $ character at the end of the salt string like in
> > > some of the examples on those comments or not.  unfortunately, i don't
> > > have a system with php running right now to test.
> > >
> > > you may also want to investigate http://php.net/manual/en/ref.mhash.php
> > > depending on what kind of functionality you need.  my guess is that
> > > crypt() would be suitable for you if it worked properly.
> > >
> > > -tcl.
> > >
> > >
> > > On Tue, 17 Jul 2001, Jeremy Hansen wrote:
> > >
> > > >
> > > > I'd like to use php to do what I'm able to do in perl.
> > > >
> > > > use String::Random;
> > > > use Crypt::PasswdMD5;
> > > >
> > > > $foo = new String::Random;
> > > >
> > > > $rand = $foo->randpattern("ss");
> > > >
> > > > print "Type in your password: ";
> > > >
> > > > $password = ;
> > > >
> > > > $hash = unix_md5_crypt($password,$rand);
> > > >
> > > > $salt = substr($hash,3,2);
> > > >
> > > > print "SUBSTR: $salt\n";
> > > > print "HASH: $hash\n";
> > > > print "SALT: $rand\n";
> > > >
> > > > print "Type in your password: ";
> > > > $password_verify = ;
> > > >
> > > > $hash_verify = unix_md5_crypt($password_verify,$salt);
> > > >
> > > > if ($hash eq $hash_verify) {
> > > > print "Good to go!\n";
> > > > print "HASH BEFORE: $hash\n";
> > > > print "HASH AFTER: $hash_verify\n";
> > > > } else {
> > > > print "You fuckered it up!\n";
> > > > print "HASH BEFORE: $hash\n";
> > > > print "HASH AFTER: $hash_verify\n";
> > > > }
> > > >
> > > > srv1:~$ ./crypt.pl
> > > > Type in your password: password
> > > > SUBSTR: Kd
> > > > HASH: $1$Kd$T9I3jUnJvGy0Ekfg2VobM0
> > > > SALT: Kd
> > > > Type in your password: password
> > > > Good to go!
> > > > HASH BEFORE: $1$Kd$T9I3jUnJvGy0Ekfg2VobM0
> > > > HASH AFTER: $1$Kd$T9I3jUnJvGy0Ekfg2VobM0
> > > >
> > > > I've looked at crypt() in php and it claims that if you pass it a salt
> > > > that resembles $1$ format, it should generate an md5 type hash, but this
> > > > doesn't seem to be the case for me.  The crypt only looks at the first two
> > > > characters of the salt, no matter what, so my salt never changes because
> > > > it just seems $1.
> > > >
> > > > Thanks for explaining what I'm doing wrong.
> > > >
> > > > -jeremy
> > > >
> > > > --
> > > > salad.
> > > >
> > > >
> > > > --
> > > > PHP General Mailing List (http://www.php.net/)
> > > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > > To contact the list administrators, e-mail: [EMAIL PROTECTED]
> > > >
> > > >
> > >
> > >
> >
> > --
> > salad.
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]
> >
> >
>
>

-- 
salad.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] a simple question

2001-07-17 Thread Hamed

Hi,

Can anyone tell me please what is the equivelant of this statement from
perl, in PHP?

$variable = qq~a value with any "quotes" which doesnt need \'\'s~;

i use it to get away with all the s\lashes behind quotes. can anyone tell me
how to do that in php?

Regards
Hamed




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] md5 crypt question

2001-07-17 Thread Jeremy Hansen

On Tue, 17 Jul 2001, tc lewis wrote:

>
> try:
> 
> 
>
> or:
> 
> 
>
> you should get output of 12 and 1 (not 2 and 0) if md5 is supported in
> crypt(), i think.
>
> you compiled php on the system it's running on?  if you used a binary rpm
> or something, and the system it was compiled on didn't support md5, then
> it won't work.

This I built from source.  Hmm, if it uses system crpyt() then would using
mcrypt libs help with this?

I'll try the above.

-jeremy

> -tcl.
>
>
> On Tue, 17 Jul 2001, Jeremy Hansen wrote:
>
> >
> > Well, I'm assuming, perhaps incorrectly that the perl modules I used
> > derived its md5 capabilities from the system.  I did see all the comments
> > on the crypt() page and basically copied each one.  When passing a md5
> > looking salt, crypt() doesn't seem to do anything special with it and my
> > salt remains the same, first two character are taken like regular des.
> >
> > How would I go about testing the CRYPT_SALT_LENGTH and CRYPT_MD5
> > constants.
> >
> > Thanks
> > -jeremy
> >
> > On Tue, 17 Jul 2001, tc lewis wrote:
> >
> > >
> > > not sure if you've gotten any help on this yet.  perhaps test the
> > > CRYPT_SALT_LENGTH and CRYPT_MD5 constants to make sure that your system
> > > and compiled php support md5 via crypt().  also, what salts did you try?
> > > note the comments at the bottom of
> > > http://php.net/manual/en/function.crypt.php about double-quoting $1$ and
> > > how it may be interpreted and how to escape the $ characters.  also, i'm
> > > not sure if you need a $ character at the end of the salt string like in
> > > some of the examples on those comments or not.  unfortunately, i don't
> > > have a system with php running right now to test.
> > >
> > > you may also want to investigate http://php.net/manual/en/ref.mhash.php
> > > depending on what kind of functionality you need.  my guess is that
> > > crypt() would be suitable for you if it worked properly.
> > >
> > > -tcl.
> > >
> > >
> > > On Tue, 17 Jul 2001, Jeremy Hansen wrote:
> > >
> > > >
> > > > I'd like to use php to do what I'm able to do in perl.
> > > >
> > > > use String::Random;
> > > > use Crypt::PasswdMD5;
> > > >
> > > > $foo = new String::Random;
> > > >
> > > > $rand = $foo->randpattern("ss");
> > > >
> > > > print "Type in your password: ";
> > > >
> > > > $password = ;
> > > >
> > > > $hash = unix_md5_crypt($password,$rand);
> > > >
> > > > $salt = substr($hash,3,2);
> > > >
> > > > print "SUBSTR: $salt\n";
> > > > print "HASH: $hash\n";
> > > > print "SALT: $rand\n";
> > > >
> > > > print "Type in your password: ";
> > > > $password_verify = ;
> > > >
> > > > $hash_verify = unix_md5_crypt($password_verify,$salt);
> > > >
> > > > if ($hash eq $hash_verify) {
> > > > print "Good to go!\n";
> > > > print "HASH BEFORE: $hash\n";
> > > > print "HASH AFTER: $hash_verify\n";
> > > > } else {
> > > > print "You fuckered it up!\n";
> > > > print "HASH BEFORE: $hash\n";
> > > > print "HASH AFTER: $hash_verify\n";
> > > > }
> > > >
> > > > srv1:~$ ./crypt.pl
> > > > Type in your password: password
> > > > SUBSTR: Kd
> > > > HASH: $1$Kd$T9I3jUnJvGy0Ekfg2VobM0
> > > > SALT: Kd
> > > > Type in your password: password
> > > > Good to go!
> > > > HASH BEFORE: $1$Kd$T9I3jUnJvGy0Ekfg2VobM0
> > > > HASH AFTER: $1$Kd$T9I3jUnJvGy0Ekfg2VobM0
> > > >
> > > > I've looked at crypt() in php and it claims that if you pass it a salt
> > > > that resembles $1$ format, it should generate an md5 type hash, but this
> > > > doesn't seem to be the case for me.  The crypt only looks at the first two
> > > > characters of the salt, no matter what, so my salt never changes because
> > > > it just seems $1.
> > > >
> > > > Thanks for explaining what I'm doing wrong.
> > > >
> > > > -jeremy
> > > >
> > > > --
> > > > salad.
> > > >
> > > >
> > > > --
> > > > PHP General Mailing List (http://www.php.net/)
> > > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > > To contact the list administrators, e-mail: [EMAIL PROTECTED]
> > > >
> > > >
> > >
> > >
> >
> > --
> > salad.
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]
> >
> >
>
>

-- 
salad.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] md5 crypt question

2001-07-17 Thread tc lewis


try:



or:



you should get output of 12 and 1 (not 2 and 0) if md5 is supported in
crypt(), i think.

you compiled php on the system it's running on?  if you used a binary rpm
or something, and the system it was compiled on didn't support md5, then
it won't work.

-tcl.


On Tue, 17 Jul 2001, Jeremy Hansen wrote:

>
> Well, I'm assuming, perhaps incorrectly that the perl modules I used
> derived its md5 capabilities from the system.  I did see all the comments
> on the crypt() page and basically copied each one.  When passing a md5
> looking salt, crypt() doesn't seem to do anything special with it and my
> salt remains the same, first two character are taken like regular des.
>
> How would I go about testing the CRYPT_SALT_LENGTH and CRYPT_MD5
> constants.
>
> Thanks
> -jeremy
>
> On Tue, 17 Jul 2001, tc lewis wrote:
>
> >
> > not sure if you've gotten any help on this yet.  perhaps test the
> > CRYPT_SALT_LENGTH and CRYPT_MD5 constants to make sure that your system
> > and compiled php support md5 via crypt().  also, what salts did you try?
> > note the comments at the bottom of
> > http://php.net/manual/en/function.crypt.php about double-quoting $1$ and
> > how it may be interpreted and how to escape the $ characters.  also, i'm
> > not sure if you need a $ character at the end of the salt string like in
> > some of the examples on those comments or not.  unfortunately, i don't
> > have a system with php running right now to test.
> >
> > you may also want to investigate http://php.net/manual/en/ref.mhash.php
> > depending on what kind of functionality you need.  my guess is that
> > crypt() would be suitable for you if it worked properly.
> >
> > -tcl.
> >
> >
> > On Tue, 17 Jul 2001, Jeremy Hansen wrote:
> >
> > >
> > > I'd like to use php to do what I'm able to do in perl.
> > >
> > > use String::Random;
> > > use Crypt::PasswdMD5;
> > >
> > > $foo = new String::Random;
> > >
> > > $rand = $foo->randpattern("ss");
> > >
> > > print "Type in your password: ";
> > >
> > > $password = ;
> > >
> > > $hash = unix_md5_crypt($password,$rand);
> > >
> > > $salt = substr($hash,3,2);
> > >
> > > print "SUBSTR: $salt\n";
> > > print "HASH: $hash\n";
> > > print "SALT: $rand\n";
> > >
> > > print "Type in your password: ";
> > > $password_verify = ;
> > >
> > > $hash_verify = unix_md5_crypt($password_verify,$salt);
> > >
> > > if ($hash eq $hash_verify) {
> > > print "Good to go!\n";
> > > print "HASH BEFORE: $hash\n";
> > > print "HASH AFTER: $hash_verify\n";
> > > } else {
> > > print "You fuckered it up!\n";
> > > print "HASH BEFORE: $hash\n";
> > > print "HASH AFTER: $hash_verify\n";
> > > }
> > >
> > > srv1:~$ ./crypt.pl
> > > Type in your password: password
> > > SUBSTR: Kd
> > > HASH: $1$Kd$T9I3jUnJvGy0Ekfg2VobM0
> > > SALT: Kd
> > > Type in your password: password
> > > Good to go!
> > > HASH BEFORE: $1$Kd$T9I3jUnJvGy0Ekfg2VobM0
> > > HASH AFTER: $1$Kd$T9I3jUnJvGy0Ekfg2VobM0
> > >
> > > I've looked at crypt() in php and it claims that if you pass it a salt
> > > that resembles $1$ format, it should generate an md5 type hash, but this
> > > doesn't seem to be the case for me.  The crypt only looks at the first two
> > > characters of the salt, no matter what, so my salt never changes because
> > > it just seems $1.
> > >
> > > Thanks for explaining what I'm doing wrong.
> > >
> > > -jeremy
> > >
> > > --
> > > salad.
> > >
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > To contact the list administrators, e-mail: [EMAIL PROTECTED]
> > >
> > >
> >
> >
>
> --
> salad.
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] md5 crypt question

2001-07-17 Thread Jeremy Hansen


Well, I'm assuming, perhaps incorrectly that the perl modules I used
derived its md5 capabilities from the system.  I did see all the comments
on the crypt() page and basically copied each one.  When passing a md5
looking salt, crypt() doesn't seem to do anything special with it and my
salt remains the same, first two character are taken like regular des.

How would I go about testing the CRYPT_SALT_LENGTH and CRYPT_MD5
constants.

Thanks
-jeremy

On Tue, 17 Jul 2001, tc lewis wrote:

>
> not sure if you've gotten any help on this yet.  perhaps test the
> CRYPT_SALT_LENGTH and CRYPT_MD5 constants to make sure that your system
> and compiled php support md5 via crypt().  also, what salts did you try?
> note the comments at the bottom of
> http://php.net/manual/en/function.crypt.php about double-quoting $1$ and
> how it may be interpreted and how to escape the $ characters.  also, i'm
> not sure if you need a $ character at the end of the salt string like in
> some of the examples on those comments or not.  unfortunately, i don't
> have a system with php running right now to test.
>
> you may also want to investigate http://php.net/manual/en/ref.mhash.php
> depending on what kind of functionality you need.  my guess is that
> crypt() would be suitable for you if it worked properly.
>
> -tcl.
>
>
> On Tue, 17 Jul 2001, Jeremy Hansen wrote:
>
> >
> > I'd like to use php to do what I'm able to do in perl.
> >
> > use String::Random;
> > use Crypt::PasswdMD5;
> >
> > $foo = new String::Random;
> >
> > $rand = $foo->randpattern("ss");
> >
> > print "Type in your password: ";
> >
> > $password = ;
> >
> > $hash = unix_md5_crypt($password,$rand);
> >
> > $salt = substr($hash,3,2);
> >
> > print "SUBSTR: $salt\n";
> > print "HASH: $hash\n";
> > print "SALT: $rand\n";
> >
> > print "Type in your password: ";
> > $password_verify = ;
> >
> > $hash_verify = unix_md5_crypt($password_verify,$salt);
> >
> > if ($hash eq $hash_verify) {
> > print "Good to go!\n";
> > print "HASH BEFORE: $hash\n";
> > print "HASH AFTER: $hash_verify\n";
> > } else {
> > print "You fuckered it up!\n";
> > print "HASH BEFORE: $hash\n";
> > print "HASH AFTER: $hash_verify\n";
> > }
> >
> > srv1:~$ ./crypt.pl
> > Type in your password: password
> > SUBSTR: Kd
> > HASH: $1$Kd$T9I3jUnJvGy0Ekfg2VobM0
> > SALT: Kd
> > Type in your password: password
> > Good to go!
> > HASH BEFORE: $1$Kd$T9I3jUnJvGy0Ekfg2VobM0
> > HASH AFTER: $1$Kd$T9I3jUnJvGy0Ekfg2VobM0
> >
> > I've looked at crypt() in php and it claims that if you pass it a salt
> > that resembles $1$ format, it should generate an md5 type hash, but this
> > doesn't seem to be the case for me.  The crypt only looks at the first two
> > characters of the salt, no matter what, so my salt never changes because
> > it just seems $1.
> >
> > Thanks for explaining what I'm doing wrong.
> >
> > -jeremy
> >
> > --
> > salad.
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]
> >
> >
>
>

-- 
salad.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] md5 crypt question

2001-07-17 Thread tc lewis


not sure if you've gotten any help on this yet.  perhaps test the
CRYPT_SALT_LENGTH and CRYPT_MD5 constants to make sure that your system
and compiled php support md5 via crypt().  also, what salts did you try?
note the comments at the bottom of
http://php.net/manual/en/function.crypt.php about double-quoting $1$ and
how it may be interpreted and how to escape the $ characters.  also, i'm
not sure if you need a $ character at the end of the salt string like in
some of the examples on those comments or not.  unfortunately, i don't
have a system with php running right now to test.

you may also want to investigate http://php.net/manual/en/ref.mhash.php
depending on what kind of functionality you need.  my guess is that
crypt() would be suitable for you if it worked properly.

-tcl.


On Tue, 17 Jul 2001, Jeremy Hansen wrote:

>
> I'd like to use php to do what I'm able to do in perl.
>
> use String::Random;
> use Crypt::PasswdMD5;
>
> $foo = new String::Random;
>
> $rand = $foo->randpattern("ss");
>
> print "Type in your password: ";
>
> $password = ;
>
> $hash = unix_md5_crypt($password,$rand);
>
> $salt = substr($hash,3,2);
>
> print "SUBSTR: $salt\n";
> print "HASH: $hash\n";
> print "SALT: $rand\n";
>
> print "Type in your password: ";
> $password_verify = ;
>
> $hash_verify = unix_md5_crypt($password_verify,$salt);
>
> if ($hash eq $hash_verify) {
> print "Good to go!\n";
> print "HASH BEFORE: $hash\n";
> print "HASH AFTER: $hash_verify\n";
> } else {
> print "You fuckered it up!\n";
> print "HASH BEFORE: $hash\n";
> print "HASH AFTER: $hash_verify\n";
> }
>
> srv1:~$ ./crypt.pl
> Type in your password: password
> SUBSTR: Kd
> HASH: $1$Kd$T9I3jUnJvGy0Ekfg2VobM0
> SALT: Kd
> Type in your password: password
> Good to go!
> HASH BEFORE: $1$Kd$T9I3jUnJvGy0Ekfg2VobM0
> HASH AFTER: $1$Kd$T9I3jUnJvGy0Ekfg2VobM0
>
> I've looked at crypt() in php and it claims that if you pass it a salt
> that resembles $1$ format, it should generate an md5 type hash, but this
> doesn't seem to be the case for me.  The crypt only looks at the first two
> characters of the salt, no matter what, so my salt never changes because
> it just seems $1.
>
> Thanks for explaining what I'm doing wrong.
>
> -jeremy
>
> --
> salad.
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] learning PHP from scratch

2001-07-17 Thread Matthew Garman

On Tue, Jul 17, 2001 at 04:55:11PM +1000, Jason Rennie wrote:
> > > This approach worked pretty well with previous people i teached 
> > > PHP, but they already had some sort of programming background. 
> > > This guy hasn't. I find that he has some difficulties picking 
> > > it up. And I have some difficulties to further help him. 
> > 
> > Is he having problems with PHP, or database interaction with PHP?
> 
> It sounds like he might be having problems with the basic programming
> concepts.
> 
> Are you teaching him and then getting the guy to actaully try some for
> himself ?
> 
> Start with something really basic, (hello world) and get him to do a
> couple of dynamic things that dont use the database, then introduce the db
> slowly. 

After the "hello world," I would have him print it 10 times.  First let
him hardcode 10 echoes, then show him how a for loop works.  Since the
concept is almost the same, once he understands the for loop, have him do
it on his own with a while loop.

To expand on that, you might have each iteration of the loop print in
different formatting, e.g. , , .

Then have him build an array of strings, and use a for loop to create an
(un)ordered list from the array .  Then have him build a 2D array
and create a table from it.

The next step might be to have him create an HTML form that accepts a
number from a user in a text box.  The user enters a number, and
submitting calls a PHP script that prints "hello world" as many times as
the input specified.

Just some suggestions, hope they help,
Matt

-- 
Matt Garman, [EMAIL PROTECTED]
"I'll tip my hat to the new constitution, Take a bow for the new revolution
 Smile and grin at the change all around, Pick up my guitar and play
 Just like yesterday, Then I'll get on my knees and pray..."
-- Pete Townshend/The Who, "Won't Get Fooled Again"


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] How make the time

2001-07-17 Thread David Tandberg-Johansen

Hello!

I am trying to make an online booking script for a client (restaurant), and
I am using MySQL to store the booking information
The restaurant have openings hour from 11:00 -> 01:00, but do only take
reservation between 11:00->22:30.
The client wants to get a report written out over each hour like this:

11:002 Customers
11:1532 Customers
11:3012 Customers


22:3014 Customers

In the MySQL table I have set up the time field as 'time' with 00:00:00 as
default.

Everything is ok, but I am stuck on how to make this report. The customer
have set an interval of 15 mnutes between possible time to book, so I have
to make an 'SELECT'-query based on when the restaurant opens to the time of
the last possible booking time. But how do I make the timeset (11:00:00 and
up to 22:30:00)

My far out example:
interval = 15;
while (time<=endtime){
time=starttime
DBCONNECTION
Select * from booking wher tine_field='time'
time = time+interval
}

Do anyone have any tips on how I can solve this

David



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] libxslt ?

2001-07-17 Thread Regenfeld

hi,

just a few questions ;-)

will there be a libxslt-extension available in the near future? 
I heard it will be featured in v.4.1? 
Or are there any alternatives to sablotron? 

thanx,
regenfeld


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Force new page in browser and wait commands

2001-07-17 Thread Hugh Danaher

Help, I'm new to php, and to writing software in general.  Enough said on that.  What 
I want to do, is to have my program wait for user input on a  and once data is 
submitted, to have the browser (IE5) generate a new page.  Right now, my program runs 
straight through input forms and appends everything to the existing page.  I now 
accomplish this by running several connected php programs, but want to do it in one 
program.  I've looked throughout the php manual and website but have yet to find the 
right commands.
Your help is greatly appreciated.
Hugh



[PHP] Setting title with header ?

2001-07-17 Thread Beric Slobodan

I have this code:

$size = filesize("$file"); 
$fh = fopen("$file", "r"); 
$name = basename($file);

header("Content-Type: application/octet-stream"); 
header("Content-Length: $size"); 
header("Content-Disposition:$attachment filename=$name"); 
header("Content-Transfer-Encoding: binary"); 

fpassthru($fh);

How can I set title of window ?  It works only if I set it (with 
echo"") before fpassthru, but then if file is image or text, it 
displays unformatted data

TIA
Beric Slobodan

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Time that db´s connection is keep alive

2001-07-17 Thread Christopher Ostmo

Marcos Mathias pressed the little lettered thingies in this order...

> People!
> 
> Someone can tell me if PHP 4 closes their connections to the DB
> automatically at the end of the script?
> Or I need to use the mssql_close function each time my work is done?
> 
> Best Regards!
> 

From:
http://www.php.net/manual/en/function.mysql-connect.php
The link to the server will be closed as soon as the execution of the script ends, 
unless it's closed earlier by explicitly calling {HYPERLINK 
"function.mysql-close.php"}mysql_close().

From:
http://www.php.net/manual/en/function.mysql-pconnect.php
Second, the connection to the SQL server will not be closed when the execution 
of the script ends. Instead, the link will remain open for future use 
({HYPERLINK "function.mysql-close.php"}mysql_close() will not close links established 
by mysql_pconnect()).

So... if you use mysql_connect(), your connections are automatically closed at 
script completion with or without mysql_close(). If you use mysql_pconnect(), 
your connections stay open whether you use mysql_close() or not.

Your MySQL server will close unused connections after they have been unused 
for a set period of time.  Connections that are left open will be re-used if a 
request is made, so it's not like leaving a process hanging out in space.

Leaving the connection open reduces the processing overhead that is necessary 
to open and destroy a connection on every request, so it is generally considered 
worth the extra memory required to keep connections open that are not being 
used, but probably will be used shortly.

Only the person/people familiar with your server and/or web site can determine 
which is best: close connections at the cost of overhead for each connection or 
leave them open at the cost of requiring extra operating memory and system 
resources.

Decisions, decisions...

Christopher Ostmo
a.k.a. [EMAIL PROTECTED]
AppIdeas.com
Innovative Application Ideas
Meeting cutting edge dynamic
web site needs since the 
dawn of Internet time (1995)

Business Applications:
http://www.AppIdeas.com/

Open Source Applications:
http://open.AppIdeas.com/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Cannot copy a file to a dynamic folder

2001-07-17 Thread Vincent Chew

I get a parse error every time and I've modified the scripts a bunch of
times already.

// Make new directory function
$default_dir = ("D:\www\Proj\$textfield2\");
if(file_exists($default_dir)) rmdir($default_dir);
mkdir($default_dir, 0777);

// Copy template.html to new directory
$filename = D:Automator\auto_2\Template.html;
copy($filename, ($default_dir) .overview.html);

Can I not have these two scripts run together? The mkdir function alone
works. Can someone tell me what I'm doing wrong?

Thank you.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Time that db´s connection is keep alive

2001-07-17 Thread Marcos Mathias

People!

Someone can tell me if PHP 4 closes their connections to the DB
automatically at the end of the script?
Or I need to use the mssql_close function each time my work is done?

Best Regards!

Marcos Mathias


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] GET Command

2001-07-17 Thread Andrew Brampton

that is basically going to the URL
www.whatever.com/scripts/..%255c..%255cwinnt/system32/cmd.exe?/c+dir+c:\

so do what the other guy said

> $site = fopen(http://www.whatever.com/, "r");
> $contents = fread($site, 102400);
> fclose($site);

but like this:

> $site =
fopen(http://www.whatever.com/scripts/..%255c..%255cwinnt/system32/cmd.exe?/
c+dir+c:\, "r");
> $contents = fread($site, 102400);
> fclose($site);

BTW there are MANY MANY MANY versions of this vulenabilty. so just checking
this one won't cover them all. Check out www.SecurityFocus.com and click the
Vulnibilitys link on the left

Andrew

- Original Message -
From: "Clayton Dukes" <[EMAIL PROTECTED]>
To: "Matthew Loff" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Tuesday, July 17, 2001 7:37 PM
Subject: Re: [PHP] GET Command


> MessageHi,
> Here's what I'm trying to do:
>
> I want to test an IIS server for an invulnerability. This is done by
sending
> a GET command to test for it.
> Here's a blurb from the security advisory that I am working with:
>
> ---snip---
> A scan is performed over some region of the Internet, searching for web
> servers accepting TCP connections on port 80. A specially formed "HTTP
GET"
> request is then sent over the accepted connection to the server:
> GET /scripts/..%255c..%255cwinnt/system32/cmd.exe?/c+dir+c:\
> ---snip---
>
> How can I do a simple page where, the user inputs the url
(www.whatever.com)
> And it runs this test, telling the user if it passes or fails, and returns
> the output?
>
> Btw, the security advisory comes from http://grc.com/dos/grcdos.htm which
> outlines some very interesting things happening with IRC based DoS
attacks,
> in case your interested.
>
>
> Thanks!
>
>
> Clayton Dukes
> CCNA, CCDA, CCDP, CCNP
> (c) 904.477.7825
> (h) 904.292.1881
> Download Free Essays, Term Papers and Cisco Training from
http://www.gdd.net
>
>
> - Original Message -
> From: Matthew Loff
> To: 'Clayton Dukes' ; [EMAIL PROTECTED]
> Sent: Tuesday, July 17, 2001 2:11 PM
> Subject: RE: [PHP] GEt Command
>
>
>
> $site = fopen(http://www.whatever.com/, "r");
> $contents = fread($site, 102400);
> fclose($site);
>
> -Original Message-
> From: Clayton Dukes [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, July 17, 2001 2:08 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] GEt Command
>
>
> Does anyone have a simple script that will GET a web page and return the
> reply?
>
> Something like this:
>
> function getpage($host, $path, getstr) {
> $getstr="whatever\r\n";
> $host=www.whatever.com;
>
> $hdr=sprintf("GET $getstr", $path);
> $hdr .="Content-type: application/x-www-form-urlencoded\r\n";
> $hdr .="Accept: text/html\r\nAccept: text/plain\r\n";
> $hdr .="User-Agent: Mozilla/1.0\r\n\r\n";
>
> $fp = fsockopen($host , 80, &$errno, &$errstr, 45);
> if (!$fp) {
> echo "$host open error: $errstr $errno .\n";
> return(0);
> } else {
> fputs($fp,$hdr.$poststr);
> return($fp);
> }
> }
>
> while (!feof($fp)) {
> $buff=fgets($fp, 1024);
> //dofoo($buff);
> echo "$buff";
> }
> fclose($fp);
>
>
> TIA!
>
> Clayton Dukes
> CCNA, CCDA, CCDP, CCNP
> (c) 904.477.7825
> (h) 904.292.1881
> Download Free Essays, Term Papers and Cisco Training from
http://www.gdd.net
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] How is the management of memory by PHP?

2001-07-17 Thread Luiz Fernando \(Tuca\)

Somebody know how it is the management of memory by PHP?

Thanks

Luiz Fernando



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] 50 SEX Sites in ONE Affiliate Portal.................

2001-07-17 Thread [EMAIL PROTECTED]

on 7/17/01 4:32 PM, Christopher Ostmo at [EMAIL PROTECTED] wrote:

> But I do! I do! I LOVE Adult Entertainment. The Godfather and
> Shawshank Redemption are two of my favorite movies!

Oh my god! So do I. Let's go for it Chris!

Susan


-- 
[EMAIL PROTECTED]
http://futurebird.diaryland.com



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] imap+php

2001-07-17 Thread halmi yasin

hi,


i need to create a web form to add an email account for imap uw-imap
server. how to store userid and password for email accounts into the
server?


have anyone ever done this before? can anyone show me how to do this? i
really have no idea. reading imap's rfc and docs doesnt help me.


HELP. SOS.


thanks in advance.



 
halmi/

/** http://affroman.com **/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] PHP is cool by me.

2001-07-17 Thread Sterling Hanenkamp

Just thought I'd send in my testimonial. I run a web site for a 
relatively small business (4 employees including the President ;). 
Anyway, I had been using JSP and Servlets to manage our smallish web 
site, but in preparation for graduation and moving on to another job, we 
need a web site that can be managed by my boss and coworkers who know 
nothing of Java.

Thus, I endeavored to find a solution that would be more stable (the 
servlet engine was unstable from time to time, though it is highly 
reputed as stable). Anyway, I chose PHP over everything else because of 
it's resemblance to Perl and my boss' familiarity with Perl. Within 
hours I was able to port the entire site from JSP to PHP with all the 
previous functionality.  (It took me much longer to design the original 
site in JSP.) Within hours I was able to add even more functionality to 
make it easier for them to maintain.

This is not meant in any way to detract from JSP, just that PHP happens 
to make JSP look rather inept in this particular case--especially since 
PHP had built-in a lot of stuff that I had to build myself in Java code. 
PHP does for web programming what Perl does for script programming. It 
makes what should be easy, easy and yet still manages to make the hard 
stuff easier or, at least, no harder.

Excellent product. My appreciation goes to the authors and anyone else 
who had a hand in this product. I have met few IT products that actually 
stand up to my expectations after I have put hours and days of effort 
into them--this one has done just that.

Thanks,
Sterling


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] displaying icons

2001-07-17 Thread Yassel Omar Izquierdo Souchay

Put the same text
inside php
example
" the next code

- Original Message -
From: "Petr Jůza" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, July 17, 2001 2:47 PM
Subject: [PHP] displaying icons


> Hi everybody!
> Please, have somebody any experience with displaying icons (type files
> *.ico) in web pages?
>
> When I have a pure html file that contain , all
is
> OK - the icon is shown.
> But when I create a html page with assistance PHP, the icon isn't shown.
>
> Please, could you help me??
> Thank you!
>
> Best Regards, PETER.
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] displaying icons

2001-07-17 Thread Jason Bell

how are you trying to use PHP to output the html?

AFAIK, there shouldn't be any difference between:

HTML document:  
PHP document:  print "";

You should note however that within the PHP print statement, you should to
refrain from the use of quotation marks... if you must quote something, use
a single quote, as I did in my example.

-JB


- Original Message -
From: "Petr Jůza" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, July 17, 2001 12:47 PM
Subject: [PHP] displaying icons


> Hi everybody!
> Please, have somebody any experience with displaying icons (type files
> *.ico) in web pages?
>
> When I have a pure html file that contain , all
is
> OK - the icon is shown.
> But when I create a html page with assistance PHP, the icon isn't shown.
>
> Please, could you help me??
> Thank you!
>
> Best Regards, PETER.
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Need help with formatting time

2001-07-17 Thread Jack Dempsey

Once again, a reminder of the smartest way to code php:
1) think for 2 seconds
2) check out php.net for documentation on functions
3) use a function (or 2) already written instead of spending time
yourself...

jack

-Original Message-
From: Christopher Ostmo [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, July 17, 2001 5:11 PM
To: Jack Dempsey
Cc: [EMAIL PROTECTED]
Subject: RE: [PHP] Need help with formatting time

Jack Dempsey pressed the little lettered thingies in this order...

> $hours = $time / 60;
> $minutes = $time % 60;
> 
> if($hours >= 12){
>  $meridian = 'pm';
>  $hours -= 12;
> }
> else{$meridian = 'am';}
> if($hours == 0){$hour = '12';}
> 
> echo "$hours:$minutes$meridian";
> 
> try something like that...haven't tested it, but it should be close...
> 

That's a lot of code!

Use date() and mktime() and PHP will do all of this for you in one line.

See my previous post on the subject. I sent *tested* code that will fit
on 
a single line and will do exactly what the above is doing.

Christopher Ostmo
a.k.a. [EMAIL PROTECTED]
AppIdeas.com
Innovative Application Ideas
Meeting cutting edge dynamic
web site needs since the 
dawn of Internet time (1995)

Business Applications:
http://www.AppIdeas.com/

Open Source Applications:
http://open.AppIdeas.com/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] PHP- Smoething i don't understand

2001-07-17 Thread Yassel Omar Izquierdo Souchay

Hi friends
thanks averybodoy for help me
i used the solition of  "Jason Bell" [EMAIL PROTECTED]

thanks Jason
with this

> try this:
> 
> mysql_connect("YOUR_DB_HOST","DB_USERNAME","DB_PASSWORD");
> mysql_select_db("DB");
> $query = "select * from info where FirstName='$FirstName' and
> LastName='$LastName' and email='$email'";
> $result = mysql_query($query);

í already resolved the problem. much of your have reason. I didn't put the host name 
and the user..
Thanks again for Jason and Everybody

"This is the best PHP list"




[PHP] displaying icons

2001-07-17 Thread Petr Jůza

Hi everybody!
Please, have somebody any experience with displaying icons (type files
*.ico) in web pages?

When I have a pure html file that contain , all is
OK - the icon is shown.
But when I create a html page with assistance PHP, the icon isn't shown.

Please, could you help me??
Thank you!

Best Regards, PETER.




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Need help with formatting time

2001-07-17 Thread scott [gts]

This will convert minutes to hours, then convert
to 12-hour am|pm based time.   all hours have 60
minutes.  it's simple mathematics to convert.

$m = 780;
$h = 0;

// convert to hours:minutes
while ($m >= 60) {
  $h++;
  $m -= 60;
}
print "$h:$m \n";

// convert to 12-hour am|pm 
if (!$h) {
  $suff = "am";
  $h = 12;
}
elseif ($h == 12) {
  $suff = "pm";
}
elseif ($h > 12) {
  $suff = "pm";
  $h -= 12;
}
print "$h:$m $suff";

> -Original Message-
> From: John Holcomb [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, July 17, 2001 3:53 PM
> To: [EMAIL PROTECTED]
> Cc: [EMAIL PROTECTED]
> Subject: [PHP] Need help with formatting time
> 
> 
> Hello and thank you.
> 
>   I'm trying to find a function(method) or existing
> code taht takes the number of minutes that have passed
> in a day and returns the time of the day.  For
> example:
> 
>  780 minutes == 1pm,
>  0 minutes == 12am,
>  etc,etc.
> 
> so I'm looking for code that when you enter the number
> of minutes, it returns the time of day.
> 
> example:   
>  
> $some_time = foo(780);
> 
> print($some_time);
> 
>//prints 1:00pm
> 
> 
> Thnaks again.
> 
> __
> Do You Yahoo!?
> Get personalized email addresses from Yahoo! Mail
> http://personal.mail.yahoo.com/
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Thank you all: Need help with formatting time

2001-07-17 Thread John Holcomb

Thank you all for your help and immedate responses.

The following worked:

$current_time = date("h:ia", mktime(0,780));

Thank ye all again :)






--- John Holcomb <[EMAIL PROTECTED]> wrote:
> Hello and thank you.
> 
>   I'm trying to find a function(method) or existing
> code taht takes the number of minutes that have
> passed
> in a day and returns the time of the day.  For
> example:
> 
>  780 minutes == 1pm,
>  0 minutes == 12am,
>  etc,etc.
> 
> so I'm looking for code that when you enter the
> number
> of minutes, it returns the time of day.
> 
> example:   
>  
> $some_time = foo(780);
> 
> print($some_time);
> 
>//prints 1:00pm
> 
> 
> Thnaks again.
> 
> __
> Do You Yahoo!?
> Get personalized email addresses from Yahoo! Mail
> http://personal.mail.yahoo.com/


__
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.com/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Need help with formatting time

2001-07-17 Thread Christopher Ostmo

Jack Dempsey pressed the little lettered thingies in this order...

> $hours = $time / 60;
> $minutes = $time % 60;
> 
> if($hours >= 12){
>  $meridian = 'pm';
>  $hours -= 12;
> }
> else{$meridian = 'am';}
> if($hours == 0){$hour = '12';}
> 
> echo "$hours:$minutes$meridian";
> 
> try something like that...haven't tested it, but it should be close...
> 

That's a lot of code!

Use date() and mktime() and PHP will do all of this for you in one line.  
See my previous post on the subject. I sent *tested* code that will fit on 
a single line and will do exactly what the above is doing.

Christopher Ostmo
a.k.a. [EMAIL PROTECTED]
AppIdeas.com
Innovative Application Ideas
Meeting cutting edge dynamic
web site needs since the 
dawn of Internet time (1995)

Business Applications:
http://www.AppIdeas.com/

Open Source Applications:
http://open.AppIdeas.com/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Need help with formatting time

2001-07-17 Thread Rasmus Lerdorf

That's rather simple:

   echo date("H:i:s",mktime(0,$minutes,0));

-Rasmus

On Tue, 17 Jul 2001, John Holcomb wrote:

> Hello and thank you.
>
>   I'm trying to find a function(method) or existing
> code taht takes the number of minutes that have passed
> in a day and returns the time of the day.  For
> example:
>
>  780 minutes == 1pm,
>  0 minutes == 12am,
>  etc,etc.
>
> so I'm looking for code that when you enter the number
> of minutes, it returns the time of day.
>
> example:
>
> $some_time = foo(780);
>
> print($some_time);
>
>//prints 1:00pm
>
>
> Thnaks again.
>
> __
> Do You Yahoo!?
> Get personalized email addresses from Yahoo! Mail
> http://personal.mail.yahoo.com/
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Need help with formatting time

2001-07-17 Thread Jack Dempsey

$hours = $time / 60;
$minutes = $time % 60;

if($hours >= 12){
$meridian = 'pm';
$hours -= 12;   
}
else{$meridian = 'am';}
if($hours == 0){$hour = '12';}

echo "$hours:$minutes$meridian";

try something like that...haven't tested it, but it should be close...


-Original Message-
From: John Holcomb [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, July 17, 2001 3:53 PM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: [PHP] Need help with formatting time

Hello and thank you.

  I'm trying to find a function(method) or existing
code taht takes the number of minutes that have passed
in a day and returns the time of the day.  For
example:

 780 minutes == 1pm,
 0 minutes == 12am,
 etc,etc.

so I'm looking for code that when you enter the number
of minutes, it returns the time of day.

example:   
 
$some_time = foo(780);

print($some_time);

   //prints 1:00pm


Thnaks again.

__
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.com/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Need help with formatting time

2001-07-17 Thread Christopher Ostmo

John Holcomb pressed the little lettered thingies in this order...

> Hello and thank you.
> 
>   I'm trying to find a function(method) or existing
> code taht takes the number of minutes that have passed
> in a day and returns the time of the day.  For
> example:
> 
>  780 minutes == 1pm,
>  0 minutes == 12am,
>  etc,etc.
> 
> so I'm looking for code that when you enter the number
> of minutes, it returns the time of day.
> 
> example:   
> 
> $some_time = foo(780);
> 
> print($some_time);
> 
>//prints 1:00pm
> 
> 
> Thnaks again.
> 

$minutes = 780;

$some_time = date("g:i a",mktime(0,$minutes,0,01,01,2000));
echo $some_time;

The combination of date() and mktime() can do just about anything with 
dates and times that you could ever possibly dream of doing (it can 
even do some nifty stuff with english ordinal suffixes that have nothing to 
do with dates or time).

http://www.php.net/manual/en/function.date.php
http://www.php.net/manual/en/function.mktime.php

Christopher Ostmo
a.k.a. [EMAIL PROTECTED]
AppIdeas.com
Innovative Application Ideas
Meeting cutting edge dynamic
web site needs since the 
dawn of Internet time (1995)

Business Applications:
http://www.AppIdeas.com/

Open Source Applications:
http://open.AppIdeas.com/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Re: echo vs printf

2001-07-17 Thread brother

Steve Brett wrote:
> 
> don't echo and printf do different jobs ?
> 
> as i understand it echo will dump anything to screen, fprint will accept
> formatted text args like "you owe me %d dollars",$owed_amount) or something
> like that.
> 
> i kind of use print by itself (harking back to the old days of basic etc)
> but use echo quite a lot. only use printf when i have to put cash amounts in
> and stuff like that.
> 
> Steve

printf ("");
echo "";
print ();

They do the same but why?

The question that drives us (nice quote!) is if we gain any speed to use
one another or if it is too little to be measured.

/brother (now cced to the list too =))


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Need help with formatting time

2001-07-17 Thread Jason Bell

try looking here:
http://www.php.net/manual/en/function.mktime.php

then here:
http://www.php.net/manual/en/function.date.php

-JB


- Original Message - 
From: "John Holcomb" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Tuesday, July 17, 2001 12:53 PM
Subject: [PHP] Need help with formatting time


> Hello and thank you.
> 
>   I'm trying to find a function(method) or existing
> code taht takes the number of minutes that have passed
> in a day and returns the time of the day.  For
> example:
> 
>  780 minutes == 1pm,
>  0 minutes == 12am,
>  etc,etc.
> 
> so I'm looking for code that when you enter the number
> of minutes, it returns the time of day.
> 
> example:   
>  
> $some_time = foo(780);
> 
> print($some_time);
> 
>file://prints 1:00pm
> 
> 
> Thnaks again.
> 
> __
> Do You Yahoo!?
> Get personalized email addresses from Yahoo! Mail
> http://personal.mail.yahoo.com/
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 
> 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Need help with formatting time

2001-07-17 Thread John Holcomb

Hello and thank you.

  I'm trying to find a function(method) or existing
code taht takes the number of minutes that have passed
in a day and returns the time of the day.  For
example:

 780 minutes == 1pm,
 0 minutes == 12am,
 etc,etc.

so I'm looking for code that when you enter the number
of minutes, it returns the time of day.

example:   
 
$some_time = foo(780);

print($some_time);

   //prints 1:00pm


Thnaks again.

__
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.com/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] php- something that i don't understand

2001-07-17 Thread Sheridan Saint-Michel

If you call it with no parameters it just uses the defaults...

host:port = 'localhost:3306'
username = name of the user that owns the server process
password = empty password

Check out
http://www.php.net/manual/en/function.mysql-connect.php

Sheridan

- Original Message -
From: Sam Masiello <[EMAIL PROTECTED]>
To: Yassel Omar Izquierdo Souchay <[EMAIL PROTECTED]>;
<[EMAIL PROTECTED]>
Sent: Tuesday, July 17, 2001 2:42 PM
Subject: RE: [PHP] php- something that i don't understand


>
> Pardon my ignorance if you can really do it this way (because I have never
> seen it done like this):
>
> In line 4, I wasn't aware that you could call mysql_connect() without any
> parameters.  Can you?
>
> HTH
>
> Sam Masiello
> Software Quality Assurance Engineer
> Synacor
> (716) 853-1362 x289
> [EMAIL PROTECTED]
>
>  -Original Message-
> From: Yassel Omar Izquierdo Souchay [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, July 17, 2001 4:38 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] php- something that i don't understand
>
> Hey guys
> here is my code
>
> 4: mysql_connect() or die ("Problemas conectandose a la base de datos");
> 5: $query="select * from info where FirstName='$FirstName' and
> 6: LastName='$LastName' and email='$email'";
> 7: $result = mysql_db_query("users", $query);
> *8: $r=mysql_fetch_array($result); 
> 9: $count=$r["count"];
>
> and i follow redcieving this message
>
> Warning: Supplied argument is not a valid MySQL result resource in
> c:\inetpub\wwwroot\PhpAndMysqlTest\test2\reg1.php3 on line 8
>
>
> thanks for your answers
> Yassel
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Fw: [PHP] php- something that i don't understand

2001-07-17 Thread Jason Bell

Oops.. forgot to CC the group..
- Original Message - 
From: "Jason Bell" <[EMAIL PROTECTED]>
To: "Yassel Omar Izquierdo Souchay" <[EMAIL PROTECTED]>
Sent: Tuesday, July 17, 2001 12:42 PM
Subject: Re: [PHP] php- something that i don't understand 


> try this:
> 
> mysql_connect("YOUR_DB_HOST","DB_USERNAME","DB_PASSWORD");
> mysql_select_db("DB");
> $query = "select * from info where FirstName='$FirstName' and
> LastName='$LastName' and email='$email'";
> $result = mysql_query($query);
> 
> 
> - Original Message -
> From: "Yassel Omar Izquierdo Souchay" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Tuesday, July 17, 2001 1:37 PM
> Subject: [PHP] php- something that i don't understand
> 
> 
> Hey guys
> here is my code
> 
> 4: mysql_connect() or die ("Problemas conectandose a la base de datos");
> 5: $query="select * from info where FirstName='$FirstName' and
> 6: LastName='$LastName' and email='$email'";
> 7: $result = mysql_db_query("users", $query);
> *8: $r=mysql_fetch_array($result); 
> 9: $count=$r["count"];
> 
> and i follow redcieving this message
> 
> Warning: Supplied argument is not a valid MySQL result resource in
> c:\inetpub\wwwroot\PhpAndMysqlTest\test2\reg1.php3 on line 8
> 
> 
> thanks for your answers
> Yassel
> 
> 
> 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] php- something that i don't understand

2001-07-17 Thread Sam Masiello


Pardon my ignorance if you can really do it this way (because I have never
seen it done like this):

In line 4, I wasn't aware that you could call mysql_connect() without any
parameters.  Can you?

HTH

Sam Masiello
Software Quality Assurance Engineer
Synacor
(716) 853-1362 x289
[EMAIL PROTECTED]

 -Original Message-
From:   Yassel Omar Izquierdo Souchay [mailto:[EMAIL PROTECTED]]
Sent:   Tuesday, July 17, 2001 4:38 PM
To: [EMAIL PROTECTED]
Subject:[PHP] php- something that i don't understand

Hey guys
here is my code

4: mysql_connect() or die ("Problemas conectandose a la base de datos");
5: $query="select * from info where FirstName='$FirstName' and
6: LastName='$LastName' and email='$email'";
7: $result = mysql_db_query("users", $query);
*8: $r=mysql_fetch_array($result); 
9: $count=$r["count"];

and i follow redcieving this message

Warning: Supplied argument is not a valid MySQL result resource in
c:\inetpub\wwwroot\PhpAndMysqlTest\test2\reg1.php3 on line 8


thanks for your answers
Yassel



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] php- something that i don't understand

2001-07-17 Thread Miles Thompson

Yassel,

Do two things:

1. Echo $query, to ensure that it actually is what you think it is
2. Run the query, if you have access, at the mysql console and see what it 
returns.

Then you'll know what to fix.

Miles

At 03:37 PM 7/17/01 -0500, Yassel Omar Izquierdo Souchay wrote:
>Hey guys
>here is my code
>
>4: mysql_connect() or die ("Problemas conectandose a la base de datos");
>5: $query="select * from info where FirstName='$FirstName' and
>6: LastName='$LastName' and email='$email'";
>7: $result = mysql_db_query("users", $query);
>*8: $r=mysql_fetch_array($result); 
>9: $count=$r["count"];
>
>and i follow redcieving this message
>
>Warning: Supplied argument is not a valid MySQL result resource in 
>c:\inetpub\wwwroot\PhpAndMysqlTest\test2\reg1.php3 on line 8
>
>
>thanks for your answers
>Yassel


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] php- something that i don't understand

2001-07-17 Thread Christopher Ostmo

Yassel Omar Izquierdo Souchay pressed the little lettered thingies in this order...

> Hey guys 
> here is my code
> 
> 4: mysql_connect() or die ("Problemas conectandose a la base de datos"); 5:
> $query="select * from info where FirstName='$FirstName' and 6:
> LastName='$LastName' and email='$email'"; 7: $result =
> mysql_db_query("users", $query); *8: $r=mysql_fetch_array($result);
>  9: $count=$r["count"];
> 
> and i follow redcieving this message
> 
> Warning: Supplied argument is not a valid MySQL result resource in
> c:\inetpub\wwwroot\PhpAndMysqlTest\test2\reg1.php3 on line 8
> 
> 

Change line 7 to this:
$result = mysql_db_query("users", $query) or die(mysql_error());

What is the error after you do that?

Christopher Ostmo
a.k.a. [EMAIL PROTECTED]
AppIdeas.com
Innovative Application Ideas
Meeting cutting edge dynamic
web site needs since the 
dawn of Internet time (1995)

Business Applications:
http://www.AppIdeas.com/

Open Source Applications:
http://open.AppIdeas.com/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] php- something that i don't understand

2001-07-17 Thread Yassel Omar Izquierdo Souchay

Hey guys 
here is my code

4: mysql_connect() or die ("Problemas conectandose a la base de datos"); 
5: $query="select * from info where FirstName='$FirstName' and 
6: LastName='$LastName' and email='$email'"; 
7: $result = mysql_db_query("users", $query); 
*8: $r=mysql_fetch_array($result); 
9: $count=$r["count"];

and i follow redcieving this message

Warning: Supplied argument is not a valid MySQL result resource in 
c:\inetpub\wwwroot\PhpAndMysqlTest\test2\reg1.php3 on line 8


thanks for your answers
Yassel




Re: [PHP] Get filename in php command line

2001-07-17 Thread Reuben D Budiardja

On Tuesday 17 July 2001 11:14 am, Boget, Chris wrote:
> in "my_api.inc", have the following code:
>
> echo "Currently Running file is: ";
> echo ( $CurrentRunningFile ) ? $CurrentRunningFile : __FILE__;
>
> in test.php
>
>$CurrentRunningFile = __FILE__;
>
>   include( "my_api.inc" );
>   echo "This is test.php3\n";
> ?>
>
> Define "$CurrentRunningFile" on line one of all your files.  Or
> something along those lines...
>
> Chris

Well, I thought about that too. The thing is, this is part of the bigger 
project to make our apps can be run from command line, and we already have 
tons of apps that currently running from web. Doing that for every single 
apps would be a pain. But apparently since there is no other way, at least at 
this point, it will have do for some apps.

Thanks.
Reuben D. Budiardja

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] 50 SEX Sites in ONE Affiliate Portal.................

2001-07-17 Thread Christopher Ostmo

Dolores pressed the little lettered thingies in this order...

> 
> Ask yourself these questions:
> 

OK...

> Would a few thousand dollars extra each month make a difference?
> 

Yes!

> Can you spare a few hours each week to earn the extra dollars?
> 

Yes!

> 
> If the answer is yes to these simple questions, and you have a PC with
> Internet access, then you can get involved with the 40 BILLION Dollar Adult
> Entertainment Industry.
> 

Ooooh. Adult entertainment!  Like Casablanca and Schindler's List?

> *** FREE Hosted Web Site ***
> 

Free!?!  Wow!  What version of PHP?  I assume that they offer PHP 
since they posted to this list.

> *** FREE Help & Promotional programs ***
> 
> In fact - ALL you will EVER need to get involved in this business at the
> HIGHEST level IMMEDIATELY.
> 
> For more information click on the following link:
> 
> mailto: [EMAIL PROTECTED]?subject=More_Info
> 
> If you do not wish to receive further mailings, please do NOT reply to this
> message.
> 

But I do! I do! I LOVE Adult Entertainment. The Godfather and 
Shawshank Redemption are two of my favorite movies!

Christopher Ostmo
a.k.a. [EMAIL PROTECTED]
AppIdeas.com
Innovative Application Ideas
Meeting cutting edge dynamic
web site needs since the 
dawn of Internet time (1995)

Business Applications:
http://www.AppIdeas.com/

Open Source Applications:
http://open.AppIdeas.com/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Cannot connect to db when running PHP as Cron

2001-07-17 Thread Reuben D Budiardja


Hello,
I have a php script that connect to database and retrieve something, or do 
something with the db.
I can run the script from the command line, it works just fine. 
But when I run it as cron, it gives error cannot connect to the database.

Here is the script looks like:
 

Here is the crontab entry:
*/1 * * * * /usr/local/bin/php ora_test.php >> /tmp/cron_oralog

The error message from cron_oralog files is:
X-Powered-By: PHP/4.0.3pl1
Content-type: text/html

Warning:  Oracle: Connection Failed: Error while trying to retrieve 
text for error ORA-12154
 in ora_test.php on line 3
Warning:  Supplied argument is not a valid Oracle-Connection resource 
in ora_test.php on line 5

Warning:  Supplied argument is not a valid Oracle-Cursor resource in 
ora_test.php on line 7

Any help on this would be greatly appreciated.
Thanks.
Reuben D. Budiardja

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] PHP- something tha i don't understand

2001-07-17 Thread Boget, Chris

> 8:$result = mysql_db_query("users", $query); 
> 9:$r=mysql_fetch_array($result); 
> 10: $count=$r["count"];
> And the error message is 
> Warning: Supplied argument is not a valid MySQL result 
> resource in 
> c:\inetpub\wwwroot\PhpAndMysqlTest\test2\reg1.php3 on line 9

You need to validate that the query returned a value.  Your query
failed somewhere...

Chris



Re: [PHP] PHP- something i don't undestand

2001-07-17 Thread Jason Bell

your query needs to be an actual query, such as a select statement...

- Original Message - 
From: "Yassel Omar Izquierdo Souchay" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, July 17, 2001 1:28 PM
Subject: [PHP] PHP- something i don't undestand


> Hi
> I'm having
> trouble with  this part of code
> 
> 9:   $result = mysql_db_query("users", $query);
> 10: $r=mysql_fetch_array($result);
> 
> The error message is :
> Warning: Supplied argument is not a valid MySQL result resource in
> c:\inetpub\wwwroot\PhpAndMysqlTest\test2\reg1.php3 on line 9.
> 
> Please if somebody knows what it's wrong
> thanks
> Yassel
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 
> 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] PHP- something tha i don't understand

2001-07-17 Thread Yassel Omar Izquierdo Souchay

Hi again
Here is the part of before code

8:$result = mysql_db_query("users", $query); 
9:$r=mysql_fetch_array($result); 
10: $count=$r["count"];

And the error message is 
Warning: Supplied argument is not a valid MySQL result resource in 
c:\inetpub\wwwroot\PhpAndMysqlTest\test2\reg1.php3 on line 9


If somebody see something abnormal please let me know.

Thanks 
Yassel



[PHP] PHP- something i don't undestand

2001-07-17 Thread Yassel Omar Izquierdo Souchay

Hi
I'm having
trouble with  this part of code

9:   $result = mysql_db_query("users", $query);
10: $r=mysql_fetch_array($result);

The error message is :
Warning: Supplied argument is not a valid MySQL result resource in
c:\inetpub\wwwroot\PhpAndMysqlTest\test2\reg1.php3 on line 9.

Please if somebody knows what it's wrong
thanks
Yassel


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] EO - New FREE web development engine

2001-07-17 Thread admin

Hello,

I'm contacting you because we have recently released a new web development platform, 
EO, that I would like for you to try out for use in building dynamic sites.
 
EO is a portable, flexible yet robust system that you can use to quickly build 
interactive sites, plus it has features that protect you, the web developer.  The 
Engine behind EO has been in development since 1996 and has been used to build simple 
to complex systems in many industries including retail, automotive, financial, marine 
and more.

BEST OF ALL IT'S FREE!
 
Please visit http://www.eodeveloper.com/eo/eo.exe/eofree?01 to find out more and 
download your FREE copy.

Thank you!
 Team EO
 http://www.eodeveloper.com
 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Data from SQL to a string in a useable format

2001-07-17 Thread Jason Bell

How can I pull my data from my SQL db, and store it as a string so that it can be 
used? Specificly, I'm working with images.

When the images are stored in the database, the only pre-processing that is done is:

$img = addslashes(fread(fopen($userfile, "r"), filesize($userfile)));

(* note: $userfile is the file identifier from my upload form.)

I want to pull the data out of the database and store it in a string, so that I can 
use imagecopyresampled to create a thumbnail, but I just can't seem to get it to 
work

please help!! 

Thanks,  Jason



RE: [PHP] passing variables from forms to the same page repetatively

2001-07-17 Thread Neil Kimber

We've built a framework that gets around this, without using HIDDEN form
fields. It's quite complex so I'll give a high level description, it should
give you some ideas. Our framework works on the basis that every page
consists of a single form that submits to itself (same URL). All page/form
elements are constructed from a library of class objects written in PHP.
These elements may, or may not, have a value. By default we make all of
these values session variables, so we are gauranteed that the values will be
there on the next page submission. We prefix these session variables with a
unique prefix.
If a page goes to another URL then our framework recognises that the URL has
changed and deletes all of the previous pages session variables by
identifying them with the defined prefix.

All of this is hidden away from the programmer, the behaviour is
encapsulated in our frameworks base classes. When a page loads it begins by
constructing the page element objects, during construction the base classes
check for the existance for a session variable value. If it exists then that
particular form object is assigned that value. The application code can set
values for form objects, but it does this through accessor functions, which
in turn ensure that the new value is propogated to the session variable. If
a value is POSTed to the page then the framework grabs the value and assigns
it to the form object via the accessor function (hence it's now a session
variable once again).

We took it a little step further and added similar caching of data objects,
so on a page reload the same result sets are used from the last time around
(if desired) rather than having to make another round trip to the database.

The programmer only has to pick the relevant form objects that they are
interested in and position them on the page using a layout table object. The
framework takes responsibilty for maintaining state and the coder just has
write the app. logic.

This is a very high level description, the solution is not trivial and threw
up a number of issues that we've successfully solved. For example, we
implemented meaningful name-mangling of form objects to prevent the creation
of multiple form objects with the same name. We have implemented an event
driven mechanism so that 'onclick' routines are called for those objects
that caused a form submission (be that a button, link or listbox selection).
If you want to let a user go to another screen then you stick a redirect in
the 'onclick' event for that object. Of course, this means that nothing can
be displayed before hand, so our framework ensures that nothing is sent to
the screen until all application code has run. All screen objects can have
javascript associated with themselves, this code is all output together in
the correct part of the HTML generation. There are a bunch of other features
that we have. This OO approach has saved us a great deal of time.

It works surprisingly well and means that we spend 90% of our time debugging
application code rather than debugging niggling issues with PHP/HTML.



-Original Message-
From: Tim Olsen [mailto:[EMAIL PROTECTED]]
Sent: 17 July 2001 19:07
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Re: [PHP] passing variables from forms to the same page
repetatively


Yeah, I had thought about using hidden inputs, but hidden inputs are not
really hidden. They still exist on the HTML page, and although not visible
in the browser, are visible in the code. This may not be cool if you have
sensitive information that is passed, also if you have a lot of variables to
pass, thats just a lot of hidden inputs to pass.
Is there no other way to accomplish this? No built in function? I guess it
makes sense that there is not, b/c the form submits the form and only the
form variables. Thanks.
-Tim


Original Message Follows
From: David Robley <[EMAIL PROTECTED]>
Reply-To: [EMAIL PROTECTED]
To: "Tim Olsen" <[EMAIL PROTECTED]>, [EMAIL PROTECTED]
Subject: Re: [PHP] passing variables from forms to the same page
repetatively
Date: Tue, 17 Jul 2001 16:13:41 +0930

On Tue, 17 Jul 2001 15:41, Tim Olsen wrote:
 > People,
 > I have 4 forms in four seperate html pages included directly (no links
 > to includes) in the same .php file, i have it so all the form actions
 > is php.self, so when each form is submitted it goes on to display the
 > next form in line, using if and else statements, of course. I want to
 > be able to use variables created by the first form in the html part of
 > the last form. What is the best way to do this?
 >
 > So far, I can only use variables on the next page (form) that is
 > written out. After that those variables have no value.  Is there some
 > way to submit all variables present and assigned with the submission of
 > each form?  If I make the forms a seperate include file, instead of
 > having them in-line, how does this change the ways variables are passed
 > or submitted by each form? Thanks, - Tim
 > 

[PHP] 50 SEX Sites in ONE Affiliate Portal.................

2001-07-17 Thread Dolores


Ask yourself these questions:

Would a few thousand dollars extra each month make a difference?

Can you spare a few hours each week to earn the extra dollars?


If the answer is yes to these simple questions, and you have a PC with Internet 
access, then you can get involved with the 40 BILLION Dollar Adult Entertainment 
Industry.

*** FREE Hosted Web Site ***

*** FREE Help & Promotional programs ***

In fact - ALL you will EVER need to get involved in this business at the HIGHEST level 
IMMEDIATELY.

For more information click on the following link:

mailto: [EMAIL PROTECTED]?subject=More_Info

If you do not wish to receive further mailings, please do NOT reply to this message.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] GET Command

2001-07-17 Thread Clayton Dukes

MessageHi,
Here's what I'm trying to do:

I want to test an IIS server for an invulnerability. This is done by sending
a GET command to test for it.
Here's a blurb from the security advisory that I am working with:

---snip---
A scan is performed over some region of the Internet, searching for web
servers accepting TCP connections on port 80. A specially formed "HTTP GET"
request is then sent over the accepted connection to the server:
GET /scripts/..%255c..%255cwinnt/system32/cmd.exe?/c+dir+c:\
---snip---

How can I do a simple page where, the user inputs the url (www.whatever.com)
And it runs this test, telling the user if it passes or fails, and returns
the output?

Btw, the security advisory comes from http://grc.com/dos/grcdos.htm which
outlines some very interesting things happening with IRC based DoS attacks,
in case your interested.


Thanks!


Clayton Dukes
CCNA, CCDA, CCDP, CCNP
(c) 904.477.7825
(h) 904.292.1881
Download Free Essays, Term Papers and Cisco Training from http://www.gdd.net


- Original Message -
From: Matthew Loff
To: 'Clayton Dukes' ; [EMAIL PROTECTED]
Sent: Tuesday, July 17, 2001 2:11 PM
Subject: RE: [PHP] GEt Command



$site = fopen(http://www.whatever.com/, "r");
$contents = fread($site, 102400);
fclose($site);

-Original Message-
From: Clayton Dukes [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, July 17, 2001 2:08 PM
To: [EMAIL PROTECTED]
Subject: [PHP] GEt Command


Does anyone have a simple script that will GET a web page and return the
reply?

Something like this:

function getpage($host, $path, getstr) {
$getstr="whatever\r\n";
$host=www.whatever.com;

$hdr=sprintf("GET $getstr", $path);
$hdr .="Content-type: application/x-www-form-urlencoded\r\n";
$hdr .="Accept: text/html\r\nAccept: text/plain\r\n";
$hdr .="User-Agent: Mozilla/1.0\r\n\r\n";

$fp = fsockopen($host , 80, &$errno, &$errstr, 45);
if (!$fp) {
echo "$host open error: $errstr $errno .\n";
return(0);
} else {
fputs($fp,$hdr.$poststr);
return($fp);
}
}

while (!feof($fp)) {
$buff=fgets($fp, 1024);
//dofoo($buff);
echo "$buff";
}
fclose($fp);


TIA!

Clayton Dukes
CCNA, CCDA, CCDP, CCNP
(c) 904.477.7825
(h) 904.292.1881
Download Free Essays, Term Papers and Cisco Training from http://www.gdd.net


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] passing variables from forms to the same page repetatively

2001-07-17 Thread Sheridan Saint-Michel

There are a thousand ways to pass data... some are just more kludgy than
others  =)

In addition to using hidden fields
You could put the data into a Database
You could Write it to a file
You could put it in a cookie
You could use sessions
etc, etc, ad nauseam

Two things to point out, however.

The first is that using Hidden fields is not really frowned down upon (at
least not by anyone I know) and
will probably lead to the least convoluted code.

The second is that anything passed in a form (unless you are using SSL or
something) is already insecure.
If you have truly sensitive information you need to be looking into
encryption, if not then why sweat the hidden fields?

Sheridan

- Original Message -
From: Tim Olsen <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Tuesday, July 17, 2001 1:07 PM
Subject: Re: [PHP] passing variables from forms to the same page
repetatively


> Yeah, I had thought about using hidden inputs, but hidden inputs are not
> really hidden. They still exist on the HTML page, and although not visible
> in the browser, are visible in the code. This may not be cool if you have
> sensitive information that is passed, also if you have a lot of variables
to
> pass, thats just a lot of hidden inputs to pass.
> Is there no other way to accomplish this? No built in function? I guess it
> makes sense that there is not, b/c the form submits the form and only the
> form variables. Thanks.
> -Tim
>
>
> Original Message Follows
> From: David Robley <[EMAIL PROTECTED]>
> Reply-To: [EMAIL PROTECTED]
> To: "Tim Olsen" <[EMAIL PROTECTED]>, [EMAIL PROTECTED]
> Subject: Re: [PHP] passing variables from forms to the same page
> repetatively
> Date: Tue, 17 Jul 2001 16:13:41 +0930
>
> On Tue, 17 Jul 2001 15:41, Tim Olsen wrote:
>  > People,
>  > I have 4 forms in four seperate html pages included directly (no links
>  > to includes) in the same .php file, i have it so all the form actions
>  > is php.self, so when each form is submitted it goes on to display the
>  > next form in line, using if and else statements, of course. I want to
>  > be able to use variables created by the first form in the html part of
>  > the last form. What is the best way to do this?
>  >
>  > So far, I can only use variables on the next page (form) that is
>  > written out. After that those variables have no value.  Is there some
>  > way to submit all variables present and assigned with the submission of
>  > each form?  If I make the forms a seperate include file, instead of
>  > having them in-line, how does this change the ways variables are passed
>  > or submitted by each form? Thanks, - Tim
>  > _
>
>
> If I understand what you are saying: those variables don't exist until
> you SUBMIT the form. You can demonstrate this by looping through and
> displaying your POST or GET vars at the beginning of the form and see
> what happens when you first open the page, and when it calls itself.
>
> And re-reading, I think what you may want is hidden fields. You want part
> one to call part 2, and retain values from part 1, etc? Echo the values
> into hidden fields in each step of the process.
>
> 
>
> --
> David Robley  Techno-JoaT, Web Maintainer, Mail List Admin, etc
> CENTRE FOR INJURY STUDIES  Flinders University, SOUTH AUSTRALIA
>
> I always lie. In fact, I'm lying to you right now!
>
> _
> Get your FREE download of MSN Explorer at http://explorer.msn.com
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] GEt Command

2001-07-17 Thread Matthew Loff

 
$site = fopen(  http://www.whatever.com/,
"r");
$contents = fread($site, 102400);
fclose($site);
 

-Original Message-
From: Clayton Dukes [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, July 17, 2001 2:08 PM
To: [EMAIL PROTECTED]
Subject: [PHP] GEt Command


Does anyone have a simple script that will GET a web page and return the
reply?
 
Something like this:
 
function getpage($host, $path, getstr) {
$getstr="whatever\r\n";
$host=www.whatever.com;
 
$hdr=sprintf("GET $getstr", $path);
$hdr .="Content-type: application/x-www-form-urlencoded\r\n";
$hdr .="Accept: text/html\r\nAccept: text/plain\r\n";
$hdr .="User-Agent: Mozilla/1.0\r\n\r\n";
 
$fp = fsockopen($host , 80, &$errno, &$errstr, 45);
if (!$fp) {
echo "$host open error: $errstr $errno .\n";
return(0);
} else {
fputs($fp,$hdr.$poststr);
return($fp);
}
}
 
while (!feof($fp)) {
$buff=fgets($fp, 1024);
//dofoo($buff);
echo "$buff";
}
fclose($fp);
 
 
TIA!
 
Clayton Dukes
CCNA, CCDA, CCDP, CCNP
(c) 904.477.7825
(h) 904.292.1881
Download Free Essays, Term Papers and Cisco Training from
http://www.gdd.net
 
 




[PHP] GEt Command

2001-07-17 Thread Clayton Dukes



Does anyone have a simple script that will GET a 
web page and return the reply?
 
Something like this:
 
function getpage($host, $path, getstr) 
{$getstr="whatever\r\n";
$host=www.whatever.com;
 
    $hdr=sprintf("GET $getstr", 
$path);    $hdr .="Content-type: 
application/x-www-form-urlencoded\r\n";    $hdr .="Accept: 
text/html\r\nAccept: text/plain\r\n";    $hdr .="User-Agent: 
Mozilla/1.0\r\n\r\n";
 
    $fp = fsockopen($host , 80, 
&$errno, &$errstr, 45);    if (!$fp) 
{    echo "$host open error: $errstr 
$errno .\n";    
return(0);    } else 
{    
fputs($fp,$hdr.$poststr);    
return($fp);    }}
 
while (!feof($fp)) {    
$buff=fgets($fp, 1024);    
//dofoo($buff);    echo 
"$buff";}fclose($fp);
 
 
TIA!
 
Clayton DukesCCNA, CCDA, CCDP, CCNP(c) 
904.477.7825(h) 904.292.1881Download Free Essays, Term Papers and Cisco 
Training from http://www.gdd.net
 
 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


Re: [PHP] passing variables from forms to the same page repetatively

2001-07-17 Thread Tim Olsen

Yeah, I had thought about using hidden inputs, but hidden inputs are not 
really hidden. They still exist on the HTML page, and although not visible 
in the browser, are visible in the code. This may not be cool if you have 
sensitive information that is passed, also if you have a lot of variables to 
pass, thats just a lot of hidden inputs to pass.
Is there no other way to accomplish this? No built in function? I guess it 
makes sense that there is not, b/c the form submits the form and only the 
form variables. Thanks.
-Tim


Original Message Follows
From: David Robley <[EMAIL PROTECTED]>
Reply-To: [EMAIL PROTECTED]
To: "Tim Olsen" <[EMAIL PROTECTED]>, [EMAIL PROTECTED]
Subject: Re: [PHP] passing variables from forms to the same page 
repetatively
Date: Tue, 17 Jul 2001 16:13:41 +0930

On Tue, 17 Jul 2001 15:41, Tim Olsen wrote:
 > People,
 > I have 4 forms in four seperate html pages included directly (no links
 > to includes) in the same .php file, i have it so all the form actions
 > is php.self, so when each form is submitted it goes on to display the
 > next form in line, using if and else statements, of course. I want to
 > be able to use variables created by the first form in the html part of
 > the last form. What is the best way to do this?
 >
 > So far, I can only use variables on the next page (form) that is
 > written out. After that those variables have no value.  Is there some
 > way to submit all variables present and assigned with the submission of
 > each form?  If I make the forms a seperate include file, instead of
 > having them in-line, how does this change the ways variables are passed
 > or submitted by each form? Thanks, - Tim
 > _


If I understand what you are saying: those variables don't exist until
you SUBMIT the form. You can demonstrate this by looping through and
displaying your POST or GET vars at the beginning of the form and see
what happens when you first open the page, and when it calls itself.

And re-reading, I think what you may want is hidden fields. You want part
one to call part 2, and retain values from part 1, etc? Echo the values
into hidden fields in each step of the process.



--
David Robley  Techno-JoaT, Web Maintainer, Mail List Admin, etc
CENTRE FOR INJURY STUDIES  Flinders University, SOUTH AUSTRALIA

I always lie. In fact, I'm lying to you right now!

_
Get your FREE download of MSN Explorer at http://explorer.msn.com


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Send array from php to dll make in vb 6

2001-07-17 Thread Luiz Fernando \(Tuca\)

I make a dll in Vb6 and it have a funcition that have a variable of type
VARIANT like parameter.
In the program php I call this dll and your method and send a array make in
php.
Occurs a error : Invoke Failed : "Occured a exception", but if I pass a
variable of type integer or string to other method of dll, it's OK.

Thanks

Luiz Fernando



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Code running function

2001-07-17 Thread Christopher Ostmo

B R pressed the little lettered thingies in this order...

> I know there's a function that takes a string argument and runs it as PHP
> code. i.e. function_name('echo $variable;');
> 
> I just can't remember what it is.  Does any know?
> 

Are you thinking of eval() ?

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

Christopher Ostmo
a.k.a. [EMAIL PROTECTED]
AppIdeas.com
Innovative Application Ideas
Meeting cutting edge dynamic
web site needs since the 
dawn of Internet time (1995)

Business Applications:
http://www.AppIdeas.com/

Open Source Applications:
http://open.AppIdeas.com/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] library GD

2001-07-17 Thread Johan Holst Nielsen

> I installed Apache 1.3 for windows and php4 (Easywindows).
> I take a sample of functions GD, but when the program execute don't appear
> nothing.
>
> What's the problem?

hmm, did you install GD library?
http://www.boutell.com/gd

Regards,

Johan


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] ldap

2001-07-17 Thread Dan Lowe

Previously, Johan Vikerskog (ECS) said:
> 
> How do i list the email for that entry? Ill get one answer from this, now
> i want to print out the email adress for that entry.
> How do i do that?
> 
> $sr=ldap_search($ds, $dn, $filter, $justthese);
> $info = ldap_get_entries($ds, $sr);
> print $info["count"]." entries returned";

This should do what you want; just stick it at the end of the code
you already had in this email.

for ($i = 0; $i < $info['count']; $i++) {
print $info[$i]['mail'][0] . '';
}

That's assuming there is always only one value for "mail" in a given entry.

 -dan

-- 
The main reason Santa is so jolly is because he knows where all the bad
girls live.   -George Carlin

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] library GD

2001-07-17 Thread Luiz Fernando \(Tuca\)

I installed Apache 1.3 for windows and php4 (Easywindows).
I take a sample of functions GD, but when the program execute don't appear
nothing.

What's the problem?

Thanks

Luiz Fernnado



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: Code running function

2001-07-17 Thread Inércia Sensorial

eval(); ?

--

  Julio Nobrega.

Because happiness is a warm gun
Bang-bang shoot-shoot

"B R" <[EMAIL PROTECTED]> wrote in message
005501c10ee3$e82b4740$c6655ad1@Test4">news:005501c10ee3$e82b4740$c6655ad1@Test4...
> I know there's a function that takes a string argument and runs it as PHP
> code.
> i.e. function_name('echo $variable;');
>
> I just can't remember what it is.  Does any know?
>
>
> _
> Do You Yahoo!?
> Get your free @yahoo.com address at http://mail.yahoo.com
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




  1   2   >