php-general Digest 20 Mar 2001 03:47:17 -0000 Issue 577
Topics (messages 44567 through 44680):
Searching multiple tables
44567 by: Clayton Dukes
Re: Problems with Linux PHP
44568 by: Liam Gibbs
44611 by: Christian Reiniger
PHP vs Servlet
44569 by: Jesper Blomström
44632 by: Jesper Blomström
Re: first three characters
44570 by: Johnson, Kirk
Re: [PHP-DB] Re: [PHP] Query - Grouping Results
44571 by: Darryl Friesen
Re: use strict alternative
44572 by: Johnson, Kirk
Re: how do i get a variable type? - not that simple
44573 by: Johnson, Kirk
44656 by: Mahmoud Abu-Wardeh
Re: [PHP-DB] Query - Grouping Results
44574 by: Mario Henrique Cruz Torres
Re: submission of 1..N variables
44575 by: Chris Lee
Re: Source Protection
44576 by: Chris Lee
44585 by: rui.websolut.net
Re: Variables problem
44577 by: Chris Lee
Re: Change POST for GET
44578 by: Chris Lee
44580 by: Altunergil, Oktay
Re: FileUpload problematic
44579 by: Chris Lee
44586 by: ben.2.edwards.bt.com
Re: With all this talk about editors ...
44581 by: Chris Lee
removing element from array
44582 by: Alexander Gräf
44583 by: Chris Lee
44587 by: Jack Dempsey
Re: MS SQL databse connecting
44584 by: Michael Kimsal
44590 by: Yoshi Melrose
44593 by: Andrew Hill
44594 by: Andrew Hill
44598 by: Yoshi Melrose
44599 by: Yoshi Melrose
mime mail class (Sascha & Tobias) - msWORD doc attachment not working
44588 by: Jen Hall
Re: Problems with multiple query
44589 by: Nuno Silva
HELP insert still dosn't work
44591 by: Rudolf Frint
44651 by: David Robley
44659 by: ben
SETUP PHP , MYSQL, APACHE
44592 by: Luis
"deleted" cookie
44595 by: Nikolai Vladychevski
managing scripts on different domains
44596 by: Thomas Schneider
Re: site root variable (for Generic Unix and Windows)
44597 by: Harshdeep S Jawanda
44614 by: Harshdeep S Jawanda
44615 by: Harshdeep S Jawanda
Add commas to 1188889 so--> 1,188,889
44600 by: Karl J. Stubsjoen
44601 by: Egon Schmid (.work)
44603 by: Reuben D Budiardja
unlink failed message in page but files are removed!
44602 by: Tom Beidler
Re: pulldown population not getting the last value
44604 by: Tom Beidler
PHP hosts?
44605 by: Good Fella
44607 by: Jeff Oien
44610 by: postmaster-vs
PHP Webhosting
44606 by: Angerer, Chad
44609 by: support
44618 by: Aviv Revach
OOP question regarding class extension
44608 by: John Guynn
44613 by: Altunergil, Oktay
44621 by: Matt McClanahan
webhosts
44612 by: postmaster-vs
posix_pwnam with shadow passwords
44616 by: Liam Gibbs
Remember my username & password
44617 by: Batis
44619 by: Pierre-Yves Lemaire
44625 by: Miles Thompson
Reversing htmlspecialchars()
44620 by: Yev
44622 by: Egon Schmid (.work)
Re: Checking if a web, a url really exists ?
44623 by: Geoff Caplan
Re: Automatic documentation: call for help with C++
44624 by: Geoff Caplan
Re: PHP & MYSQL BOOKS
44626 by: YoBro
44627 by: Kurth Bemis
44630 by: Jeff Oien
Reading one line, and no more.
44628 by: Richard
44629 by: Altunergil, Oktay
44631 by: Miles Thompson
Re: weeks revisited
44633 by: Chris Worth
Help with array creation
44634 by: Chris Carbaugh
PHP Install Problem
44635 by: Joseph Koenig
Script to convert # of seconds to HH:mm
44636 by: Yoshi Melrose
44637 by: mjriding.wcoil.com
44639 by: Phillip Bow
44640 by: Javier Muniz
44641 by: Phillip Bow
44642 by: Yoshi Melrose
44646 by: Phillip Bow
44662 by: Stephan Ahonen
get_meta_tags bug?
44638 by: Paul Rees
Re: Zend?
44643 by: Richard Lynch
Re: php editors
44644 by: Richard Lynch
44647 by: Altunergil, Oktay
Re: \"deleted\" cookie
44645 by: Nikolai Vladychevski
math query
44648 by: Peter Houchin
44650 by: Johnson, Kirk
PHP w/ Oracle OCI8 - how stable?
44649 by: Hardy Merrill
(HELP) Reading a file sent through HTTP
44652 by: Fabian Raygosa
44653 by: Rasmus Lerdorf
44654 by: Fabian Raygosa
44655 by: Rasmus Lerdorf
44657 by: Fabian Raygosa
44658 by: Jason Brooke
44660 by: Fabian Raygosa
Hey Everyone
44661 by: WebMaster
dl()-function
44663 by: Jochen Kaechelin
Using php4.02 on IIS5
44664 by: James Cox
Simple PHP 4 and MySQL question about query
44665 by: SED
44666 by: Mark
44669 by: David Robley
44670 by: Peter Houchin
[Q] double quote(") is auto-transformed into (\")!
44667 by: Chung Ha-Nyung
44668 by: Jack Dempsey
44671 by: Konrad Wojas
44672 by: David Robley
get name of file
44673 by: Matthew Delmarter
44674 by: Jack Dempsey
44675 by: John LYC
44677 by: Thor M. Steindorsson
Re: Sessions and CHECKBOXES :(
44676 by: karakedi
Re: Tables with scroll in HTML?
44678 by: karakedi
checboxex and sessions
44679 by: karakedi
Re: Simple PHP 4 and MySQL question about query - Problem solved!
44680 by: SED
Administrivia:
To subscribe to the digest, e-mail:
[EMAIL PROTECTED]
To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]
To post to the list, e-mail:
[EMAIL PROTECTED]
----------------------------------------------------------------------
I'm having a hard time chasing down a
bug.
I have themes installed on my website, the color
choices are stored in the database.
I need to search all tables within the database for
the word "red"
how can I do this?
Thanks :-)
Clayton Dukes
|
<<I'm having a couple of problems while porting some software from Lynx OS
to Linux. Here they are:
1. The encryption method seems to be different. Does anyone know the salt to
use in the crypt() function in Linux?
2. Also, I seem to not be able to popen() in Linux. I get a file pointer
which is blank. Does anybody know why???
To add a little info to my post, I've found out something about my problem.
I'm getting the error message "popen("chmod 700 session", "r+") - Invalid
argument in file.php3 on line ###". The line that gives this command is:
if($fp = popen($command, "r+")) {
The $command is "chmod 700 session". This problem shows up in Linux 2.2.12,
but this command works fine in LynxOS 3.0.1.
I found some information that says that popen doesn't work with some
versions of Linux because the kernel is broken on those versions. Is there a
way around this that is used by both (and all other Unix) OSs? Am I stuck?
Thanks in advance again,
Liam
On Monday 19 March 2001 15:28, you wrote:
> I'm having a couple of problems while porting some software from Lynx
> OS to Linux. Here they are:
>
> 1. The encryption method seems to be different. Does anyone know the
> salt to use in the crypt() function in Linux?
Depends on the distribution you're using and (sometimes) on what you
selected during installation of the distro.
Have a look at the manual page for crypt(PHP). It says something about
constants being defined depending on which encryption modes are available.
--
Christian Reiniger
LGDC Webmaster (http://sunsite.dk/lgdc/)
CPU not found. retry, abort, ignore?
Hi!
I am sure you have a solution to this...
How shall I communicate with a servlet from PHP?
I have a servlet which makes a DB-query and returns the
result.
Thanks!
/ Jeppe
--
Jesper Blomström
[EMAIL PROTECTED]
Arbete: 08-566 280 08
Hem: 08-669 23 10
Mobil: 070-30 24 911
I found out how to do it.
Thx anyway
/ J
Jesper Blomström <[EMAIL PROTECTED]> skrev i
diskussionsgruppsmeddelandet:[EMAIL PROTECTED]
> Hi!
>
> I am sure you have a solution to this...
>
> How shall I communicate with a servlet from PHP?
> I have a servlet which makes a DB-query and returns the
> result.
>
> Thanks!
>
>
>
> / Jeppe
>
>
>
> --
> Jesper Blomström
> [EMAIL PROTECTED]
> Arbete: 08-566 280 08
> Hem: 08-669 23 10
> Mobil: 070-30 24 911
>
> --
> 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]
>
substr()
http://www.php.net/manual/en/function.substr.php
Kirk
> -----Original Message-----
> From: Rahul Bhide [mailto:[EMAIL PROTECTED]]
> Sent: Sunday, March 18, 2001 11:02 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] first three characters
>
>
> Gurus,
> How do I extract the first n characters out of a word . I
> have this-
>
> Doesn't seem to work, how would I print that out with PHP?
The results will come back sorted by name, then time. While processing each
row, you'll need to keep track of when the username changes, something like
this (this is just rough code, not quite valid PHP):
$username = '';
while ($data = fetchrow)
{
if ($username != $data['name'])
{
$username = $data['name'];
print "Logins for " . $username . "\n\n";
}
print $login . "\n";
}
Keep track of the current user. As you examine each record, check if it's
different than the current one. If it is, save it as the current username,
and print the login info. If it's the same, just print the login info.
- Darryl
----------------------------------------------------------------------
Darryl Friesen, B.Sc., Programmer/Analyst [EMAIL PROTECTED]
Education & Research Technology Services, http://gollum.usask.ca/
Department of Computing Services,
University of Saskatchewan
----------------------------------------------------------------------
"Go not to the Elves for counsel, for they will say both no and yes"
I think there is an error_level you can set that will warn about using
*undefined* variables before they have been assigned a value. Don't recall
the details offhand.
Kirk
> -----Original Message-----
> From: Christian Reiniger [mailto:[EMAIL PROTECTED]]
> Sent: Monday, March 19, 2001 5:37 AM
> To: '[EMAIL PROTECTED]'
> Subject: Re: [PHP] use strict alternative
> "use strict" forces you to declare variables before you use
> them. AFAIK
> there's no such thing in PHP (unfortunately).
Jim,
Thanks for sharing all your hard work. Have you seen checkdate()?
http://www.php.net/manual/en/function.checkdate.php
Kirk
> -----Original Message-----
> From: Ide, Jim [mailto:[EMAIL PROTECTED]]
> Sent: Monday, March 19, 2001 6:38 AM
> To: 'phpman'; [EMAIL PROTECTED]
> Subject: RE: [PHP] how do i get a variable type? - not that simple
>
>
> These are the functions I use to determine if
> a string value is a valid integer, real, date, etc.
> Hope this helps.
>
> ps - please let me know if you find any errors. thanx.
>
> <?php
>
> function IsValidBoolean($p) {
> if ( isset($p) ) {
> if ((strtolower($p) == "true") or (strtolower($p) ==
> "false")) return TRUE;
> }
> return FALSE;
> }
>
> function IsValidMemo($p) {
>
> // If $p contains any characters other than printable ascii,
> // or \r or \n, return FALSE.
>
> if (trim($p) == "") return TRUE;
> if ( ereg("[^\r\n\x20-\x7E]", $p) ) return FALSE;
> return TRUE;
> }
>
> function IsValidString($p) {
>
> // If $p contains any characters other than printable ascii,
> // return FALSE.
>
> if (trim($p) == "") return TRUE;
> if ( ereg("[^\x20-\x7E]", $p) ) return FALSE;
> return TRUE;
> }
>
> function IsValidInteger($p) {
>
> // return TRUE if:
> // 1. $p is not equal to ""
> // 2. $p consists of 1 or more digits, optionally preceded by a
> minus sign
>
> if ( isset($p) ) return ereg("^\-?[0-9]+$",$p);
> return FALSE;
> }
>
> function IsValidReal($p) {
>
> // return TRUE if:
> // 1. $p is not equal to ""
> // 2. $p begins with optional minus sign, followed by 1 or more
> digits, followed by a decimal point,
> // followed by 1 or more digits
> // 3. $p can be optionally preceded by a minus sign
>
> if ( isset($p) ) return ereg("^\-?[0-9]+\.[0-9]+$",$p);
> return FALSE;
> }
>
> function IsLeapYear($y) {
> if ( (($y % 4) == 0) && (($y % 100) != 0) || (($y % 400) == 0))
> return TRUE;
> return FALSE;
> }
>
> function IsValidDate($p) {
>
> // return TRUE if:
> // 1. $p is not equal to ""
> // 2. $p consists of 4 digits followed by minus sign,
> followed by 2
> digits, followed by
> // minus sign, followed by 2 digits
> // example 1995-02-03
>
> if ( ! isset($p) )
> return FALSE;
> if ( ! ereg("^([0-9]{4})\-([0-9]{2})\-([0-9]{2})$",$p) )
> return FALSE;
>
> $t = explode("-",$p);
> if ( count($t) != 3 ) return FALSE;
> $y = $t[0];
> $m = $t[1];
> $d = $t[2];
>
> return IsValidDate2($y,$m,$d);
> }
>
> function IsValidDate2($y,$m,$d) {
>
> if ( ($m < 1) or ($m > 12) ) return FALSE;
> if ( ($d < 1) or ($d > 31) ) return FALSE;
>
> // 30 days has sept, apr, jun, and nov (all the rest
> have 31 [except
> for feb])
> // 9 4 6 11
>
> if ( ($m == 4) or ($m == 6) or ($m == 9) or ($m == 11) ) {
> if ($d > 30) return FALSE;
> } elseif ($m == 2) {
> if ( IsLeapYear($y) ) {
> if ( $d > 29 ) return FALSE;
> } else {
> if ( $d > 28 ) return FALSE;
> }
> }
> return TRUE;
> }
>
> function IsValidTime($p) {
>
> // return TRUE if:
> // 1. $p is not equal to ""
> // 2. $p consists of 2 digits in the range 00 to 23,
> // followed by a colon,
> // followed by 2 digits in the range 00 to 59,
> // followed by a colon,
> // followed by 2 digits in the range 00 to 59.
> // example 14:45:02
>
> if ( ! isset($p) )
> return FALSE;
> if ( ! ereg("^([0-9]{2})\:([0-9]{2})\:([0-9]{2})$",$p) )
> return FALSE;
>
> $t = explode(":",$p);
> if ( count($t) != 3 ) return FALSE;
> $h = $t[0];
> $m = $t[1];
> $s = $t[2];
>
> return IsValidTime2($h,$m,$s);
> }
>
> function IsValidTime2($h,$m,$s) {
>
> if ( ($h < 0) or ($h > 23) ) return FALSE;
> if ( ($m < 0) or ($m > 59) ) return FALSE;
> if ( ($s < 0) or ($s > 59) ) return FALSE;
>
> return TRUE;
> }
>
> function IsValidDateTime($p) {
>
> // return TRUE if:
> // 1. $p is not equal to ""
> // 2. $p consists of a valid date (validated by
> IsValidDate() above)
> // followed by a space
> // followed by a valid time (validated by
> IsValidTime() above)
> // example: 1998-04-21 22:01:34
>
> if ( ! isset($p) ) return FALSE;
>
> $temp = explode(" ",$p);
> if ( count($temp) != 2 ) return FALSE;
> $d = $temp[0];
> $t = $temp[1];
> if ( ! IsValidDate($d) ) return FALSE;
> if ( ! IsValidTime($t) ) return FALSE;
>
> return TRUE;
> }
>
> function IsValidTimeStamp($p) {
>
> // return TRUE if:
> // 1. $p is not equal to ""
> // 2. $p consists of a datetime in YYYYMMDDHHMMSS format
> // example: 19980421220134
>
> if ( ! isset($p) ) return FALSE;
> if ( ! ereg("^([0-9]{14})$",$p) ) return FALSE;
>
> $y = substr($p,0,4);
> $m = substr($p,4,2);
> $d = substr($p,6,2);
> $h = substr($p,8,2);
> $min = substr($p,10,2);
> $s = substr($p,12,2);
>
> if ( ! IsValidDate2($y,$m,$d) ) return FALSE;
> if ( ! IsValidTime2($h,$min,$s) ) return FALSE;
>
> return TRUE;
> }
>
> function TestVF($type,$fn,$v,$p) {
>
> // TestVF = TestValidationFunction
>
> // example 1:
> TestVF("integer","IsValidInteger",TRUE,"15"); //
> ok, 15 is a valid integer, so print nothing
> // example 2:
> TestVF("integer","IsValidInteger",FALSE,"15"); //
> error, 15 *is* a valid integer, so print error
> // example 3:
> TestVF("integer","IsValidInteger",FALSE,"abc"); //
> ok, "abc" is NOT a valid integer, so print nothing
> // example 4:
> TestVF("integer","IsValidInteger",TRUE,"abc"); //
> error, "abc" is NOT a valid integer, so print error
>
> $IsValid = $fn($p);
> if ( $v ) {
> if ( $IsValid ) return;
> echo "error, is NOT a valid $type: " . $p . "<BR>\n";
> } else {
> if ( ! $IsValid ) return;
> echo "error, *is* a valid $type: " . $p . "<BR>\n";
> }
> }
>
> function TestDatesNumbers() {
>
> echo "The test is sucessful if nothing else gets printed below
> this.<BR>\n";
>
> // x1F = cc
> // x20 = space
> // x21 = !
> // ...
> // x7D = }
> // x7E = ~
> // x7F = cc
>
> TestVF("string","IsValidString",TRUE, "");
> TestVF("string","IsValidString",TRUE, "asdfasdf");
> TestVF("string","IsValidString",FALSE, "asdf\nasdf");
> // contains \n
> TestVF("string","IsValidString",FALSE, "abcd" . chr(0)
> . "asdf");
> // contains chr(0)
> TestVF("string","IsValidString",FALSE, "abcd\x1Fasdf");
> // contains cc
> TestVF("string","IsValidString",TRUE, "abcd asdf");
> TestVF("string","IsValidString",TRUE, "abcd~asdf");
> TestVF("string","IsValidString",FALSE, "abcd\x7Fasdf");
> // contains cc
>
> TestVF("memo","IsValidMemo",TRUE, "");
> TestVF("memo","IsValidMemo",TRUE, "asdfasdf");
> TestVF("memo","IsValidMemo",TRUE, "asdf\nasdf");
> TestVF("memo","IsValidMemo",TRUE, "asdf\rasdf");
> TestVF("memo","IsValidMemo",TRUE, "asdf\r\nnasdf");
> TestVF("memo","IsValidMemo",FALSE, "abcd" . chr(0)
> . "asdf");
> // contains chr(0)
> TestVF("memo","IsValidMemo",FALSE, "abcd\x1Fasdf");
> // contains cc
> TestVF("memo","IsValidMemo",TRUE, "abcd asdf");
> TestVF("memo","IsValidMemo",TRUE, "abcd~asdf");
> TestVF("memo","IsValidMemo",FALSE, "abcd\x7Fasdf");
> // contains cc
>
> // digits / 0-9 :
>
> TestVF("integer","IsValidInteger",FALSE, "");
> //
> blank
> TestVF("integer","IsValidInteger",TRUE, "0");
> TestVF("integer","IsValidInteger",FALSE, " 0");
> //
> leading space not allowed
> TestVF("integer","IsValidInteger",FALSE, "+0");
> //
> plus sign not allowed
> TestVF("integer","IsValidInteger",TRUE, "-0");
> TestVF("integer","IsValidInteger",FALSE, "0+");
> //
> trailing plus sign not allowed
> TestVF("integer","IsValidInteger",FALSE, "0-");
> //
> trailing minus sign not allowed
> TestVF("integer","IsValidInteger",TRUE, "1");
> TestVF("integer","IsValidInteger",FALSE, "+1");
> //
> plus sign not allowed
> TestVF("integer","IsValidInteger",TRUE, "-1");
> TestVF("integer","IsValidInteger",FALSE, "1+");
> //
> trailing plus sign not allowed
> TestVF("integer","IsValidInteger",FALSE, "1-");
> //
> trailing minus sign not allowed
> TestVF("integer","IsValidInteger",TRUE, "11");
> TestVF("integer","IsValidInteger",FALSE, "+11");
> //
> plus sign not allowed
> TestVF("integer","IsValidInteger",TRUE, "-11");
> TestVF("integer","IsValidInteger",FALSE, "11+");
> //
> trailing plus sign not allowed
> TestVF("integer","IsValidInteger",FALSE, "11-");
> //
> trailing minus sign not allowed
> TestVF("integer","IsValidInteger",FALSE, "+-1");
> //
> plus sign not allowed
> TestVF("integer","IsValidInteger",FALSE, "-+1");
> //
> plus sign not allowed
> TestVF("integer","IsValidInteger",FALSE, "1+-");
> //
> plus sign not allowed
> TestVF("integer","IsValidInteger",FALSE, "1-+");
> //
> plus sign not allowed
> TestVF("integer","IsValidInteger",FALSE, "1+1");
> //
> plus sign not allowed
> TestVF("integer","IsValidInteger",FALSE, "1-1");
> //
> minus sign must be leftmost character
> TestVF("integer","IsValidInteger",FALSE, "1o1");
> // o
> not allowed
> TestVF("integer","IsValidInteger",TRUE,
> "243095230982340982360923460972362356236");
> TestVF("integer","IsValidInteger",TRUE,
> "-243095230982340982360923460972362356236");
> TestVF("integer","IsValidInteger",FALSE, "
> -243095230982340982360923460972362356236"); // leading
> space not allowed
> TestVF("integer","IsValidInteger",FALSE,
> "3214532.43"); //
> decimal point not allowed in an integer
> TestVF("integer","IsValidInteger",FALSE, "/32");
> //
> contains /
> TestVF("integer","IsValidInteger",TRUE, "0");
> TestVF("integer","IsValidInteger",TRUE, "9");
> TestVF("integer","IsValidInteger",FALSE, ":");
> //
> contains :
>
> TestVF("real","IsValidReal",FALSE, ""); // blank
> TestVF("real","IsValidReal",FALSE, "0"); // no
> decimal point
> TestVF("real","IsValidReal",FALSE, "1"); // no
> decimal point
> TestVF("real","IsValidReal",TRUE, "1.1");
> TestVF("real","IsValidReal",FALSE, "1.");
> // no digit
> to the right of decimal point
> TestVF("real","IsValidReal",FALSE, ".1");
> // no digit
> to the left of decimal point
> TestVF("real","IsValidReal",FALSE, "-1"); // no
> decimal point
> TestVF("real","IsValidReal",TRUE, "-1.1");
> TestVF("real","IsValidReal",FALSE, " -1.1");
> // leading
> space not allowed
>
> TestVF("date","IsValidDate",FALSE, ""); // blank
> TestVF("date","IsValidDate",TRUE, "2000-05-24");
> TestVF("date","IsValidDate",FALSE, "sdghsdh");
> // contains
> alpha characters
> TestVF("date","IsValidDate",FALSE, "4/5/98");
> // contains
> slashes
> TestVF("date","IsValidDate",FALSE, "2000-9-7"); // not
> YYYY-MM-DD format
> TestVF("date","IsValidDate",TRUE, "2000-09-07");
> TestVF("date","IsValidDate",FALSE, "2000-09-31");
> // 30 days
> has september
> TestVF("date","IsValidDate",FALSE, "2000-09-00");
> // day must
> be 01 thru 31
> TestVF("date","IsValidDate",FALSE, "2000-19-07"); // month
> must be 01 thru 12
> TestVF("date","IsValidDate",FALSE, "2000-00-00");
> // non-valid
> month and day
> TestVF("date","IsValidDate",FALSE, "2000-01-32");
> // day must
> be 01 thru 31
> TestVF("date","IsValidDate",TRUE, "2000-02-28");
> TestVF("date","IsValidDate",TRUE, "2000-02-29");
> TestVF("date","IsValidDate",FALSE, "2000-02-30");
> // days in
> feb must be 01 thru 29
> TestVF("date","IsValidDate",TRUE, "1999-02-28");
> TestVF("date","IsValidDate",FALSE, "1999-02-29");
> // 1999 was
> not a leap year
> TestVF("date","IsValidDate",FALSE, "1999-02-30");
> // days in
> feb must be 01 thru 29
>
> TestVF("time","IsValidTime",FALSE, ""); // blank
> TestVF("time","IsValidTime",TRUE, "20:05:24");
> TestVF("time","IsValidTime",FALSE, "sdghsdh");
> // contains
> alpha characters
> TestVF("time","IsValidTime",FALSE, "4/5/98");
> // contains
> slashes
> TestVF("time","IsValidTime",FALSE, "20:9:7"); // not
> HH:MM:SS format
> TestVF("time","IsValidTime",TRUE, "20:09:07");
> TestVF("time","IsValidTime",FALSE, "24:09:07");
> // hour must
> be 00 thru 23
> TestVF("time","IsValidTime",FALSE, "20:60:07");
> // minute
> must be 00 thru 59
> TestVF("time","IsValidTime",FALSE, "20:07:60");
> // second
> must be 00 thru 59
>
> TestVF("datetime","IsValidDateTime",FALSE, "");
> // blank
> TestVF("datetime","IsValidDateTime",TRUE, "2000-06-06
> 20:05:24");
> TestVF("datetime","IsValidDateTime",FALSE, "2000-06-06
> 20:05:24"); // 2 spaces between date and time
> TestVF("datetime","IsValidDateTime",FALSE,
> "2000-06-0620:05:24"); // 0 spaces between
> date and time
> TestVF("datetime","IsValidDateTime",FALSE, "2000-06-6
> 20:05:24"); // non-valid date format
> TestVF("datetime","IsValidDateTime",FALSE, "2000-06-06
> 20:5:24"); // non-valid time format
> TestVF("datetime","IsValidDateTime",FALSE, "2000-06-06");
> // time missing
> TestVF("datetime","IsValidDateTime",FALSE, "20:05:24");
> // date missing
> TestVF("datetime","IsValidDateTime",FALSE, "20:05:24
> 2000-06-06"); // date and time order reversed
>
> TestVF("timestamp","IsValidTimeStamp",FALSE, "");
> // blank
> TestVF("timestamp","IsValidTimeStamp",TRUE,
> "20000606200524");
> TestVF("timestamp","IsValidTimeStamp",FALSE,
> "2000066200524");
> // non-valid date format
> TestVF("timestamp","IsValidTimeStamp",FALSE,
> "2000060620524");
> // non-valid time format
> TestVF("timestamp","IsValidTimeStamp",FALSE, "20000606");
> // time missing
> TestVF("timestamp","IsValidTimeStamp",FALSE, "200524");
> // date missing
> TestVF("timestamp","IsValidTimeStamp",FALSE,
> "20052420000606");
> // date and time order reversed
>
> TestVF("boolean","IsValidBoolean",FALSE, "");
> //
> blank
> TestVF("boolean","IsValidBoolean",TRUE, "true");
> TestVF("boolean","IsValidBoolean",TRUE, "false");
> TestVF("boolean","IsValidBoolean",TRUE, "TRUE");
> TestVF("boolean","IsValidBoolean",TRUE, "FALSE");
> TestVF("boolean","IsValidBoolean",FALSE, "t");
> //
> must be 'true' or 'false'
> TestVF("boolean","IsValidBoolean",FALSE, "f");
> //
> ditto
> TestVF("boolean","IsValidBoolean",FALSE, "0");
> //
> ditto
> TestVF("boolean","IsValidBoolean",FALSE, "1");
> //
> ditto
>
> // uncomment the next 2 to test TestVF()
> // TestVF("boolean","IsValidBoolean",TRUE, "1");
> //
> ditto
> // TestVF("boolean","IsValidBoolean",FALSE,
> "true"); //
> ditto
>
> echo "done testing.\n";
> }
>
> TestDatesNumbers();
>
> ?>
>
>
>
> -----Original Message-----
> From: phpman [mailto:[EMAIL PROTECTED]]
> Sent: Sunday, March 18, 2001 1:44 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] how do i get a variable type? - not that simple
>
>
> No guys. that doesn't work. Take this code for example...
>
> $a="3";
> echo(gettype($a));
>
> this returns string
> i need to find it as an integer or real or float for the sql.
> which by the
> way is MySQL.
>
> thank you for responding, but I already know that gettype and
> all the other
> is_* don't work for this.
>
>
>
> ""phpman"" <[EMAIL PROTECTED]> wrote in message
> 99132e$ol8$[EMAIL PROTECTED]">news:99132e$ol8$[EMAIL PROTECTED]...
> > hello all,
> >
> > let's say i have this:
> > $a="varone=hello world|vartwo=2.44|varthree=100|";
> >
> > now i do this:
> >
> > $b=explode('|',$a);
> > $z=count($b);
> > for ($x=0;$x<$z;$x++) {
> > $tmp=explode('=',$b[$x]);
> > ....
> >
> > and i want to find out if $tmp[1] is a string or an integer (that's
> really
> > all I need to determine so i can put
> > together an SQL statement that puts single quotes around
> strings and none
> > around integers). Obviously
> > i won't know at design time all of the variables and their
> values. Thank
> > you.
> >
> > -dave
> >
> >
> >
> > --
> > 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]
>
You could take advantage of the type conversion performed by php as
demonstrated in this snippet (the trick is in multiplying $value by 1). if
you need to distinguish further between doubles and floats you can do a
regex on $value once you've established it's type:
<?php
$a[] = "1234";
$a[] = "1234.567";
$a[] = "1.234e-8";
$a[] = "3oranges";
foreach($a as $value) {
print($value.": ");
if(is_numeric($value)) {
$tmp = 1 * $value;
printf("is %s<BR>\n", gettype($tmp));
}
else print("is not a number");
}
?>
Moody
-----Original Message-----
From: Johnson, Kirk [mailto:[EMAIL PROTECTED]]
Sent: 19 March 2001 15:55
To: [EMAIL PROTECTED]
Subject: RE: [PHP] how do i get a variable type? - not that simple
Jim,
Thanks for sharing all your hard work. Have you seen checkdate()?
http://www.php.net/manual/en/function.checkdate.php
Kirk
> -----Original Message-----
> From: Ide, Jim [mailto:[EMAIL PROTECTED]]
> Sent: Monday, March 19, 2001 6:38 AM
> To: 'phpman'; [EMAIL PROTECTED]
> Subject: RE: [PHP] how do i get a variable type? - not that simple
>
>
> These are the functions I use to determine if
> a string value is a valid integer, real, date, etc.
> Hope this helps.
>
> ps - please let me know if you find any errors. thanx.
>
> <?php
>
> function IsValidBoolean($p) {
> if ( isset($p) ) {
> if ((strtolower($p) == "true") or (strtolower($p) ==
> "false")) return TRUE;
> }
> return FALSE;
> }
>
> function IsValidMemo($p) {
>
> // If $p contains any characters other than printable ascii,
> // or \r or \n, return FALSE.
>
> if (trim($p) == "") return TRUE;
> if ( ereg("[^\r\n\x20-\x7E]", $p) ) return FALSE;
> return TRUE;
> }
>
> function IsValidString($p) {
>
> // If $p contains any characters other than printable ascii,
> // return FALSE.
>
> if (trim($p) == "") return TRUE;
> if ( ereg("[^\x20-\x7E]", $p) ) return FALSE;
> return TRUE;
> }
>
> function IsValidInteger($p) {
>
> // return TRUE if:
> // 1. $p is not equal to ""
> // 2. $p consists of 1 or more digits, optionally preceded by a
> minus sign
>
> if ( isset($p) ) return ereg("^\-?[0-9]+$",$p);
> return FALSE;
> }
>
> function IsValidReal($p) {
>
> // return TRUE if:
> // 1. $p is not equal to ""
> // 2. $p begins with optional minus sign, followed by 1 or more
> digits, followed by a decimal point,
> // followed by 1 or more digits
> // 3. $p can be optionally preceded by a minus sign
>
> if ( isset($p) ) return ereg("^\-?[0-9]+\.[0-9]+$",$p);
> return FALSE;
> }
>
> function IsLeapYear($y) {
> if ( (($y % 4) == 0) && (($y % 100) != 0) || (($y % 400) == 0))
> return TRUE;
> return FALSE;
> }
>
> function IsValidDate($p) {
>
> // return TRUE if:
> // 1. $p is not equal to ""
> // 2. $p consists of 4 digits followed by minus sign,
> followed by 2
> digits, followed by
> // minus sign, followed by 2 digits
> // example 1995-02-03
>
> if ( ! isset($p) )
> return FALSE;
> if ( ! ereg("^([0-9]{4})\-([0-9]{2})\-([0-9]{2})$",$p) )
> return FALSE;
>
> $t = explode("-",$p);
> if ( count($t) != 3 ) return FALSE;
> $y = $t[0];
> $m = $t[1];
> $d = $t[2];
>
> return IsValidDate2($y,$m,$d);
> }
>
> function IsValidDate2($y,$m,$d) {
>
> if ( ($m < 1) or ($m > 12) ) return FALSE;
> if ( ($d < 1) or ($d > 31) ) return FALSE;
>
> // 30 days has sept, apr, jun, and nov (all the rest
> have 31 [except
> for feb])
> // 9 4 6 11
>
> if ( ($m == 4) or ($m == 6) or ($m == 9) or ($m == 11) ) {
> if ($d > 30) return FALSE;
> } elseif ($m == 2) {
> if ( IsLeapYear($y) ) {
> if ( $d > 29 ) return FALSE;
> } else {
> if ( $d > 28 ) return FALSE;
> }
> }
> return TRUE;
> }
>
> function IsValidTime($p) {
>
> // return TRUE if:
> // 1. $p is not equal to ""
> // 2. $p consists of 2 digits in the range 00 to 23,
> // followed by a colon,
> // followed by 2 digits in the range 00 to 59,
> // followed by a colon,
> // followed by 2 digits in the range 00 to 59.
> // example 14:45:02
>
> if ( ! isset($p) )
> return FALSE;
> if ( ! ereg("^([0-9]{2})\:([0-9]{2})\:([0-9]{2})$",$p) )
> return FALSE;
>
> $t = explode(":",$p);
> if ( count($t) != 3 ) return FALSE;
> $h = $t[0];
> $m = $t[1];
> $s = $t[2];
>
> return IsValidTime2($h,$m,$s);
> }
>
> function IsValidTime2($h,$m,$s) {
>
> if ( ($h < 0) or ($h > 23) ) return FALSE;
> if ( ($m < 0) or ($m > 59) ) return FALSE;
> if ( ($s < 0) or ($s > 59) ) return FALSE;
>
> return TRUE;
> }
>
> function IsValidDateTime($p) {
>
> // return TRUE if:
> // 1. $p is not equal to ""
> // 2. $p consists of a valid date (validated by
> IsValidDate() above)
> // followed by a space
> // followed by a valid time (validated by
> IsValidTime() above)
> // example: 1998-04-21 22:01:34
>
> if ( ! isset($p) ) return FALSE;
>
> $temp = explode(" ",$p);
> if ( count($temp) != 2 ) return FALSE;
> $d = $temp[0];
> $t = $temp[1];
> if ( ! IsValidDate($d) ) return FALSE;
> if ( ! IsValidTime($t) ) return FALSE;
>
> return TRUE;
> }
>
> function IsValidTimeStamp($p) {
>
> // return TRUE if:
> // 1. $p is not equal to ""
> // 2. $p consists of a datetime in YYYYMMDDHHMMSS format
> // example: 19980421220134
>
> if ( ! isset($p) ) return FALSE;
> if ( ! ereg("^([0-9]{14})$",$p) ) return FALSE;
>
> $y = substr($p,0,4);
> $m = substr($p,4,2);
> $d = substr($p,6,2);
> $h = substr($p,8,2);
> $min = substr($p,10,2);
> $s = substr($p,12,2);
>
> if ( ! IsValidDate2($y,$m,$d) ) return FALSE;
> if ( ! IsValidTime2($h,$min,$s) ) return FALSE;
>
> return TRUE;
> }
>
> function TestVF($type,$fn,$v,$p) {
>
> // TestVF = TestValidationFunction
>
> // example 1:
> TestVF("integer","IsValidInteger",TRUE,"15"); //
> ok, 15 is a valid integer, so print nothing
> // example 2:
> TestVF("integer","IsValidInteger",FALSE,"15"); //
> error, 15 *is* a valid integer, so print error
> // example 3:
> TestVF("integer","IsValidInteger",FALSE,"abc"); //
> ok, "abc" is NOT a valid integer, so print nothing
> // example 4:
> TestVF("integer","IsValidInteger",TRUE,"abc"); //
> error, "abc" is NOT a valid integer, so print error
>
> $IsValid = $fn($p);
> if ( $v ) {
> if ( $IsValid ) return;
> echo "error, is NOT a valid $type: " . $p . "<BR>\n";
> } else {
> if ( ! $IsValid ) return;
> echo "error, *is* a valid $type: " . $p . "<BR>\n";
> }
> }
>
> function TestDatesNumbers() {
>
> echo "The test is sucessful if nothing else gets printed below
> this.<BR>\n";
>
> // x1F = cc
> // x20 = space
> // x21 = !
> // ...
> // x7D = }
> // x7E = ~
> // x7F = cc
>
> TestVF("string","IsValidString",TRUE, "");
> TestVF("string","IsValidString",TRUE, "asdfasdf");
> TestVF("string","IsValidString",FALSE, "asdf\nasdf");
> // contains \n
> TestVF("string","IsValidString",FALSE, "abcd" . chr(0)
> . "asdf");
> // contains chr(0)
> TestVF("string","IsValidString",FALSE, "abcd\x1Fasdf");
> // contains cc
> TestVF("string","IsValidString",TRUE, "abcd asdf");
> TestVF("string","IsValidString",TRUE, "abcd~asdf");
> TestVF("string","IsValidString",FALSE, "abcd\x7Fasdf");
> // contains cc
>
> TestVF("memo","IsValidMemo",TRUE, "");
> TestVF("memo","IsValidMemo",TRUE, "asdfasdf");
> TestVF("memo","IsValidMemo",TRUE, "asdf\nasdf");
> TestVF("memo","IsValidMemo",TRUE, "asdf\rasdf");
> TestVF("memo","IsValidMemo",TRUE, "asdf\r\nnasdf");
> TestVF("memo","IsValidMemo",FALSE, "abcd" . chr(0)
> . "asdf");
> // contains chr(0)
> TestVF("memo","IsValidMemo",FALSE, "abcd\x1Fasdf");
> // contains cc
> TestVF("memo","IsValidMemo",TRUE, "abcd asdf");
> TestVF("memo","IsValidMemo",TRUE, "abcd~asdf");
> TestVF("memo","IsValidMemo",FALSE, "abcd\x7Fasdf");
> // contains cc
>
> // digits / 0-9 :
>
> TestVF("integer","IsValidInteger",FALSE, "");
> //
> blank
> TestVF("integer","IsValidInteger",TRUE, "0");
> TestVF("integer","IsValidInteger",FALSE, " 0");
> //
> leading space not allowed
> TestVF("integer","IsValidInteger",FALSE, "+0");
> //
> plus sign not allowed
> TestVF("integer","IsValidInteger",TRUE, "-0");
> TestVF("integer","IsValidInteger",FALSE, "0+");
> //
> trailing plus sign not allowed
> TestVF("integer","IsValidInteger",FALSE, "0-");
> //
> trailing minus sign not allowed
> TestVF("integer","IsValidInteger",TRUE, "1");
> TestVF("integer","IsValidInteger",FALSE, "+1");
> //
> plus sign not allowed
> TestVF("integer","IsValidInteger",TRUE, "-1");
> TestVF("integer","IsValidInteger",FALSE, "1+");
> //
> trailing plus sign not allowed
> TestVF("integer","IsValidInteger",FALSE, "1-");
> //
> trailing minus sign not allowed
> TestVF("integer","IsValidInteger",TRUE, "11");
> TestVF("integer","IsValidInteger",FALSE, "+11");
> //
> plus sign not allowed
> TestVF("integer","IsValidInteger",TRUE, "-11");
> TestVF("integer","IsValidInteger",FALSE, "11+");
> //
> trailing plus sign not allowed
> TestVF("integer","IsValidInteger",FALSE, "11-");
> //
> trailing minus sign not allowed
> TestVF("integer","IsValidInteger",FALSE, "+-1");
> //
> plus sign not allowed
> TestVF("integer","IsValidInteger",FALSE, "-+1");
> //
> plus sign not allowed
> TestVF("integer","IsValidInteger",FALSE, "1+-");
> //
> plus sign not allowed
> TestVF("integer","IsValidInteger",FALSE, "1-+");
> //
> plus sign not allowed
> TestVF("integer","IsValidInteger",FALSE, "1+1");
> //
> plus sign not allowed
> TestVF("integer","IsValidInteger",FALSE, "1-1");
> //
> minus sign must be leftmost character
> TestVF("integer","IsValidInteger",FALSE, "1o1");
> // o
> not allowed
> TestVF("integer","IsValidInteger",TRUE,
> "243095230982340982360923460972362356236");
> TestVF("integer","IsValidInteger",TRUE,
> "-243095230982340982360923460972362356236");
> TestVF("integer","IsValidInteger",FALSE, "
> -243095230982340982360923460972362356236"); // leading
> space not allowed
> TestVF("integer","IsValidInteger",FALSE,
> "3214532.43"); //
> decimal point not allowed in an integer
> TestVF("integer","IsValidInteger",FALSE, "/32");
> //
> contains /
> TestVF("integer","IsValidInteger",TRUE, "0");
> TestVF("integer","IsValidInteger",TRUE, "9");
> TestVF("integer","IsValidInteger",FALSE, ":");
> //
> contains :
>
> TestVF("real","IsValidReal",FALSE, ""); // blank
> TestVF("real","IsValidReal",FALSE, "0"); // no
> decimal point
> TestVF("real","IsValidReal",FALSE, "1"); // no
> decimal point
> TestVF("real","IsValidReal",TRUE, "1.1");
> TestVF("real","IsValidReal",FALSE, "1.");
> // no digit
> to the right of decimal point
> TestVF("real","IsValidReal",FALSE, ".1");
> // no digit
> to the left of decimal point
> TestVF("real","IsValidReal",FALSE, "-1"); // no
> decimal point
> TestVF("real","IsValidReal",TRUE, "-1.1");
> TestVF("real","IsValidReal",FALSE, " -1.1");
> // leading
> space not allowed
>
> TestVF("date","IsValidDate",FALSE, ""); // blank
> TestVF("date","IsValidDate",TRUE, "2000-05-24");
> TestVF("date","IsValidDate",FALSE, "sdghsdh");
> // contains
> alpha characters
> TestVF("date","IsValidDate",FALSE, "4/5/98");
> // contains
> slashes
> TestVF("date","IsValidDate",FALSE, "2000-9-7"); // not
> YYYY-MM-DD format
> TestVF("date","IsValidDate",TRUE, "2000-09-07");
> TestVF("date","IsValidDate",FALSE, "2000-09-31");
> // 30 days
> has september
> TestVF("date","IsValidDate",FALSE, "2000-09-00");
> // day must
> be 01 thru 31
> TestVF("date","IsValidDate",FALSE, "2000-19-07"); // month
> must be 01 thru 12
> TestVF("date","IsValidDate",FALSE, "2000-00-00");
> // non-valid
> month and day
> TestVF("date","IsValidDate",FALSE, "2000-01-32");
> // day must
> be 01 thru 31
> TestVF("date","IsValidDate",TRUE, "2000-02-28");
> TestVF("date","IsValidDate",TRUE, "2000-02-29");
> TestVF("date","IsValidDate",FALSE, "2000-02-30");
> // days in
> feb must be 01 thru 29
> TestVF("date","IsValidDate",TRUE, "1999-02-28");
> TestVF("date","IsValidDate",FALSE, "1999-02-29");
> // 1999 was
> not a leap year
> TestVF("date","IsValidDate",FALSE, "1999-02-30");
> // days in
> feb must be 01 thru 29
>
> TestVF("time","IsValidTime",FALSE, ""); // blank
> TestVF("time","IsValidTime",TRUE, "20:05:24");
> TestVF("time","IsValidTime",FALSE, "sdghsdh");
> // contains
> alpha characters
> TestVF("time","IsValidTime",FALSE, "4/5/98");
> // contains
> slashes
> TestVF("time","IsValidTime",FALSE, "20:9:7"); // not
> HH:MM:SS format
> TestVF("time","IsValidTime",TRUE, "20:09:07");
> TestVF("time","IsValidTime",FALSE, "24:09:07");
> // hour must
> be 00 thru 23
> TestVF("time","IsValidTime",FALSE, "20:60:07");
> // minute
> must be 00 thru 59
> TestVF("time","IsValidTime",FALSE, "20:07:60");
> // second
> must be 00 thru 59
>
> TestVF("datetime","IsValidDateTime",FALSE, "");
> // blank
> TestVF("datetime","IsValidDateTime",TRUE, "2000-06-06
> 20:05:24");
> TestVF("datetime","IsValidDateTime",FALSE, "2000-06-06
> 20:05:24"); // 2 spaces between date and time
> TestVF("datetime","IsValidDateTime",FALSE,
> "2000-06-0620:05:24"); // 0 spaces between
> date and time
> TestVF("datetime","IsValidDateTime",FALSE, "2000-06-6
> 20:05:24"); // non-valid date format
> TestVF("datetime","IsValidDateTime",FALSE, "2000-06-06
> 20:5:24"); // non-valid time format
> TestVF("datetime","IsValidDateTime",FALSE, "2000-06-06");
> // time missing
> TestVF("datetime","IsValidDateTime",FALSE, "20:05:24");
> // date missing
> TestVF("datetime","IsValidDateTime",FALSE, "20:05:24
> 2000-06-06"); // date and time order reversed
>
> TestVF("timestamp","IsValidTimeStamp",FALSE, "");
> // blank
> TestVF("timestamp","IsValidTimeStamp",TRUE,
> "20000606200524");
> TestVF("timestamp","IsValidTimeStamp",FALSE,
> "2000066200524");
> // non-valid date format
> TestVF("timestamp","IsValidTimeStamp",FALSE,
> "2000060620524");
> // non-valid time format
> TestVF("timestamp","IsValidTimeStamp",FALSE, "20000606");
> // time missing
> TestVF("timestamp","IsValidTimeStamp",FALSE, "200524");
> // date missing
> TestVF("timestamp","IsValidTimeStamp",FALSE,
> "20052420000606");
> // date and time order reversed
>
> TestVF("boolean","IsValidBoolean",FALSE, "");
> //
> blank
> TestVF("boolean","IsValidBoolean",TRUE, "true");
> TestVF("boolean","IsValidBoolean",TRUE, "false");
> TestVF("boolean","IsValidBoolean",TRUE, "TRUE");
> TestVF("boolean","IsValidBoolean",TRUE, "FALSE");
> TestVF("boolean","IsValidBoolean",FALSE, "t");
> //
> must be 'true' or 'false'
> TestVF("boolean","IsValidBoolean",FALSE, "f");
> //
> ditto
> TestVF("boolean","IsValidBoolean",FALSE, "0");
> //
> ditto
> TestVF("boolean","IsValidBoolean",FALSE, "1");
> //
> ditto
>
> // uncomment the next 2 to test TestVF()
> // TestVF("boolean","IsValidBoolean",TRUE, "1");
> //
> ditto
> // TestVF("boolean","IsValidBoolean",FALSE,
> "true"); //
> ditto
>
> echo "done testing.\n";
> }
>
> TestDatesNumbers();
>
> ?>
>
>
>
> -----Original Message-----
> From: phpman [mailto:[EMAIL PROTECTED]]
> Sent: Sunday, March 18, 2001 1:44 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] how do i get a variable type? - not that simple
>
>
> No guys. that doesn't work. Take this code for example...
>
> $a="3";
> echo(gettype($a));
>
> this returns string
> i need to find it as an integer or real or float for the sql.
> which by the
> way is MySQL.
>
> thank you for responding, but I already know that gettype and
> all the other
> is_* don't work for this.
>
>
>
> ""phpman"" <[EMAIL PROTECTED]> wrote in message
> 99132e$ol8$[EMAIL PROTECTED]">news:99132e$ol8$[EMAIL PROTECTED]...
> > hello all,
> >
> > let's say i have this:
> > $a="varone=hello world|vartwo=2.44|varthree=100|";
> >
> > now i do this:
> >
> > $b=explode('|',$a);
> > $z=count($b);
> > for ($x=0;$x<$z;$x++) {
> > $tmp=explode('=',$b[$x]);
> > ....
> >
> > and i want to find out if $tmp[1] is a string or an integer (that's
> really
> > all I need to determine so i can put
> > together an SQL statement that puts single quotes around
> strings and none
> > around integers). Obviously
> > i won't know at design time all of the variables and their
> values. Thank
> > you.
> >
> > -dave
> >
> >
> >
> > --
> > 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 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]
You can put this :
SELECT users.name AS name, user_logins.ip AS ip,
UNIX_TIMESTAMP(user_logins.time) AS time FROM users, user_logins WHERE
user_logins.user_id = users.id ORDER BY time ASC GROUP BY users.name
See the GROUP BY statement at mysql docs.
Mario H.C.T.
Jordan Elver wrote:
> Hi,
> I've got a table like:
>
> id user_id ip time
> 1 2 127.0.0.1 20010316105018
>
> Etc, etc.
>
> I do a join on the this table and the users table to get the coresponding
> username to user_id like this:
>
> SELECT users.name AS name, user_logins.ip AS ip,
> UNIX_TIMESTAMP(user_logins.time) AS time FROM users, user_logins WHERE
> user_logins.user_id = users.id ORDER BY time ASC
>
> How can I display the results grouped by username?
>
> So, I want to be able to display:
>
> Logins for John
>
> Thursday 10th
> Friday 12th
> Monday 23rd
>
> Logins for Bob
>
> Monday 1st
> Tuesday 2nd
> Saturday 31st
>
> Thanks for any help,
>
> Jord
>
> --
> PHP Database 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]
I'll show you how you want, but will recommend using arrays.
<?php
$A0 = '0';
$A1 = '1';
$A2 = '2';
$A3 = '3';
if (isset($A1))
{
$i = 0;
$var_name = "A$i";
while(isset($$var_name))
{
// do something
$i++;
$var_name = "A$i";
}
}
?>
heres what you should be doing.
<?php
$A[] = '0';
$A[] = '1';
$A[] = '2';
$A[] = '3';
if (isset($A))
foreach($A as $pos => $val)
// do something
?>
alot simpler, expandible and easier to read. Im sure its probably faster too...
--
Chris Lee
[EMAIL PROTECTED]
"Ekkard Gerlach" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
Hi,
n variables reach
my php-programm by submission:
A0
A1
...
An
Depending on Ai is set I want to run some
actions.
How can I evaluate Ai ??
if (isset (A1) then # entrance
{
i=0;
while( isset($Ai)) { /* Of course $Ai is not working !!! */
{
$B= $Ai
... action ...
}
}
I tried a lot with eval , with backticks, ...
but no suceess.
Anybody an Idea?
tia
Ekkard
--
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]
In defence of zend technologies and open source. Is your php code being used for
profit? then purchase the encoder. Is your code being used for non-profit? then
release it as open source for the community to use.
--
Chris Lee
[EMAIL PROTECTED]
""Chris Anderson"" <[EMAIL PROTECTED]> wrote in message
001901c0b026$6dd9a5c0$bf1412d1@s3e8p3">news:001901c0b026$6dd9a5c0$bf1412d1@s3e8p3...
After realizing that The Zend Encoder is 2000$ I've decided that wont work for a
college student(me). Is there any other way to protect source in my components?
I Agree with that,
Take the same atitude as mysql.
AFAIK, zend encoder is not only for hidding code, but (they say) it
optimizes php processing, if that is true, it is a good and enough reason to
release it for free for users that do open source projects.
you can still publish the original source code, and also, if you like,
compile php for production environments where the load could be high.
if the optimization thing is bogus, then i say stay whith you nice
compiler, congratulations, but you guys have a principle of a compiler within
the php code distribution, so it's not difficult to see the php source, take
the zend engine main things and make a compiler because all the parsing is done
there and execution (zend_compile.c and zend_execute.c).
i'm not a real good c programmer, soh making this alon would take a
while, but one of my goals was make a free php compiler (IF zend wouldn't
release it for non comercial use).
any help would be apreciated of course.
my best wishes.
On 19-Mar-2001 Chris Lee wrote:
> In defence of zend technologies and open source. Is your php code being used
> for profit? then purchase the encoder. Is your code being used for
> non-profit? then release it as open source for the community to use.
>
>
> --
>
> Chris Lee
> [EMAIL PROTECTED]
>
>
>
>
> ""Chris Anderson"" <[EMAIL PROTECTED]> wrote in message
> 001901c0b026$6dd9a5c0$bf1412d1@s3e8p3">news:001901c0b026$6dd9a5c0$bf1412d1@s3e8p3...
> After realizing that The Zend Encoder is 2000$ I've decided that wont work
> for a college student(me). Is there any other way to protect source in my
> components?
>
>
>
> --
> 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]
Rui Barreiros
Software Developer
WEBSOLUT - Soluįões Internet
Emailto: [EMAIL PROTECTED]
Personal Info: http://websolut.net/people/rui.html
As informaįões contidas neste email são confidenciais
e destinam-se apenas ā(s) pessoa(s) a quem foi enviado:
http://websolut.net/confidencialidade-responsabilidade.html
I dont know how good of an idea it is to have 180 variable variable names. oi,
headache. but the question you asked was this.
" $q = 'tar1-1' how do I access the variable $tar1-1 "
no problem
echo $$q;
--
Chris Lee
[EMAIL PROTECTED]
""Per Kallin"" <[EMAIL PROTECTED]> wrote in message
98va5j$3lp$[EMAIL PROTECTED]">news:98va5j$3lp$[EMAIL PROTECTED]...
Hi!
I have a quite big form to fill out a calendar. The form has six fields for
every day in a month to make it possible to set up tree apointments (the
target of the meeting and Locataion), this makes a total of about ~180
fields so I created them with a for-loop.
Now I got this 180 fields named tar1-1, loc1-1, tar2-1, loc2-1 a.s.o. where
the first tree letters tells what information it is, the 4th witch meeting
it is (1-3) and the digits after the minus-sign tells the day of the month
(1-31)
The problem is to get the value out of the variable so i can store it in my
mySQL database. it no problem to create a variable that holds the name of
the variable that contains the data, but then??? The value of the variable
$q is 'tar1-1' and I want to access the variable $tar1-1.....
I can't find any way to solve this, can you? Someone most have created a
calendar like this before...
Please respond to [EMAIL PROTECTED]
/Per Kallin
--
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]
sessions do not allow pages to be cached, when sessions are being used th no-cache
header is set.
GET and POST are very differnt in some areas and very alike in others. obviously the
two biggest changes is that all the variables and their values are in the url bar. I
beleive most browsers have a 1024 limit for data in the url bar, I could be wrong. the
other thing is you'll find spaces suck in url bars.
http://www.mediawaveonline.com/index.php?name=Chris Lee
<?php
echo $name;
?>
will echo
Chris
thats all. the space ends all. you'll have to convert all spaces to %20 or +
http://www.mediawaveonline.com/index.php?name=Chris%20Lee
http://www.mediawaveonline.com/index.php?name=Chris+Lee
--
Chris Lee
[EMAIL PROTECTED]
""Jorge Alvarez"" <[EMAIL PROTECTED]> wrote in message
98u7rj$4nf$[EMAIL PROTECTED]">news:98u7rj$4nf$[EMAIL PROTECTED]...
Hi there,
I was using POST method on all my forms but I had to change them to GET
because of "expired page" errors (I noticed this as soon as I began using
PHP4 sessions).
It seems that GET works well so far, but I wonder if there's something else
I should be aware of. Are both methods equivalent?
TIA,
Jorge Alvarez
--
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]
You can use urlencode() to preserve the spaces. You don't have to any manual
conversions from space to + or something else.
-----Original Message-----
From: Chris Lee [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 19, 2001 9:35 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Change POST for GET
sessions do not allow pages to be cached, when sessions are being used th
no-cache header is set.
GET and POST are very differnt in some areas and very alike in others.
obviously the two biggest changes is that all the variables and their values
are in the url bar. I beleive most browsers have a 1024 limit for data in
the url bar, I could be wrong. the other thing is you'll find spaces suck in
url bars.
http://www.mediawaveonline.com/index.php?name=Chris Lee
<?php
echo $name;
?>
will echo
Chris
thats all. the space ends all. you'll have to convert all spaces to %20 or +
http://www.mediawaveonline.com/index.php?name=Chris%20Lee
http://www.mediawaveonline.com/index.php?name=Chris+Lee
--
Chris Lee
[EMAIL PROTECTED]
""Jorge Alvarez"" <[EMAIL PROTECTED]> wrote in message
98u7rj$4nf$[EMAIL PROTECTED]">news:98u7rj$4nf$[EMAIL PROTECTED]...
Hi there,
I was using POST method on all my forms but I had to change them to GET
because of "expired page" errors (I noticed this as soon as I began using
PHP4 sessions).
It seems that GET works well so far, but I wonder if there's something else
I should be aware of. Are both methods equivalent?
TIA,
Jorge Alvarez
--
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]
everything is working as it should. php handels its own garbage collection, when the
script is over the file is deleted. you will have to copy or move the file somewhere.
or just do something with it and allow php todo its ob and delete it when your done
the script.
ecec("cp $file /somewhere/$file_name");
--
Chris Lee
[EMAIL PROTECTED]
""Thalis A. Kalfigopoulos"" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
Helloppl,
a problem with a file_upload form :-( Here is what I've done so far:
File test.php which has the form is this:
<HTML>
<BODY>
<?php include("handle_upload.php"); ?>
<FORM ENCTYPE="multipart/form-data" ACTION="<?php print $PHP_SELF ?>" METHOD="POST">
<INPUT TYPE="hidden" NAME="MAX_FILE_SIZE" VALUE="64000">
<INPUT TYPE="submit" VALUE="go!">
<INPUT TYPE="file" NAME="up_file">
</FORM>
</BODY>
</HTML>
Here is the included php file (handle_upload.php):
<?php
if(isset($up_file)){
print "<P>You have succesfully sent the following file:<BR>\n";
print "path: $up_file<BR>\n";
print "filename: $up_file_name<BR>\n";
print "filesize: $up_file_size<BR>\n";
print "filetype: $up_file_type<BR>\n";
}
?>
When one submits a file (file exists and is within given MAX_FILE_SIZE boundaries),
the handle_upload.php condition is true, so I get the following output in my browser:
You have succesfully sent the following file:
path: /tmp/phpvtMKjj
filename: test2.jpg
filesize: 27365
filetype: image/jpeg
<and again the form to upload another file>
Then I go and check under /tmp and I do not find anything :-(
I have in my php.ini:
;;;;;;;;;;;;;;;;
; File Uploads ;
;;;;;;;;;;;;;;;;
file_uploads = On
upload_tmp_dir = /tmp
upload_max_filesize = 2M
I am using Apache 1.3.14 with DSO and php is a .so and Php is version 4.0.4
It is not a permissions problem cause I checked the Apache logs, and all dirs that
need to be accessed are actually writable by the httpd user. I have read through
"Handling file uploads" (http://www.php.net/manual/it/features.file-upload.php) and I
don't see what is wrong :-(
thanks ins advance,
thalis
--
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]
Would copy( $file, "somewhare/$file" ) be more platform independent?
--
[EMAIL PROTECTED] (ben@work untill end March)
[EMAIL PROTECTED] (ben@home)
> -----Original Message-----
> From: Chris Lee [SMTP:[EMAIL PROTECTED]]
> Sent: Monday, March 19, 2001 2:38 PM
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP] FileUpload problematic
>
> everything is working as it should. php handels its own garbage
> collection, when the script is over the file is deleted. you will have to
> copy or move the file somewhere. or just do something with it and allow
> php todo its ob and delete it when your done the script.
>
> ecec("cp $file /somewhere/$file_name");
>
>
> --
>
> Chris Lee
> [EMAIL PROTECTED]
>
>
>
> ""Thalis A. Kalfigopoulos"" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Helloppl,
> a problem with a file_upload form :-( Here is what I've done so far:
>
> File test.php which has the form is this:
> <HTML>
> <BODY>
> <?php include("handle_upload.php"); ?>
> <FORM ENCTYPE="multipart/form-data" ACTION="<?php print $PHP_SELF ?>"
> METHOD="POST">
> <INPUT TYPE="hidden" NAME="MAX_FILE_SIZE"
> VALUE="64000">
> <INPUT TYPE="submit" VALUE="go!">
> <INPUT TYPE="file" NAME="up_file">
> </FORM>
> </BODY>
> </HTML>
>
> Here is the included php file (handle_upload.php):
> <?php
> if(isset($up_file)){
> print "<P>You have succesfully sent the following file:<BR>\n";
> print "path: $up_file<BR>\n";
> print "filename: $up_file_name<BR>\n";
> print "filesize: $up_file_size<BR>\n";
> print "filetype: $up_file_type<BR>\n";
> }
> ?>
>
> When one submits a file (file exists and is within given MAX_FILE_SIZE
> boundaries), the handle_upload.php condition is true, so I get the
> following output in my browser:
>
> You have succesfully sent the following file:
> path: /tmp/phpvtMKjj
> filename: test2.jpg
> filesize: 27365
> filetype: image/jpeg
> <and again the form to upload another file>
>
> Then I go and check under /tmp and I do not find anything :-(
>
> I have in my php.ini:
> ;;;;;;;;;;;;;;;;
> ; File Uploads ;
> ;;;;;;;;;;;;;;;;
> file_uploads = On
> upload_tmp_dir = /tmp
> upload_max_filesize = 2M
>
> I am using Apache 1.3.14 with DSO and php is a .so and Php is version
> 4.0.4
>
> It is not a permissions problem cause I checked the Apache logs, and all
> dirs that need to be accessed are actually writable by the httpd user. I
> have read through "Handling file uploads"
> (http://www.php.net/manual/it/features.file-upload.php) and I don't see
> what is wrong :-(
>
>
> thanks ins advance,
> thalis
>
>
> --
> 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]
what if you have three headers depending on what colors a user likes. this favorite
color is stored in a session variable
$fav_color = 'blue_header';
<?php
function blue_header()
{
}
function red_header()
{
}
function green_header()
{
}
include_once('session.egn');
call_user_func($fav_color);
?>
there are obviously easier ways todo this, but its a simple example.
--
Chris Lee
[EMAIL PROTECTED]
""Boget, Chris"" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> http://www.php.net/manual/en/ref.funchand.php
> This page must be your friends.
I took a look at this page (and all the functions referenced
therein). While there must be a use for these functions
otherwise they wouldn't have been included in PHP, I'm at
a total loss as to why anyone would ever use them. Why
wouldn't you just call the function (or do whatever) yourself?
Could anyone offer some insight?
Chris
shame of me for asking that a stupid question, but i don't know how to
remove an element off an associative array. can anybody please tell me, i
didn't find anything about that in faqs or manuals.
thank you
--
[EMAIL PROTECTED]
+49 9721 188848
+49 171 370 97 15
unset()
<?php
$test[0] = 0;
$test[1] = 1;
$test[2] = 2;
$test[3] = 3;
foreach($test as $pos => $val)
echo "$val<br>";
unset($test[2]);
foreach($test as $pos => $val)
echo "$val<br>";
?>
--
Chris Lee
[EMAIL PROTECTED]
""Alexander Gräf"" <[EMAIL PROTECTED]> wrote in message
995d13$cfl$[EMAIL PROTECTED]">news:995d13$cfl$[EMAIL PROTECTED]...
shame of me for asking that a stupid question, but i don't know how to
remove an element off an associative array. can anybody please tell me, i
didn't find anything about that in faqs or manuals.
thank you
--
[EMAIL PROTECTED]
+49 9721 188848
+49 171 370 97 15
--
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]
alex
if you're looking for a pop function, try array_pop.....if you just want to
remove an item and then compact the array, i believe you'll have to hack
together something yourself....check the mailing list archives......
http://marc.theaimsgroup.com/?l=php-general&r=1&w=2
jack
-----Original Message-----
From: Alexander Gräf [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 19, 2001 11:49 AM
To: [EMAIL PROTECTED]
Subject: [PHP] removing element from array
shame of me for asking that a stupid question, but i don't know how to
remove an element off an associative array. can anybody please tell me, i
didn't find anything about that in faqs or manuals.
thank you
--
[EMAIL PROTECTED]
+49 9721 188848
+49 171 370 97 15
--
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]
55 projects found for query 'odbc'
Most of these are simply projects that have the word ODBC
in their description someplace. There seem to be only a handful
of libraries, and some (openlink/easysoft) are commercial
offerings.
I still have not come across any ODBC driver that I can get
a binary or source for, which is free, that I can compile under
Linux to talk ODBC to databases.
What am I missing? I don't think I'm missing anything. I don't think
any are out there - freetds was going to be working on something,
I thought, but apparently that got delayed/shelved.
Yoshi Melrose wrote:
> have you tried out http://freshmeat.net ? do a search for odbc, you'll find
> a few. :)
>
> ----- Original Message -----
> From: "Michael Kimsal" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Monday, March 19, 2001 9:01 AM
> Subject: Re: [PHP] MS SQL databse connecting
>
> > Am I the only one who can not find any free ODBC drivers for Linux?
> > I see countless references to ODBC driver managers, but no ODBC drivers
> > themselves - not free ones anyway.
> >
I know i had one. I used one for a project I had in php.... I'll look for it
and see if I can get it to you. Hmmm.
----- Original Message -----
From: "Michael Kimsal" <[EMAIL PROTECTED]>
To: "Yoshi Melrose" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Monday, March 19, 2001 10:54 AM
Subject: Re: [PHP] MS SQL databse connecting
> 55 projects found for query 'odbc'
>
> Most of these are simply projects that have the word ODBC
> in their description someplace. There seem to be only a handful
> of libraries, and some (openlink/easysoft) are commercial
> offerings.
>
> I still have not come across any ODBC driver that I can get
> a binary or source for, which is free, that I can compile under
> Linux to talk ODBC to databases.
>
> What am I missing? I don't think I'm missing anything. I don't think
> any are out there - freetds was going to be working on something,
> I thought, but apparently that got delayed/shelved.
>
>
>
>
>
> Yoshi Melrose wrote:
>
> > have you tried out http://freshmeat.net ? do a search for odbc, you'll
find
> > a few. :)
> >
> > ----- Original Message -----
> > From: "Michael Kimsal" <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Monday, March 19, 2001 9:01 AM
> > Subject: Re: [PHP] MS SQL databse connecting
> >
> > > Am I the only one who can not find any free ODBC drivers for Linux?
> > > I see countless references to ODBC driver managers, but no ODBC
drivers
> > > themselves - not free ones anyway.
> > >
>
>
Yoshi,
Regardless if you use a commercial or free driver, the only thing you need
to compile with is iODBC, as a Driver Manager. You can then drop in any
ODBC-compliant driver fairly seamlessly. A Howto is available at
www.iodbc.org, but it's mostly a matter of getting the iODBC SDK and
compiling --with-iodbc.
Also, while our drivers are not Open Source, they are free for low-use
environments (2 concurrent database connections).
Please let me know if I may assist in any way.
Best regards,
Andrew
---------------------------------------
Andrew Hill - OpenLink Software
Director Technology Evangelism
eBusiness Infrastructure Technology
http://www.openlinksw.com
On 3/19/01 11:54 AM, "Michael Kimsal" <[EMAIL PROTECTED]> wrote:
> 55 projects found for query 'odbc'
>
> Most of these are simply projects that have the word ODBC
> in their description someplace. There seem to be only a handful
> of libraries, and some (openlink/easysoft) are commercial
> offerings.
>
> I still have not come across any ODBC driver that I can get
> a binary or source for, which is free, that I can compile under
> Linux to talk ODBC to databases.
>
> What am I missing? I don't think I'm missing anything. I don't think
> any are out there - freetds was going to be working on something,
> I thought, but apparently that got delayed/shelved.
>
>
>
>
>
> Yoshi Melrose wrote:
>
>> have you tried out http://freshmeat.net ? do a search for odbc, you'll find
>> a few. :)
>>
>> ----- Original Message -----
>> From: "Michael Kimsal" <[EMAIL PROTECTED]>
>> To: <[EMAIL PROTECTED]>
>> Sent: Monday, March 19, 2001 9:01 AM
>> Subject: Re: [PHP] MS SQL databse connecting
>>
>>> Am I the only one who can not find any free ODBC drivers for Linux?
>>> I see countless references to ODBC driver managers, but no ODBC drivers
>>> themselves - not free ones anyway.
>>>
>
Whups, sorry - looks like that should have been addressed to Michael.
Best regards,
Andrew
On 3/19/01 12:13 PM, "Andrew Hill" <[EMAIL PROTECTED]> wrote:
> Yoshi,
>
> Regardless if you use a commercial or free driver, the only thing you need to
> compile with is iODBC, as a Driver Manager. You can then drop in any
> ODBC-compliant driver fairly seamlessly. A Howto is available at
> www.iodbc.org, but it's mostly a matter of getting the iODBC SDK and compiling
> --with-iodbc.
>
> Also, while our drivers are not Open Source, they are free for low-use
> environments (2 concurrent database connections).
>
> Please let me know if I may assist in any way.
>
> Best regards,
> Andrew
> ---------------------------------------
> Andrew Hill - OpenLink Software
> Director Technology Evangelism
> eBusiness Infrastructure Technology
> http://www.openlinksw.com
>
>
> On 3/19/01 11:54 AM, "Michael Kimsal" <[EMAIL PROTECTED]> wrote:
>
>> 55 projects found for query 'odbc'
>>
>> Most of these are simply projects that have the word ODBC
>> in their description someplace. There seem to be only a handful
>> of libraries, and some (openlink/easysoft) are commercial
>> offerings.
>>
>> I still have not come across any ODBC driver that I can get
>> a binary or source for, which is free, that I can compile under
>> Linux to talk ODBC to databases.
>>
>> What am I missing? I don't think I'm missing anything. I don't think
>> any are out there - freetds was going to be working on something,
>> I thought, but apparently that got delayed/shelved.
>>
>>
>>
>>
>>
>> Yoshi Melrose wrote:
>>
>>> have you tried out http://freshmeat.net ? do a search for odbc, you'll find
>>> a few. :)
>>>
>>> ----- Original Message -----
>>> From: "Michael Kimsal" <[EMAIL PROTECTED]>
>>> To: <[EMAIL PROTECTED]>
>>> Sent: Monday, March 19, 2001 9:01 AM
>>> Subject: Re: [PHP] MS SQL databse connecting
>>>
>>>> Am I the only one who can not find any free ODBC drivers for Linux?
>>>> I see countless references to ODBC driver managers, but no ODBC drivers
>>>> themselves - not free ones anyway.
>>>>
>>
That's it, Thank you Andrew, I knew I had it somewhere.
Michael, this is where you want to go, Andrew hit the nail right on the
head!
----- Original Message -----
From: "Andrew Hill" <[EMAIL PROTECTED]>
To: "Yoshi Melrose" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Monday, March 19, 2001 11:13 AM
Subject: Re: [PHP] MS SQL databse connecting
> Yoshi,
>
> Regardless if you use a commercial or free driver, the only thing you need
> to compile with is iODBC, as a Driver Manager. You can then drop in any
> ODBC-compliant driver fairly seamlessly. A Howto is available at
> www.iodbc.org, but it's mostly a matter of getting the iODBC SDK and
> compiling --with-iodbc.
>
> Also, while our drivers are not Open Source, they are free for low-use
> environments (2 concurrent database connections).
>
> Please let me know if I may assist in any way.
>
> Best regards,
> Andrew
> ---------------------------------------
> Andrew Hill - OpenLink Software
> Director Technology Evangelism
> eBusiness Infrastructure Technology
> http://www.openlinksw.com
>
>
> On 3/19/01 11:54 AM, "Michael Kimsal" <[EMAIL PROTECTED]> wrote:
>
> > 55 projects found for query 'odbc'
> >
> > Most of these are simply projects that have the word ODBC
> > in their description someplace. There seem to be only a handful
> > of libraries, and some (openlink/easysoft) are commercial
> > offerings.
> >
> > I still have not come across any ODBC driver that I can get
> > a binary or source for, which is free, that I can compile under
> > Linux to talk ODBC to databases.
> >
> > What am I missing? I don't think I'm missing anything. I don't think
> > any are out there - freetds was going to be working on something,
> > I thought, but apparently that got delayed/shelved.
> >
> >
> >
> >
> >
> > Yoshi Melrose wrote:
> >
> >> have you tried out http://freshmeat.net ? do a search for odbc, you'll
find
> >> a few. :)
> >>
> >> ----- Original Message -----
> >> From: "Michael Kimsal" <[EMAIL PROTECTED]>
> >> To: <[EMAIL PROTECTED]>
> >> Sent: Monday, March 19, 2001 9:01 AM
> >> Subject: Re: [PHP] MS SQL databse connecting
> >>
> >>> Am I the only one who can not find any free ODBC drivers for Linux?
> >>> I see countless references to ODBC driver managers, but no ODBC
drivers
> >>> themselves - not free ones anyway.
> >>>
> >
>
>
We knew what you mean. ;)
----- Original Message -----
From: "Andrew Hill" <[EMAIL PROTECTED]>
To: "Yoshi Melrose" <[EMAIL PROTECTED]>; "Work"
<[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Monday, March 19, 2001 11:14 AM
Subject: Re: [PHP] MS SQL databse connecting
> Whups, sorry - looks like that should have been addressed to Michael.
>
> Best regards,
> Andrew
>
> On 3/19/01 12:13 PM, "Andrew Hill" <[EMAIL PROTECTED]> wrote:
>
> > Yoshi,
> >
> > Regardless if you use a commercial or free driver, the only thing you
need to
> > compile with is iODBC, as a Driver Manager. You can then drop in any
> > ODBC-compliant driver fairly seamlessly. A Howto is available at
> > www.iodbc.org, but it's mostly a matter of getting the iODBC SDK and
compiling
> > --with-iodbc.
> >
> > Also, while our drivers are not Open Source, they are free for low-use
> > environments (2 concurrent database connections).
> >
> > Please let me know if I may assist in any way.
> >
> > Best regards,
> > Andrew
> > ---------------------------------------
> > Andrew Hill - OpenLink Software
> > Director Technology Evangelism
> > eBusiness Infrastructure Technology
> > http://www.openlinksw.com
> >
> >
> > On 3/19/01 11:54 AM, "Michael Kimsal" <[EMAIL PROTECTED]> wrote:
> >
> >> 55 projects found for query 'odbc'
> >>
> >> Most of these are simply projects that have the word ODBC
> >> in their description someplace. There seem to be only a handful
> >> of libraries, and some (openlink/easysoft) are commercial
> >> offerings.
> >>
> >> I still have not come across any ODBC driver that I can get
> >> a binary or source for, which is free, that I can compile under
> >> Linux to talk ODBC to databases.
> >>
> >> What am I missing? I don't think I'm missing anything. I don't think
> >> any are out there - freetds was going to be working on something,
> >> I thought, but apparently that got delayed/shelved.
> >>
> >>
> >>
> >>
> >>
> >> Yoshi Melrose wrote:
> >>
> >>> have you tried out http://freshmeat.net ? do a search for odbc, you'll
find
> >>> a few. :)
> >>>
> >>> ----- Original Message -----
> >>> From: "Michael Kimsal" <[EMAIL PROTECTED]>
> >>> To: <[EMAIL PROTECTED]>
> >>> Sent: Monday, March 19, 2001 9:01 AM
> >>> Subject: Re: [PHP] MS SQL databse connecting
> >>>
> >>>> Am I the only one who can not find any free ODBC drivers for Linux?
> >>>> I see countless references to ODBC driver managers, but no ODBC
drivers
> >>>> themselves - not free ones anyway.
> >>>>
> >>
>
>
Hi there
I am trying to get the scriplet code from
http://www.phpwizard.net/resources/phpMisc/scripts/pretty/mail.php3
to work for a website I'm building.
I am trying to allow a user to select a file from their hard
drive, and then have that file sent as an email attachment.
Most of the time that file will be a Microsoft Word
document.
I have the code for the file selection all done, and I
integrated the codelet (THANK YOU) into my code, and when I
attach a .jpg file, it works fine, but if I choose a word
doc, it attaches what it thinks is an image.
I changed the line
$mail->add_attachment("$attachment", $copy_filename,
"application/msword");
to reflect the mime type for application/msword, but it
still doesn't work.
What suggestions might you have?
url to see it in action
http://www.emergejobs.com/jen/jen_file_upload.phtml
the submit script that does the file upload then the email
send is below.
thank you SO MUCH
-jen
.
-----
jen_file_upload_submit.phtml:
<html><head><title>Jen's file upload module</title></head>
<BODY bgcolor="#666699" link="#FF9933" text="#FFFFFF"
vlink="#FF8040">
<font face="arial, helvetica, sans-serif">
<P><h1>file upload</h1><P>
<?php
$directory_to_copy_to =
"/home/web/e/emerge/virtual_html/jen/";
function is_uploaded_file($filename) {
if (!$tmp_file = get_cfg_var('upload_tmp_dir')) {
$tmp_file = dirname(tempnam('', ''));
}
$tmp_file .= '/' . basename($filename);
/* User might have trailing slash in php.ini... */
return (ereg_replace('/+', '/', $tmp_file) ==
$filename);
}
if (is_uploaded_file($userfile)) {
$clean_filename = ereg_replace(" ","_",$userfile_name);
$clean_filename = strtoupper($clean_filename);
$copy_filename = $directory_to_copy_to .
$clean_filename;
copy($userfile, $copy_filename);
unlink($userfile);
echo "<P>you uploaded $userfile, <P>this script just
renamed it (and made it all caps) to $clean_filename <P>and
copied it to $copy_filename";
} else {
echo "ERROR there was an error uploading the file:
'$userfile' ($userfile_name).";
}
/*
* Class mime_mail
* Original implementation by
Sascha Schumann <[EMAIL PROTECTED]>
* Modified by Tobias Ratschiller
<[EMAIL PROTECTED]>:
* - General code clean-up
* - separate body- and
from-property
* - killed some mostly
un-necessary stuff
*/
class mime_mail
{
var $parts;
var $to;
var $from;
var $headers;
var $subject;
var $body;
/*
* void mime_mail()
* class constructor
*/
function mime_mail()
{
$this->parts = array();
$this->to = "";
$this->from = "";
$this->subject = "";
$this->body = "";
$this->headers = "";
}
/*
* void add_attachment(string
message, [string name], [string ctype])
* Add an attachment to the
mail object
*/
function add_attachment($message,
$name = "", $ctype = "application/octet-stream")
{
$this->parts[] = array (
"ctype"
=> $ctype,
"message" => $message,
"encode"
=> $encode,
"name"
=> $name
);
}
/*
* void build_message(array
part=
* Build message parts of an
multipart mail
*/
function build_message($part)
{
$message = $part[ "message"];
$message =
chunk_split(base64_encode($message));
$encoding = "base64";
return "Content-Type: ".$part[
"ctype"].
($part[
"name"]? "; name = \"".$part[ "name"]. "\"" : "").
"\nContent-Transfer-Encoding: $encoding\n\n$message\n";
}
/*
* void build_multipart()
* Build a multipart mail
*/
function build_multipart()
{
$boundary =
"b".md5(uniqid(time()));
$multipart = "Content-Type:
multipart/mixed; boundary = $boundary\n\nThis is a MIME
encoded message.\n\n--$boundary";
for($i = sizeof($this->parts)-1;
$i >= 0; $i--)
{
$multipart .=
"\n".$this->build_message($this->parts[$i]). "--$boundary";
}
return $multipart.= "--\n";
}
/*
* void send()
* Send the mail (last
class-function to be called)
*/
function send()
{
$mime = "";
if (!empty($this->from))
$mime .= "From: ".$this->from.
"\n";
if (!empty($this->headers))
$mime .= $this->headers. "\n";
if (!empty($this->body))
$this->add_attachment($this->body, "", "text/plain");
$mime .= "MIME-Version:
1.0\n".$this->build_multipart();
mail($this->to, $this->subject,
"", $mime);
}
}; // end of class
/*
* Example usage
*/
$attachment =
fread(fopen($copy_filename, "r"), filesize($copy_filename));
$mail = new mime_mail();
$mail->from =
"[EMAIL PROTECTED]";
$mail->headers = "Errors-To:
[EMAIL PROTECTED]";
$mail->to =
"[EMAIL PROTECTED]";
$mail->subject = "Testing email
attachment...";
$mail->body = "This is just a
test.";
$mail->add_attachment("$attachment", $copy_filename,
"application/msword");
$mail->send();
?>
<P>end of script.
</body></html>
Hi,
please note: You can *not* fetch results that require earlier results
using the pg_* functions. Explaination: when you submit a query the php
script doesn't know about the content of all rows returned, instead the
interface API makes use of pointers to fetch only the requested rows
from the result.
That said, if you make a second call to pg_exec() consider saving all
the results somewhere else if you need the previous set of results.
Regards,
Nuno Silva
Luca Lazzeroni wrote:
> Thanks; in fact I've tryed the second solution and it works for me; but I
> can't understand why the script stop working during the upgrade of system.
> The most strange thing is that, after a deeper investigation on the code,
> I've found the PHP engine does something like closing the connection after
> the second pg_exec command.
> In fact, by using persistent connections I've partially corrected the
> problem and the codes doesn't complain about using an invalid (but not null)
> connection descriptor; but it stills be unable to get results from
> successive queries, also if result index are valid ! This sounds very
> strange for me.
>
> Thank you for your help !
>
> Luca Lazzeroni
>
> "Nuno Silva" <[EMAIL PROTECTED]> ha scritto nel messaggio
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>
>> Hello,
>>
>> if the second query loops inside a _for_ statement and needs values from
>> the first query you have two options:
>>
>> 1. save all the results from query one to some array and then loop
>> inside the array within the _for_ statement executing new sql;
>> 2. open two separate connections to the database and work with the two.
>> like this:
>> $conn1 = pg_connect(...);
>> $conn2 = pg_connect(...);
>> ...
>> qry1 = pg_exec($conn1, $sql1);
>> ...
>> for ($i=.....) {
>> ...
>> $qry2 = pg_exec($conn2, $sql2);
>> ...
>> }
>>
>> Hope this helps,
>> Nuno Silva
>>
>>
>> Luca Lazzeroni wrote:
>>
>>
>>> Hi,
>>> I've recently migrated a system with PHP 4.0.3pl1 and PostgreSQL 7.0.2 -
>>> RedHat Linux 5.1 (yes 5) to a new one with PHP 4.0.4pl1 - PostgreSQL
>>
> 7.0.2 -
>
>>> RedHat Linux 7.0.
>>>
>>> All my database applications work fine except one which does strange
>>
> things:
>
>>> this is a piece of code:
>>>
>>> ----8<------- CUT ----
>>>
>>> $conn = pg_connect("dbname=aaaa user=yyyyy password=xxxxxx");
>>>
>>> $sql = "select * from table_a where condition_a";
>>> $qry1 = pg_exec ($conn,$sql);
>>>
>>> $obj1 = pg_fetchobject($qry1,0);
>>>
>>> // Until here everything works fine
>>>
>>> $sql2 = "select * from table_b where condition_b=".$obj1->value_a;
>>> $qry2 = pg_exec ($conn,$sql2);
>>>
>>> ----8<------- CUT ----
>>>
>>> The second query is nested in a for-loop running for every object in the
>>> first query; for performance reason I need to maintain the two queries
>>> independent.
>>>
>>> After executing (correctly) the first one, the system starts doing
>>
> strange
>
>>> things with the second one:
>>>
>>> Warning: Unable to jump to row 0 on PostgreSQL result index 23 in
>>
> cerca.php3
>
>>> on line 467
>>>
>>> and it fails to read data.
>>> The strange thing is that the system does the same things for EVERY
>>
> database
>
>>> where I must use two consecutive queries !
>>>
>>> Is there anyone who can help me ?
>>>
>>> Thanks in advance
>>>
>>> Luca Lazzeroni
>>
>>
>> --
>> 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]
>>
I want to insert the Values into my Database like this
$handle = ora_logon("iusr@test","kiwi1");
$cursor1 = ora_open($handle);
$query = "insert into internet_tmp select
rv_ret($FF),$FF,$sesid,(sysdate+0.0021) from dual";
ora_parse($cursor1,$query) or die;
ora_exec($cursor1);
ora_close($cursor1);
tring the insert query on sql-plus works fine what do I do wrong??
oh yea error msg is like this
Warning: Ora_Parse failed (ORA-00923: FROM keyword not found where expected
-- while processing OCI function OPARSE) in test2.php on line 40
line40 is parse line
plaese help is very urgent
rudi
On Tue, 20 Mar 2001 03:32, Rudolf Frint wrote:
> > I want to insert the Values into my Database like this
>
> $handle = ora_logon("iusr@test","kiwi1");
> $cursor1 = ora_open($handle);
> $query = "insert into internet_tmp select
> rv_ret($FF),$FF,$sesid,(sysdate+0.0021) from dual";
> ora_parse($cursor1,$query) or die;
> ora_exec($cursor1);
> ora_close($cursor1);
>
> tring the insert query on sql-plus works fine what do I do wrong??
>
> oh yea error msg is like this
> Warning: Ora_Parse failed (ORA-00923: FROM keyword not found where
> expected -- while processing OCI function OPARSE) in test2.php on line
> 40
>
> line40 is parse line
>
> plaese help is very urgent
> rudi
I'm not an Oracle person, but it sounds like you may have a syntax error
in your SQL. Try echo-ing $query and see how it looks.
--
David Robley | WEBMASTER & Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES | http://www.nisu.flinders.edu.au/
AusEinet | http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA
On Tue, 20 Mar 2001, David Robley wrote:
> On Tue, 20 Mar 2001 03:32, Rudolf Frint wrote:
>
> > > I want to insert the Values into my Database like this
> >
> > $handle = ora_logon("iusr@test","kiwi1");
> > $cursor1 = ora_open($handle);
> > $query = "insert into internet_tmp select
> > rv_ret($FF),$FF,$sesid,(sysdate+0.0021) from dual";
> > ora_parse($cursor1,$query) or die;
> > ora_exec($cursor1);
> > ora_close($cursor1);
> >
> > tring the insert query on sql-plus works fine what do I do wrong??
> >
> > oh yea error msg is like this
> > Warning: Ora_Parse failed (ORA-00923: FROM keyword not found where
> > expected -- while processing OCI function OPARSE) in test2.php on line
> > 40
> >
> > line40 is parse line
> >
> > plaese help is very urgent
> > rudi
>
> I'm not an Oracle person, but it sounds like you may have a syntax error
> in your SQL. Try echo-ing $query and see how it looks.
>
> --
> David Robley | WEBMASTER & Mail List Admin
> RESEARCH CENTRE FOR INJURY STUDIES | http://www.nisu.flinders.edu.au/
> AusEinet | http://auseinet.flinders.edu.au/
> Flinders University, ADELAIDE, SOUTH AUSTRALIA
>
I've had a few troubles with PHP/MySQL with requests like that... Maybe
you could try that (it worked for me) :
$query = "insert into internet_tmp select
rv_ret(\"$FF\"),\"$FF\",$sesid,(sysdate+0.0021) from dual";
the \"$var\" are important : ".$var." won't do, even if with an echo
$query, you _seem_ to get the same results...
--
Ben
As well look for a needle in a bottle of hay.
Miguel de Cervantes
Hello all, hope that everyone had a nice weekend.
I'm new to this form. I am about to install mysql, apache, and php on my linux box
(redhat 7)
I went to the php site, but I'm a little bit lost. I found this link on there but
I dont know if thats the way I have to set it up . I'm setting all these program
for creating a Admin ticket .
Heres the site just in case you guys like to take a look at. I found the site in
the dec issue of linux Joarnal .
http://wwredshift.com/~yramin/atp/irm
Not my question is.
Would this be the right way of setting up php , mysql , and php . Can anyone check
this site out for me.
http://www.linuxguruz.org/z.php?id=31
also can you please tell me on the section were you ./configure the php . Would
I be using the apxs setting or the red hat . Im' sorry if its a stupid question
but I'm new to all this php thing.
Thank you
Luis
Hi,
My site has been working with cookies just fine .... until i discovered
that some browsers (i think it is some browser under MacOS, I'm
investigating) instead of deleting a cookie, set it to value "deleted",
so in my code this variable has a value and believes there is a user
called "deleted" trying to reauth..... a lot users can't login to my
site ater their session times out due to this cause.... My question is,
I am dealing with some new bug of explorer or there is a standard I am
missing? Should I implement in my code this feature doing with "deleted"
cookies? Or maybe it's a php bug? I run php-4.0.4pl1 ....
Thanks in advance
Nikolai
hello list,
i have the problem that netscape 4.6 and more can't allow access to
scripts/documents at another domain
(javascript error). anyway i have a checking_status-script on domain
first.xxx.xx which calls a script on domain second.yyy.yy, ie and netscape
4.0 work quit well with this...
but not 4.6 and more. now i was thinking to manage it with a
(global?)php-variable (same php-modul running on the domains) to communicate
to the script in the second domain...
can somenone help or have some tips?
greeting
tom
---------------------------------------------------------
---------------------------------------------------------
-foerderverein kunst und internet e.V.
-lothringerstr. 23
-D-52062 aachen
thomas schneider
----------------
tel: +49 241.33686 (buero)
mobil: +49 179.4548 234
fax: +49 241.33636
'kulturraum raststaette'
'kulturserver heimat.de'
'kulturdatennetzwerk culturebase.org'
----------------------------------------------------------
Hi,
Matt Williams wrote:
> you could make your links absolute
> ie..
>
> /cat.html
Properly speaking, even this link is relative :-) (it is relative to the
document root of the web server). I like to call such links "impure relative"
links :-). I call links of the type "../cat.html" "pure relative" links ;-)
This type of a link will only work if you're always going to have your pages
served up by a web server (which may be true in your case).
I had wanted to do something similar as far as specifying the path was
concerned. However, in my case, I had to mirror the site on my hard disk and
then work on that too. Therefore, such "impure" relative links would not have
worked for me. I needed to have "pure" relative links so that the whole
structure of the site would hold together even when viewed off the hard disk.
A look at the mail (and the answer to it) titled "Finding the depth" in this
list might prove helpful.
--
Regards,
Harshdeep Singh Jawanda.
Hi,
[EMAIL PROTECTED] wrote:
> What seems crazy to me is that you cant just set a varable (i.e. siteroot)
> in common.inc and refer to URLs at $siteroot."/page.html".
Are you sure that
$siteroot = "$HTTP_HOST:$SERVER_PORT"
doesn't work for you (as an absolute link seems ok to you)? Have a look at
http://www.php.net/manual/it/language.variables.predefined.php
and experiment around.
--
Regards,
Harshdeep Singh Jawanda.
Errata...
Harshdeep S Jawanda wrote:
> $siteroot = "$HTTP_HOST:$SERVER_PORT"
Sorry, this should be
$siteroot = "http://$HTTP_HOST:$SERVER_PORT"
--
Regards,
Harshdeep Singh Jawanda.
Hello,
Has anyone written a nifty little function to add commas to big numbers
like:
1188889 so--> 1,188,889
If so, please share!
Karl
"Karl J. Stubsjoen" wrote:
> Has anyone written a nifty little function to add commas to big numbers
> like:
> 1188889 so--> 1,188,889
See number_format().
-Egon
--
SIX Offene Systeme GmbH · Stuttgart - Berlin
Sielminger Straße 63 · D-70771 Leinfelden-Echterdingen
Fon +49 711 9909164 · Fax +49 711 9909199 http://www.six.de
Besuchen Sie uns auf der CeBIT 2001, Halle 6, Stand F62/4
You can use the built in number_format function.
Check out:
http://www.php.net/manual/en/function.number-format.php
Reuben D. Budiardja
Web Database Application Programmer / Analyst
Devcorps, ITS
Goshen College, IN 46526
At 10:40 AM 3/19/01 -0700, Karl J. Stubsjoen wrote:
>Hello,
>
>Has anyone written a nifty little function to add commas to big numbers
>like:
>1188889 so--> 1,188,889
>
>If so, please share!
>
>Karl
>
>
>
>--
>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]
I have a script that cleans up old files with the unlink () command. On the
page that runs the script I get;
Warning: Unlink failed (Permission denied) in
/public/tbldr/public/demo/request/step2.php4 on line 152
However when I check to see if the files are removed, there gone! It appears
they're unlinking even though I'm getting a warning they are not unlinking.
I have another script on the same page that will unlink a file if it's too
big and it works fine. The only difference, on the script that works I'm
deleting files that I am trying to upload at that moment. On the script that
doesn't work, I query the database to find files that were posted by others
which are 24 hours old and then delete them.
Thanks in advance.
>>.>>.>>>.>>>>>.>>>>>>>>>.>>>>>>>>
Tom Beidler
Orbit Tech Services
805.682.8972 (phone)
805.682.5833 (fax)
[EMAIL PROTECTED]
http://www.orbittechservices.com/
>>.>>.>>>.>>>>>.>>>>>>>>>.>>>>>>>>
on 3/19/01 7:08 AM, Jason Stechschulte at [EMAIL PROTECTED] wrote:
> On Sun, Mar 18, 2001 at 05:38:36PM -0800, Tom Beidler wrote:
>> I'm trying to create a pulldown menu with distinct names from the found set.
>> For some reason I never get the last name. Here's my code;
>>
>> $contact_query = "SELECT DISTINCT name FROM request"
>> . " WHERE id <= '5' OR demo_id = '$demo_id'"
>> . " ORDER BY name";
>> $contact_result = mysql_query ($contact_query)
>> or die ("Cannot build contact");
>>
>> while ($contact_row = mysql_fetch_array ($contact_result))
>> {
>> $name = $contact_row["name"];
>> $option_contact .= "<OPTION value=\"$name\">$name</OPTION>\n";
>> }
>>
>> What gives?
>
> I have not seen anything wrong with this portion of code. Have you
> tried echoing $contact_row["name"] inside the loop to make sure this is
> the portion of your code that is broken?
>
> --
> Jason Stechschulte
> [EMAIL PROTECTED]
> --
> All language designers are arrogant. Goes with the territory... :-)
> -- Larry Wall in <[EMAIL PROTECTED]
Urgh! I forgot to "globalize" the cookie $demo_id! Amazing how it's always
something simple!
>>.>>.>>>.>>>>>.>>>>>>>>>.>>>>>>>>
Tom Beidler
Orbit Tech Services
805.682.8972 (phone)
805.682.5833 (fax)
[EMAIL PROTECTED]
http://www.orbittechservices.com/
>>.>>.>>>.>>>>>.>>>>>>>>>.>>>>>>>>
Hi All,
I am looking for some sites that host PHP. I can't really afford to pay for
hosting space anymore, so I was wondering if there were any good (free) web
hosts, that had PHP and/or MySQL.
I would like to get a fast and stable place to host my files, but if there
was a preference, I would probably prefer a more stable place that's not
on/offline a lot.
Any links/help is much appreciated.
_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
> Hi All,
>
> I am looking for some sites that host PHP. I can't really afford to pay for
> hosting space anymore, so I was wondering if there were any good (free) web
> hosts, that had PHP and/or MySQL.
>
> I would like to get a fast and stable place to host my files, but if there
> was a preference, I would probably prefer a more stable place that's not
> on/offline a lot.
>
> Any links/help is much appreciated.
Not sure about stability but here is one in the UK:
http://www.f2s.com/
Jeff Oien
PHP >start here - Web site coming soon
Try these guys :)
----- Original Message -----
From: Jeff Oien <[EMAIL PROTECTED]>
To: PHP <[EMAIL PROTECTED]>
Sent: Monday, March 19, 2001 12:43 PM
Subject: RE: [PHP] PHP hosts?
> > Hi All,
> >
> > I am looking for some sites that host PHP. I can't really afford to pay
for
> > hosting space anymore, so I was wondering if there were any good (free)
web
> > hosts, that had PHP and/or MySQL.
> >
> > I would like to get a fast and stable place to host my files, but if
there
> > was a preference, I would probably prefer a more stable place that's not
> > on/offline a lot.
> >
> > Any links/help is much appreciated.
>
> Not sure about stability but here is one in the UK:
> http://www.f2s.com/
> Jeff Oien
> PHP >start here - Web site coming soon
>
> --
> 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]
>
>
Hello,
I ran across a web hosting service phpwebhosting.com and it seemed like a
good deal, perhaps too good to be true. I searched the newsgroup archive to
find any posts of user experiences. I didn't see anything good or bad
really. I am just wondering if someone else has heard or had any
experience.
Any input is appreciated. Thanks.
chad angerer
html programmer
.. :one man with a club is a hooligan. a thousand men with clubs are a
regiment: ..
you could try NoMonthlyFees.com
----- Original Message -----
From: Angerer, Chad <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, March 19, 2001 12:28 PM
Subject: [PHP] PHP Webhosting
> Hello,
>
> I ran across a web hosting service phpwebhosting.com and it seemed like a
> good deal, perhaps too good to be true. I searched the newsgroup archive
to
> find any posts of user experiences. I didn't see anything good or bad
> really. I am just wondering if someone else has heard or had any
> experience.
>
> Any input is appreciated. Thanks.
>
> chad angerer
> html programmer
>
> .. :one man with a club is a hooligan. a thousand men with clubs are a
> regiment: ..
>
>
>
> --
> 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]
>
>
Hey!
I'm in the EXACT situation as you.. ;)
I too was wondering whether phpwebhosting.com can be trusted.
If someone here ever used their services, please let us know.
Thank you in advance -
Aviv Revach
At 12:28 19/03/01 -0600, Angerer, Chad wrote:
>Hello,
>
>I ran across a web hosting service phpwebhosting.com and it seemed like a
>good deal, perhaps too good to be true. I searched the newsgroup archive to
>find any posts of user experiences. I didn't see anything good or bad
>really. I am just wondering if someone else has heard or had any
>experience.
>
>Any input is appreciated. Thanks.
>
>chad angerer
>html programmer
>
>.. :one man with a club is a hooligan. a thousand men with clubs are a
>regiment: ..
>
>
>
>--
>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]
XOR-Coders Mega Programming Resource Site! -
http://members.xoom.com/xorcoders/
Can one class extend multiple classes? I'm still playing with OOP
functionality and maybe my logic is reversed but I think I need one class to
extend many others.
John Guynn
This email brought to you by RFCs 821 and 1225.
As far as I know a class can extend multiple classes. What you can't do -in
PHP- is two create a class that inherits from multiple parent classes
(multiple inheritence). I believe this is available in C++ and Java and
others. I also think the reason it is not available in PHP is because
inheriting from multiple classes tend to cause ambiguity when both of the
parent classess have a function with the same definition etc.
(I'm not an expert in this.. I'm just passing along what I have read).
oktay.
-----Original Message-----
From: John Guynn [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 19, 2001 1:47 PM
To: Php (E-mail)
Subject: [PHP] OOP question regarding class extension
Can one class extend multiple classes? I'm still playing with OOP
functionality and maybe my logic is reversed but I think I need one class to
extend many others.
John Guynn
This email brought to you by RFCs 821 and 1225.
--
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]
On Mon, Mar 19, 2001 at 01:58:39PM -0500, Altunergil, Oktay wrote:
> As far as I know a class can extend multiple classes. What you can't do -in
> PHP- is two create a class that inherits from multiple parent classes
> (multiple inheritence). I believe this is available in C++ and Java and
> others. I also think the reason it is not available in PHP is because
> inheriting from multiple classes tend to cause ambiguity when both of the
> parent classess have a function with the same definition etc.
>
> (I'm not an expert in this.. I'm just passing along what I have read).
Right. You can extend a chain of classes, but you can't have a
singular class extend from multiple classes directly.
That is, this works:
Apple extends Fruit
Fruit extends Food
This doesn't:
Apple extends Fruit and Produce
Matt
> -----Original Message-----
> From: John Guynn [mailto:[EMAIL PROTECTED]]
> Sent: Monday, March 19, 2001 1:47 PM
> To: Php (E-mail)
> Subject: [PHP] OOP question regarding class extension
>
>
> Can one class extend multiple classes? I'm still playing with OOP
> functionality and maybe my logic is reversed but I think I need one class to
> extend many others.
>
> John Guynn
>
> This email brought to you by RFCs 821 and 1225.
>
>
> --
> 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]
I think my outlook is on the fritz my total apologizes!
Kat
NoMonthlyFees.com - Never pay monthly webhosting fees again!!!
http://service.bfast.com/bfast/click?bfmid=12768212&siteid=38090600&bfpage=h
ome
or
PayMonthlyFees.com
http://www.nomonthlyfees.com/pay_monthly_fees.html
I'm using a system that uses shadow passwords, and I'm wondering if there is a way to
make posix_pwnam go around that, so that all my passwords returned don't end up being
'x'. Is there a way to do this with posix_pwnam or another command? RIght now, I'm
using an ugly hack, but would much rather use one function, whether or not the system
involves shadow passwords.
Hello everyone,
I want to build an authentication system like when entering Yahoo!. I.e.
each user can sign-up for a username, which has a password. When he enters
the site, there's a login box:
Username: [textbox]
Password: [password textbox]
[checkbox] Remember my username & password
If he checks the checkbox, then when he next visits the site (let's say the
next day), he will be automaticly entered, as the login info will be stored
in a cookie.
What if the checkbox is unchecked? How can I store the login info
temporarily and when he closes the browser (like in an HTTP authentication)
the info would be gone?
Is the PHP 4 session management the solution to my problem?
.................................................................
.. Dimitris Batis ....................... [EMAIL PROTECTED] ..
.. http://www.ravencrypt.com ....................................
.. ICQ: 18204204 .................... Yahoo! ID: deggial_wrath ..
.................................................................
"The road to truth is long, and lined the entire way with annoying bastards."
-- Alexander Jablokov, The place of no shadows
The answer, like yahoo, is to also store the username and password in
a database. When the cookie is not set or the option not checked, you will
use a database to validate the username and password.
You will build a session only if the username and password are matched
in the database.
py
----- Original Message -----
From: Batis <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, March 19, 2001 7:08 PM
Subject: [PHP] Remember my username & password
>
> Hello everyone,
>
> I want to build an authentication system like when entering Yahoo!. I.e.
> each user can sign-up for a username, which has a password. When he enters
> the site, there's a login box:
>
> Username: [textbox]
> Password: [password textbox]
> [checkbox] Remember my username & password
>
> If he checks the checkbox, then when he next visits the site (let's say
the
> next day), he will be automaticly entered, as the login info will be
stored
> in a cookie.
>
> What if the checkbox is unchecked? How can I store the login info
> temporarily and when he closes the browser (like in an HTTP
authentication)
> the info would be gone?
>
> Is the PHP 4 session management the solution to my problem?
>
> .................................................................
> .. Dimitris Batis ....................... [EMAIL PROTECTED] ..
> .. http://www.ravencrypt.com ....................................
> .. ICQ: 18204204 .................... Yahoo! ID: deggial_wrath ..
> .................................................................
>
> "The road to truth is long, and lined the entire way with annoying
bastards."
> -- Alexander Jablokov, The place of no shadows
>
>
> --
> 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]
>
Couple of ways of doing this ---
1. Assume you will be storing the username/password combo in a database.
2. Yes, use a cookie if you wish to store password on the client side.
3. PHP sessions are good for temporary storage of the username/password
combo, or whatever else you may use for your security scheme. There are
also built in variables :
$HTTP_SERVER_VARS[ "PHP_AUTH_USER" ]
$HTTP_SERVER_VARS[ "PHP_AUTH_PW" ]
Depending on your authorization scheme, if the login was successful you
could assign those values to these variables and your security is looked
after. When the browser is closed the values disappear and you don't have
to manage them.
Stumbled across this trying to get ht-dig to work. Every page of my
client's site is protected by a little fragment of PHP; if a session has
not been started with a variable holding a certain key value, I redirect to
a login page. No matter what I did, ht-dig when executed through a system()
call kept hitting the redirect.
As ht-dig supports the BASIC authentication scheme, I wrapped my "real"
security in a test for $HTTP_SERVER_VARS[ "PHP_AUTH_USER" ] = "lookfor" and
$HTTP_SERVER_VARS[ "PHP_AUTH_PW" ]="mehere". If these vars don't exist or
don't match the values assigned to htdig with the -u parameter in the
calling script, execution falls through to my real security scheme,
otherwise it is bypassed and ht-dig indexes the page.
Regards - Miles Thompson
At 09:08 PM 3/19/01 +0200, Batis wrote:
>Hello everyone,
>
>I want to build an authentication system like when entering Yahoo!. I.e.
>each user can sign-up for a username, which has a password. When he enters
>the site, there's a login box:
>
>Username: [textbox]
>Password: [password textbox]
>[checkbox] Remember my username & password
>
>If he checks the checkbox, then when he next visits the site (let's say
>the next day), he will be automaticly entered, as the login info will be
>stored in a cookie.
>
>What if the checkbox is unchecked? How can I store the login info
>temporarily and when he closes the browser (like in an HTTP
>authentication) the info would be gone?
>
>Is the PHP 4 session management the solution to my problem?
>
>.................................................................
>.. Dimitris Batis ....................... [EMAIL PROTECTED] ..
>.. http://www.ravencrypt.com ....................................
>.. ICQ: 18204204 .................... Yahoo! ID: deggial_wrath ..
>.................................................................
>
>"The road to truth is long, and lined the entire way with annoying bastards."
>-- Alexander Jablokov, The place of no shadows
>
>
>--
>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]
Hello
I encoded my HTML text via htmlspecialchars(), but now need to get the
actual HTML.. I searched the docs, but couldn't find the reverse
function. How would I do this?
TIA,
Yev
__________________________________________________
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail.
http://personal.mail.yahoo.com/
Yev wrote:
> I encoded my HTML text via htmlspecialchars(), but now need to get the
> actual HTML.. I searched the docs, but couldn't find the reverse
> function. How would I do this?
See also: htmlentities(), array_flip(), and get_translation_table().
-Egon
--
SIX Offene Systeme GmbH · Stuttgart - Berlin
Sielminger Straße 63 · D-70771 Leinfelden-Echterdingen
Fon +49 711 9909164 · Fax +49 711 9909199 http://www.six.de
Besuchen Sie uns auf der CeBIT 2001, Halle 6, Stand F62/4
Steve wrote:
SH> Anybody got an idea on how to check if a url really exists ?
Look at the function url_responds() in class.Validator.php3 from
http://www.thewebmasters.net.
This is a useful general validation class open sourced on the Gnu
licence.
Cheers
Geoff Caplan
mailto:[EMAIL PROTECTED]
Hi folks
Harshdeep Jawands wrote,
HSJ> I'll try and have a look at ROOT and evaluate its suitability.
That would be a helpful first step. I just don't have the background
to understand the documentation well enough to get a handle on its
capabilities.
--
Best regards,
Geoff mailto:[EMAIL PROTECTED]
I actually think this is the book I have been waiting for. A bookstore in
New Zealand told me not until March 2001. It must be pretty good, all the
Sams books are. The only problem is in NZ it is about $170 as opposed to
amazons $49.95US ($100NZ). If you know somewhere cheaper than amazon, I am
all ears.
Cheers
Chris
""Luke Welling"" <[EMAIL PROTECTED]> wrote in message
99528g$v58$[EMAIL PROTECTED]">news:99528g$v58$[EMAIL PROTECTED]...
: ""YoBro"" <[EMAIL PROTECTED]> wrote:
: > Does anybody know any good books & websites to recommend for PHP & MySql
: > together. I am looking to advance my knowledge and would really
appreciate
: a
: > helpful tip.
: >
: > Really looking for a book that explains all the advanced features of
PHP4
: > and MySql as a compliment.
:
: I can't give you an unbiased opinion on whether it is good or not, but you
: might like to look at "PHP and MySQL Web Development"
: by Luke Welling and Laura Thomson.
:
: Here is a link to it on Amazon.
: http://www.amazon.com/exec/obidos/ASIN/0672317842
: although you can probably get it cheaper elsewhere.
:
: It will be published in 10 days.
:
: Cheers,
:
: Luke Welling
:
:
:
: --
: 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]
:
At 03:46 PM 3/19/2001, YoBro wrote:
i get a lot of my books at bookpool.com. Their prices are lower than
amazon.com check them out. www.bookpool.com
~kurth
>I actually think this is the book I have been waiting for. A bookstore in
>New Zealand told me not until March 2001. It must be pretty good, all the
>Sams books are. The only problem is in NZ it is about $170 as opposed to
>amazons $49.95US ($100NZ). If you know somewhere cheaper than amazon, I am
>all ears.
>
>Cheers
>Chris
>
>""Luke Welling"" <[EMAIL PROTECTED]> wrote in message
>99528g$v58$[EMAIL PROTECTED]">news:99528g$v58$[EMAIL PROTECTED]...
>: ""YoBro"" <[EMAIL PROTECTED]> wrote:
>: > Does anybody know any good books & websites to recommend for PHP & MySql
>: > together. I am looking to advance my knowledge and would really
>appreciate
>: a
>: > helpful tip.
>: >
>: > Really looking for a book that explains all the advanced features of
>PHP4
>: > and MySql as a compliment.
>:
>: I can't give you an unbiased opinion on whether it is good or not, but you
>: might like to look at "PHP and MySQL Web Development"
>: by Luke Welling and Laura Thomson.
>:
>: Here is a link to it on Amazon.
>: http://www.amazon.com/exec/obidos/ASIN/0672317842
>: although you can probably get it cheaper elsewhere.
>:
>: It will be published in 10 days.
>:
>: Cheers,
>:
>: Luke Welling
>:
>:
>:
>: --
>: 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]
http://www.fatbrain.com/
http://www.booksamillion.com/
Jeff Oien
PHP >start here - Web site coming soon
>I actually think this is the book I have been waiting for. A bookstore in
>New Zealand told me not until March 2001. It must be pretty good, all the
>Sams books are. The only problem is in NZ it is about $170 as opposed to
>amazons $49.95US ($100NZ). If you know somewhere cheaper than amazon, I am
>all ears.
>
>Cheers
>Chris
>
>""Luke Welling"" <[EMAIL PROTECTED]> wrote in message
>99528g$v58$[EMAIL PROTECTED]">news:99528g$v58$[EMAIL PROTECTED]...
>: ""YoBro"" <[EMAIL PROTECTED]> wrote:
>: > Does anybody know any good books & websites to recommend for PHP & MySql
>: > together. I am looking to advance my knowledge and would really
>appreciate
>: a
>: > helpful tip.
>: >
>: > Really looking for a book that explains all the advanced features of
>PHP4
>: > and MySql as a compliment.
>:
>: I can't give you an unbiased opinion on whether it is good or not, but you
>: might like to look at "PHP and MySQL Web Development"
>: by Luke Welling and Laura Thomson.
>:
>: Here is a link to it on Amazon.
>: http://www.amazon.com/exec/obidos/ASIN/0672317842
>: although you can probably get it cheaper elsewhere.
>:
>: It will be published in 10 days.
>:
>: Cheers,
>:
>: Luke Welling
>:
>:
>:
>: --
>: 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 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]
Greetings.
How can I read one specified row in a flat textfile? I am working in
arrays and so forth, therefore one row is enough. Thanks.
- Richard
http://www.php.net/manual/en/function.file.php
Look into this, you might be able to do it using the file() function which
reads in a file and populates and array line by line.
array file (string filename [, int use_include_path])
Identical to readfile(), except that file() returns the file in an array.
Each element of the array corresponds to a line in the file, with the
newline still attached.
You can use the optional second parameter and set it to "1", if you want to
search for the file in the include_path, too.
-----Original Message-----
From: Richard [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 19, 2001 3:59 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Reading one line, and no more.
Greetings.
How can I read one specified row in a flat textfile? I am working in
arrays and so forth, therefore one row is enough. Thanks.
- Richard
--
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]
http://www.php.net/manual/file
There are a slew of file operations, you can read lines, sets of
characters, position the pointer in a specific place. Fill your boots.
Miles Thompson
At 09:59 PM 3/19/01 +0100, Richard wrote:
>Greetings.
>
> How can I read one specified row in a flat textfile? I am working in
>arrays and so forth, therefore one row is enough. Thanks.
>
>- Richard
>
>
>
>--
>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]
OK I did this below and it works just great. I had stumbled across the message
earlier.
my next question would be. I'm working on a list of meetings. I return a list for
the
current month, what I would like to do is make the current week meetings show in red.
However, I'm not sure of the best approach to do this.
do I look at each date with a function of my own? or is there a php function I can use
that
I'm not aware of?
thanks for any and all help
chris
>for MySQL add a WHERE (WEEK(yourtimefield) = WEEK(NOW()))
>
>this will have the problem that it will show all of week X even if you're
>on 23:55 on the last day of that week
>
>WHERE ((yourtimefield >= NOW()) AND (yourtimefield <= DATE_ADD(NOW(),
>INTERVAL 1 WEEK))
>
>might be better
>
>--
>Christian Reiniger
>LGDC Webmaster (http://sunsite.dk/lgdc/)
>
>...10001000110101011010101101011110111010113...????
>
>--
>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]
>
Hello,
I'm trying to take the query string of a url and turn it into an
associative array.
Let's say I have a URL like
myHost.com/somepage.php?val1=one&val2=two
I can get the query with HTTP_SERVER_VARS["QUERY_STRING"], but how do I
generate an array equivilent to
array('val1'=>'one', 'val2'=>'two')
Also, this example uses a GET method. First, can I do this? Also, can
I do this with a POST method?
Thanks,
Chris
Hi, I'm trying to get php to install on a RH 6.2 system. Apache 1.3.12.
All goes well with the configure, make, and make install, but my server
(apache) won't start and I get this message:
Syntax error on line 249 of /etc/httpd/conf/httpd.conf:
Cannot load /etc/httpd/modules/libphp4.so into server:
/etc/httpd/modules/libphp4.so: undefined symb
ol: uncompress
I saw it often in the list archives, but didn't find any good resolution
to it. Anyone know? My configure line is below if that helps. Thanks,
./configure '--with-mysql=/usr/local/mysql'
'--with-pgsql=/usr/local/pgsql' '--with-apxs=/usr/sbin/apxs'
'--with-system-regex' '--disable-debug' '--enable-track-vars'
'--enable-versioning' '--with-ttf' '--with-ftp'
Joe
Can someone direct me or send me a script that will convert number of
seconds into a format readable as HH:mm? I've tried making it myself, but it
gets all messed up in the calculations. Thanks!!!!
Yoshi
How about something like this:
$secs = number of seconds;
$hours = intval($secs/360);
$minutes = intval(($secs-$hours*360)/60)
$seconds = $secs - $hours*360 - $minutes * 60;
Hope this helps.
Michael Ridinger
On Mon, 19 Mar 2001, Yoshi Melrose wrote:
> Can someone direct me or send me a script that will convert number of
> seconds into a format readable as HH:mm? I've tried making it myself, but it
> gets all messed up in the calculations. Thanks!!!!
>
> Yoshi
>
>
>
function philtime($time){
$hours = (int) ($time / 3600);
$min = (int) (($time % 3600) / 60 );
return ("$hours:$min");
}
Should be 3600 since:
60sec = 1min
60min = 1hour
60 * 60 = 3600sec/hour
--
phill
> How about something like this:
>
> $secs = number of seconds;
> $hours = intval($secs/360);
> $minutes = intval(($secs-$hours*360)/60)
> $seconds = $secs - $hours*360 - $minutes * 60;
>
> Hope this helps.
>
> Michael Ridinger
should probably be:
function philtime($time) {
$hours = ($time - ($time % 3600)) / 3600;
$min = (int) (($time % 3600) / 60);
return ("$hours:$min");
}
This way you don't risk rounding up on your first cast to int and being off
by an hour... rounding is ok, however, for minutes since that is your most
granular interval.
-jm
-----Original Message-----
From: Phillip Bow [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 19, 2001 2:43 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Script to convert # of seconds to HH:mm
function philtime($time){
$hours = (int) ($time / 3600);
$min = (int) (($time % 3600) / 60 );
return ("$hours:$min");
}
Should be 3600 since:
60sec = 1min
60min = 1hour
60 * 60 = 3600sec/hour
--
phill
> How about something like this:
>
> $secs = number of seconds;
> $hours = intval($secs/360);
> $minutes = intval(($secs-$hours*360)/60)
> $seconds = $secs - $hours*360 - $minutes * 60;
>
> Hope this helps.
>
> Michael Ridinger
--
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]
Oh in addition this won't work accurately if $time is greater than about 2
billion(2147483648 I believe).
--
phill
""Phillip Bow"" <[EMAIL PROTECTED]> wrote in message
9961qg$ma4$[EMAIL PROTECTED]">news:9961qg$ma4$[EMAIL PROTECTED]...
> function philtime($time){
> $hours = (int) ($time / 3600);
> $min = (int) (($time % 3600) / 60 );
> return ("$hours:$min");
> }
> Should be 3600 since:
> 60sec = 1min
> 60min = 1hour
> 60 * 60 = 3600sec/hour
> --
> phill
Ok, you guys both rock. and now I feel real stupid. LOL
Thanks!
----- Original Message -----
From: "Phillip Bow" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, March 19, 2001 4:42 PM
Subject: Re: [PHP] Script to convert # of seconds to HH:mm
> function philtime($time){
> $hours = (int) ($time / 3600);
> $min = (int) (($time % 3600) / 60 );
> return ("$hours:$min");
> }
> Should be 3600 since:
> 60sec = 1min
> 60min = 1hour
> 60 * 60 = 3600sec/hour
> --
> phill
>
> > How about something like this:
> >
> > $secs = number of seconds;
> > $hours = intval($secs/360);
> > $minutes = intval(($secs-$hours*360)/60)
> > $seconds = $secs - $hours*360 - $minutes * 60;
> >
> > Hope this helps.
> >
> > Michael Ridinger
>
>
> --
> 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]
>
>
I thought about that when I first started, but then went looking to see if
using "\" would return the value without the decimal part. Not good when
you start confusing VB and PHP and it makes you mess up your code.
--
phill
> This way you don't risk rounding up on your first cast to int and being
off
> by an hour... rounding is ok, however, for minutes since that is your most
> granular interval.
>
> -jm
> Oh in addition this won't work accurately if $time is greater than about 2
> billion(2147483648 I believe).
This shouldn't be a problem unless you're calculating how many hours and
minutes a really old guy (>68) has been alive or something.
Sig for a Day
Stephan Ahonen, ICQ 491101
"That's very funny Scotty, now beam down my clothes!"
Come back tomorrow for a different sig!
Backspace a single "s" to reply by email
Hi,
The php function 'get_meta_tags' doesn't work when the meta tag name/
content values are single quoted. It's fine for double quotes. I've had
a look but can't find anything on the w3 site to say whether or not
double quotes are required in meta tags. Does anyone know what the rule
is?
(php v 4.04pl1, apache, linux 2.2.18)
All the best
--
Paul
> I've heard alot about the Zend Encoder. Using it can I encode I file so
that
> php still executes it, but a person cannot read my source by looking at
the
> file?
Yes. You replace all of the files you wish to protect with their Encoded
representations, and they're pretty much indecipherable -- On par with an
.exe or .so file for human comprehensibility.
You can also mix&match and leave some files unencoded for easy configuration
setup.
> I'm programming components for people and would prefer if they could
> use it, but not see my source. Does it require any extra server settings
> etc?
It requires the Zend Optimizer, which has "Loader/Decoder" builtin to it.
--
Visit the Zend Store at http://www.zend.com/store/
Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm
> I am looking for good php editors. Currently, i am using PHP coder. It
> highlights syntax and checks my syntax. It's also executes my PHP codes.
Are
> there any editors like that? I just want a editor that highlights my code
> and check my syntax.
Give the Zend IDE a trial run.
You'll be able to debug your code with an integrated debugger.
There's also a site somewhere that lists all the PHP Editors, but I don't
have the URL handy...
--
Visit the Zend Store at http://www.zend.com/store/
Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm
Try this. This guy has two versions. One with a debugger. It also does
previews if you have PHP installed on your machine.
Only WINDOWS though.
http://soysal.com/PHPEd/download.php3
-----Original Message-----
From: Richard Lynch [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 19, 2001 4:27 PM
To: McShen; [EMAIL PROTECTED]
Subject: [PHP] Re: php editors
> I am looking for good php editors. Currently, i am using PHP coder. It
> highlights syntax and checks my syntax. It's also executes my PHP codes.
Are
> there any editors like that? I just want a editor that highlights my code
> and check my syntax.
Give the Zend IDE a trial run.
You'll be able to debug your code with an integrated debugger.
There's also a site somewhere that lists all the PHP Editors, but I don't
have the URL handy...
--
Visit the Zend Store at http://www.zend.com/store/
Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm
--
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]
[EMAIL PROTECTED] wrote:
>
> How do you "delete" the cookie?
I delete like this:
<?
setcookie("username");
setcookie("passwd");
header("Location: http://".$HTTP_HOST."/logout.html");
exit;
?>
is this correct?
to set cookie i use:
setcookie("username",$username);
Nikolai
>
> Nikolai Vladychevski <[EMAIL PROTECTED]> wrote:
> >
> > Hi,
> >
> > My site has been working with cookies just fine .... until i discovered
> > that some browsers (i think it is some browser under MacOS, I'm
> > investigating) instead of deleting a cookie, set it to value "deleted",
> > so in my code this variable has a value and believes there is a user
> > called "deleted" trying to reauth..... a lot users can't login to my
> > site ater their session times out due to this cause.... My question is,
> > I am dealing with some new bug of explorer or there is a standard I am
> > missing? Should I implement in my code this feature doing with "deleted"
> > cookies? Or maybe it's a php bug? I run php-4.0.4pl1 ....
> >
> > Thanks in advance
> >
> > Nikolai
> >
> > --
> > 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]
> >
hiya,
is there a way to get php to know that $200,000 = $200000 as if you do a
calculation with it $200,000 it only uses the things befor the comma ..
Peter Houchin
[EMAIL PROTECTED]
=========================================================
_____ __ /\
/_/_/_\ / |_/ \
/_/_/_ __ __ __ __ / \
\_/_/_\ /_/ /_/ /_/ /_/ \ _ /
___\_\_\/ /_/_/_/ /_//\/_/ \_/ \/\_/
\_//_/_/ /_/_/_/ /_/ \/_/ v
________ ________________________________________
/_/_/_/_/ /_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
/_/_ _/_/ ______ __ __ /_/ ____ __ ______
/_/_/_/_/ /_/_/_/ /_/ /_/ /_/ /_/\_\ /_/ /_/_/_/
/_/ \_\ /_/ _/ /_//\/_/ /_/ /_/__\_\ /_/___ _\_\_\
/_/ \_\/_/_/_/ /_/ \/_/ /_/ /_/ \_\/_/_/_//_/_/_/
=========================================================
Telephone : (03) 9329 1455 Facsimile : (03) 9329 6755
************* We rent the dot in .COM! **************
do an ereg_replace("[^0-9]","",$var) before the calculation, to remove all
non-numeric characters.
kirk
> -----Original Message-----
> From: Peter Houchin [mailto:[EMAIL PROTECTED]]
> Sent: Monday, March 19, 2001 4:13 AM
> To: Php-General@Lists. Php. Net
> Subject: [PHP] math query
>
>
> hiya,
>
> is there a way to get php to know that $200,000 = $200000 as
> if you do a
> calculation with it $200,000 it only uses the things befor
> the comma ..
I'm thinking of using PHP to talk to an Oracle database with
the OCI8 interface - is PHP's OCI8 interface stable? Anything
unusual I should know about?
I'm using:
Redhat 6.1 Linux
PHP 4.0.4pl1
Oracle 8i 8.1.6
Apache 1.3.14
TIA.
--
Hardy Merrill
Mission Critical Linux, Inc.
http://www.missioncriticallinux.com
A site is trying to send our website a xml file. Unfortunately it is not
being sent through POST or GET. Using tools that the other site gives me to
test my site i
have determined only the file size through server vars CONTENT_LENGTH and
CONTENT_TYPE which is text/xml. But thats it. I am stuck on how to read the
file.
Some perl examples i have seen use this function:
read (STDIN, $request, $length);
php has that but right now our production servers won't have those socket
functions available till a few days time so rightnow i am left alone. I am
desperate for help. Does anyone have any suggestions with or without using
socket functions on how to read this incoming file???
Thanks in advance ;)
Uh, if it is not a POST or a GET, what is it? There must be some HTTP
primitive or it isn't HTTP at all.
-Rasmus
On Mon, 19 Mar 2001, Fabian Raygosa wrote:
> A site is trying to send our website a xml file. Unfortunately it is not
> being sent through POST or GET. Using tools that the other site gives me to
> test my site i
> have determined only the file size through server vars CONTENT_LENGTH and
> CONTENT_TYPE which is text/xml. But thats it. I am stuck on how to read the
> file.
>
> Some perl examples i have seen use this function:
> read (STDIN, $request, $length);
> php has that but right now our production servers won't have those socket
> functions available till a few days time so rightnow i am left alone. I am
> desperate for help. Does anyone have any suggestions with or without using
> socket functions on how to read this incoming file???
> Thanks in advance ;)
>
>
> --
> 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]
>
It's coming in as a binary file, as i mentioned before in some examples,
perl reads the file with
read (STDIN, &$request, $length);
an asp example uses Request.TotalBytes to get the size then does a
BinaryRead()
then in a for loop converts it to a string. This is all well and good for
them but i can't find php code to compare this too.
This is being done to read a cxml request from a ariba site (if this sounds
familiar to anyone please let me know), some project that was assigned to
me, easy enough unfortunately these guys don't have examples in php on how
to do this php so i am at a loss as to how to retrieve this info. Sorry for
any confusion. Pretty much my reaction when i saw this stuff for the first
time too.
The CONTENT_TYPE is text/xml so something is getting through the way its
supposed to be.
----- Original Message -----
From: "Rasmus Lerdorf" <[EMAIL PROTECTED]>
To: "Fabian Raygosa" <[EMAIL PROTECTED]>
Cc: "Php-General@Lists. Php. Net" <[EMAIL PROTECTED]>
Sent: Monday, March 19, 2001 4:10 PM
Subject: Re: [PHP] (HELP) Reading a file sent through HTTP
> Uh, if it is not a POST or a GET, what is it? There must be some HTTP
> primitive or it isn't HTTP at all.
>
> -Rasmus
>
> On Mon, 19 Mar 2001, Fabian Raygosa wrote:
>
> > A site is trying to send our website a xml file. Unfortunately it is not
> > being sent through POST or GET. Using tools that the other site gives me
to
> > test my site i
> > have determined only the file size through server vars CONTENT_LENGTH
and
> > CONTENT_TYPE which is text/xml. But thats it. I am stuck on how to read
the
> > file.
> >
> > Some perl examples i have seen use this function:
> > read (STDIN, $request, $length);
> > php has that but right now our production servers won't have those
socket
> > functions available till a few days time so rightnow i am left alone. I
am
> > desperate for help. Does anyone have any suggestions with or without
using
> > socket functions on how to read this incoming file???
> > Thanks in advance ;)
> >
> >
> > --
> > 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]
> >
> It's coming in as a binary file, as i mentioned before in some examples,
How? Via what? It must be either a POST or a PUT if perl can read it.
Chances are the data will be in $HTTP_RAW_POST_DATA
-Rasmus
Sorry to clarify, the server environment does report it coming in as a POST
but there is no variable name, its just a binary file
----- Original Message -----
From: "Rasmus Lerdorf" <[EMAIL PROTECTED]>
To: "Fabian Raygosa" <[EMAIL PROTECTED]>
Cc: "Php-General@Lists. Php. Net" <[EMAIL PROTECTED]>
Sent: Monday, March 19, 2001 4:10 PM
Subject: Re: [PHP] (HELP) Reading a file sent through HTTP
> Uh, if it is not a POST or a GET, what is it? There must be some HTTP
> primitive or it isn't HTTP at all.
>
> -Rasmus
>
> On Mon, 19 Mar 2001, Fabian Raygosa wrote:
>
> > A site is trying to send our website a xml file. Unfortunately it is not
> > being sent through POST or GET. Using tools that the other site gives me
to
> > test my site i
> > have determined only the file size through server vars CONTENT_LENGTH
and
> > CONTENT_TYPE which is text/xml. But thats it. I am stuck on how to read
the
> > file.
> >
> > Some perl examples i have seen use this function:
> > read (STDIN, $request, $length);
> > php has that but right now our production servers won't have those
socket
> > functions available till a few days time so rightnow i am left alone. I
am
> > desperate for help. Does anyone have any suggestions with or without
using
> > socket functions on how to read this incoming file???
> > Thanks in advance ;)
> >
> >
> > --
> > 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]
> >
What request method is it then? I only know of HEAD and PUT other than GET
and POST
make a script that receives their request, and write
getenv("REQUEST_METHOD") to a file and look
I don't think socket functions will help you read it anyway, unless you
replace your httpd with an ever-running, listening php script.
> A site is trying to send our website a xml file. Unfortunately it is not
> being sent through POST or GET. Using tools that the other site gives me
to
> test my site i
> have determined only the file size through server vars CONTENT_LENGTH and
> CONTENT_TYPE which is text/xml. But thats it. I am stuck on how to read
the
> file.
>
> Some perl examples i have seen use this function:
> read (STDIN, $request, $length);
> php has that but right now our production servers won't have those socket
> functions available till a few days time so rightnow i am left alone. I am
> desperate for help. Does anyone have any suggestions with or without using
> socket functions on how to read this incoming file???
> Thanks in advance ;)
:)
> Chances are the data will be in $HTTP_RAW_POST_DATA
THANK YOU THANK YOU THANK YOU THANK YOU
THANK YOU THANK YOU THANK YOU THANK YOU
It spit out everything i needed. In the form of a string!!
i had no idea that variable existed. damn my incompetence!! :)
Thanks again. There i go making it overtly complicated
now i can parse the xml_string.
Thanks for the help, that was (hopefully) that last hurdle i had to jump
----- Original Message -----
From: "Rasmus Lerdorf" <[EMAIL PROTECTED]>
To: "Fabian Raygosa" <[EMAIL PROTECTED]>
Cc: "Php-General@Lists. Php. Net" <[EMAIL PROTECTED]>
Sent: Monday, March 19, 2001 4:25 PM
Subject: Re: [PHP] (HELP) Reading a file sent through HTTP
> > It's coming in as a binary file, as i mentioned before in some examples,
>
> How? Via what? It must be either a POST or a PUT if perl can read it.
> Chances are the data will be in $HTTP_RAW_POST_DATA
>
> -Rasmus
Hi Everyone,
I just wanted to let you know (and thank some of you for all your help!), that I've
finally launched my revamped website.
There are two main sections in the site:
Section 1 is for High School and College Students and has almost 3000 Essays available.
Section 2 is for anyone seeking a Cisco Career Certification.
All Documents and Study Guides/Cheat Sheets are absolutely free! So Enjoy!
Since the site is free, I'm not about to fork out dough for Advertising, so pass the
word around for me, would ya?
Thanks!
Clayton Dukes
The Global Document Database
http://www.gdd.net
How can I dynamically load the PDF-extension only when
needed?
--
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]
Hey ,
I have been trying to set up some php applications on my local webserver, as part of a
transition from asp to php. I have unzipped the php distro into it's own dir, added in
the ini file, (left it at default setting) and then added the engine into IIS as
described in the install document.
Now, I have 500 Internal Server Errors on the php page.. any ideas?
I will happily RTFM, if I can find one that'd help ;)
Thanks,
James
Hi,
I'm trying to get a result from the following query:
$result = mysql_query("SELECT 'islname' FROM $table WHERE id='$id'");
Because "id" is a unique key in my table, I know it has only one value. What
mysql_funtion should I use to echo the result and with what parameters?
(I have tried many most of the functions but I don't get the correct result,
and the manual is not helping me :)
Regards,
Sumarlidi Einar Dadason
SED - Graphic Design
------------------------------------------
Phone: (+354) 4615501
Mobile: (+354) 8960376
Fax: (+354) 4615503
E-mail: [EMAIL PROTECTED]
Homepage: www.sed.is <- New Homepage!
------------------------------------------
try somethin' like this...
$result = mysql_query("SELECT 'islname' FROM $table WHERE id='$id'");
// For one row.. use a zero
$islname = mysql_result($result, 0, "islname");
// Otherwise, loop through
$islname=mysql_result($result, $i, "islname");
At 02:15 AM 3/20/2001 -0000, you wrote:
>Hi,
>
>I'm trying to get a result from the following query:
>
> $result = mysql_query("SELECT 'islname' FROM $table WHERE id='$id'");
>
>Because "id" is a unique key in my table, I know it has only one value. What
>mysql_funtion should I use to echo the result and with what parameters?
>
>(I have tried many most of the functions but I don't get the correct result,
>and the manual is not helping me :)
>
>Regards,
>Sumarlidi Einar Dadason
>
>SED - Graphic Design
>
>------------------------------------------
>Phone: (+354) 4615501
>Mobile: (+354) 8960376
>Fax: (+354) 4615503
>E-mail: [EMAIL PROTECTED]
>Homepage: www.sed.is <- New Homepage!
>------------------------------------------
>
>
>--
>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]
>
>
>
art-nude.com
On Tue, 20 Mar 2001 12:45, SED wrote:
> Hi,
>
> I'm trying to get a result from the following query:
>
> $result = mysql_query("SELECT 'islname' FROM $table WHERE id='$id'");
>
> Because "id" is a unique key in my table, I know it has only one value.
> What mysql_funtion should I use to echo the result and with what
> parameters?
>
> (I have tried many most of the functions but I don't get the correct
> result, and the manual is not helping me :)
>
> Regards,
> Sumarlidi Einar Dadason
If id is an integer type field, you will not get a result using the query
you show. Remove the single quotes around $id as they indicate a text
type value. Also you shouldn't need single quotes around islname - so
your query might look more like:
$result = mysql_query("SELECT islname FROM $table WHERE id=$id");
Then you can use mysql_fetch_array to get row[s] containing an array of
all the fields (one!) in your query, and then use extract to put the
field values in a variable named as the field. (The example for
mysql_fetch_array shows another way of displaying the fetched values.)
So:
$row = mysql_fetch_array($result);
extract($row);
echo $islname;
--
David Robley | WEBMASTER & Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES | http://www.nisu.flinders.edu.au/
AusEinet | http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA
tried using
echo $islname; ??
-----Original Message-----
From: SED [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, March 20, 2001 1:15 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Simple PHP 4 and MySQL question about query
Hi,
I'm trying to get a result from the following query:
$result = mysql_query("SELECT 'islname' FROM $table WHERE id='$id'");
Because "id" is a unique key in my table, I know it has only one value. What
mysql_funtion should I use to echo the result and with what parameters?
(I have tried many most of the functions but I don't get the correct result,
and the manual is not helping me :)
Regards,
Sumarlidi Einar Dadason
SED - Graphic Design
------------------------------------------
Phone: (+354) 4615501
Mobile: (+354) 8960376
Fax: (+354) 4615503
E-mail: [EMAIL PROTECTED]
Homepage: www.sed.is <- New Homepage!
------------------------------------------
--
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]
I found that when I pass the double quote(") through get(or post) method,
it is transformed into slash + double quote (\").
Although it seems useful in making SQL query, it's really annoying whenever
I pass the value to the other php page through get/post again.
Can I turn off this feature?
--
Chung Ha-Nyung <[EMAIL PROTECTED]>
http://www.php.net/manual/en/function.set-magic-quotes-runtime.php
you can also turn it off for good in your php.ini
-jack
-----Original Message-----
From: Chung Ha-Nyung [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 19, 2001 9:34 PM
To: [EMAIL PROTECTED]
Subject: [PHP] [Q] double quote(") is auto-transformed into (\")!
I found that when I pass the double quote(") through get(or post) method,
it is transformed into slash + double quote (\").
Although it seems useful in making SQL query, it's really annoying whenever
I pass the value to the other php page through get/post again.
Can I turn off this feature?
--
Chung Ha-Nyung <[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]
On Tue, Mar 20, 2001 at 11:33:31AM +0900, Chung Ha-Nyung wrote:
>
> I found that when I pass the double quote(") through get(or post) method,
> it is transformed into slash + double quote (\").
> Although it seems useful in making SQL query, it's really annoying whenever
> I pass the value to the other php page through get/post again.
>
> Can I turn off this feature?
You can turn it off in your php.ini:
magic_quotes_gpc = Off ; magic quotes for incoming GET/POST/Cookie data
or put this line in your apache config or in a .htaccess file:
php_flag magic_quotes_gpc Off
Regards,
--
K. Wojas .~.
~ [EMAIL PROTECTED] / V \
~ http://wojas.vvtp.nl /( )\
:wq ^ ^
On Tue, 20 Mar 2001 13:03, Chung Ha-Nyung wrote:
> I found that when I pass the double quote(") through get(or post)
> method, it is transformed into slash + double quote (\").
> Although it seems useful in making SQL query, it's really annoying
> whenever I pass the value to the other php page through get/post again.
>
> Can I turn off this feature?
Yes, but you risk unexpected results by not escaping. It is controlled by
the value of magic_quotes_gpc in yor php.ini file.
Consider instead using stripslashes to remove the slashes before display.
--
David Robley | WEBMASTER & Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES | http://www.nisu.flinders.edu.au/
AusEinet | http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA
How do I return the name of a file without any extensions or path info.
Eg how do I return "about" from "http://www.domainz.com/about.htm".
Regards,
Matthew Delmarter
matthew,
that'd be a complex regexp...there are lots of books and tutorials on
them...definitely worth learning...
search google for regular expression tutorial...you'll find tons of hits,
like this:
http://gosling.miass.chel.su/books/Perl/3/RegExp_Tutorial.html
-jack
-----Original Message-----
From: Matthew Delmarter [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 19, 2001 9:52 PM
To: PHP Mailing List
Subject: [PHP] get name of file
How do I return the name of a file without any extensions or path info.
Eg how do I return "about" from "http://www.domainz.com/about.htm".
Regards,
Matthew Delmarter
--
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_SELF
returns the file name..
go to php website manual and serach for it..
john
Matthew Delmarter wrote:
> How do I return the name of a file without any extensions or path info.
>
> Eg how do I return "about" from "http://www.domainz.com/about.htm".
>
> Regards,
>
> Matthew Delmarter
>
> --
> 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]
> How do I return the name of a file without any extensions or path info.
> Eg how do I return "about" from "http://www.domainz.com/about.htm".
Here's a quick and dirty way:
<?
$url = "http://www.domainz.com/about.htm";
$url = explode("/",$url);
$num = count($url);
$name = explode(".",$url[($num-1)]);
$documentname = $name[0];
echo "$documentname";
?>
> -----Original Message-----
> From: Matthew Delmarter [mailto:[EMAIL PROTECTED]]
> Sent: Monday, March 19, 2001 6:52 PM
> To: PHP Mailing List
> Subject: [PHP] get name of file
>
>
> How do I return the name of a file without any extensions or path info.
>
> Eg how do I return "about" from "http://www.domainz.com/about.htm".
>
> Regards,
>
> Matthew Delmarter
>
> --
> 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]
>
>
i ve no problem with arrays?
just cant register them into sessions.
""Yasuo Ohgaki"" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Although, you ask not to refer to PHP manual, there is a function you
probably
> would like to learn.
> (I guess you haven't read about array functions, right?)
>
> http://www.php.net/manual/en/function.array-merge.php
>
> This should be what you are looking for.
> (Don't over write, but merge arrays. I guess this is what you need)
> Take your time to read array functions, you might find other functions
that is
> useful.
>
> Regards,
> --
> Yasuo Ohgaki
>
> ----- Original Message -----
> From: ""karakedi"" <[EMAIL PROTECTED]>
> Newsgroups: php.general
> Sent: Saturday, March 17, 2001 10:07 AM
> Subject: [PHP] Sessions and CHECKBOXES :(
>
>
> > i ve 20 film names stored at database, and i want to show them in
> > alphebetical order. And i want to show 10 of them at each page. Nothing
is
> > wrong here. At the end of each film name there is a CHECKBOX, here is
the
> > code:
> >
> > $count = 0;
> > while ($row = mysql_fetch_array($result)){
> >
> > echo "<tr>";
> >
> > echo "<td valign=middle align=left>" ; // getting film names here
> > echo $row['film'] ;
> > echo "</td>" ;
> >
> >
> > $sepet = $row['tur'] ; // putting checkboxes here
> > $sepet2 = $row['film'];
> > $sepetsonuc = $sepet. " " .$sepet2 ;
> > echo "<input type=checkbox name=\"siparis[]\" value=\"$sepetsonuc\">" ;
> >
> > echo "</td></tr>" ;
> > $count++;
> > }
> >
> >
> > its good till here. everything is working... now since there are two
pages i
> > want to register checkbox variables which are CHECKED with
> > "session_register "so that i can use them at the second page. without
that
> > my code simply cant remember the checked ones at the previous pages.
> >
> > Can someone help me to register these checkbox values into sessions ?
> > PLS dont refer me to php.net manual/sessions :(
> >
> > i spent my last two days working on this so really need help :( any
help is
> > HIGHLY APPRECIATED!!!
> > thx in adv.
> >
> >
> >
> >
> > --
> > 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]
>
how do you store your checkbox variables in to sessions??
i am loking for that info,
any web page or any tiny little example could work.
thx in adv.
"Adi Wibowo" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>
> On Mon, 19 Mar 2001, Jose Antonio wrote:
> > I have tryed to make several frames, but, if a put the submit button in
a
> > diferent frame, how can i know wich are the selected rows of the form in
the
> > other frame?
>
> I use IFRAME (for more flexibility than FRAME) and session's variables to
> store variables between frames.
> Of course, table's frame must have some routine to store/update
> session variable when it clicked or changed.
>
> Adi Wibowo -------------------------------
> * Work matter : [EMAIL PROTECTED]
> * Private matter : [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]
>
how can i store checkbox variables into sessions so that i can use them on
other pages ?
i know how to register sessions but simply cant do that with checkboxes.
thx in adv.
Thank you all for your replies.
The following solved my problem (from David Robley):
--------------
Also you shouldn't need single quotes around islname - so
your query might look more like:
$result = mysql_query("SELECT islname FROM $table WHERE id=$id");
--------------
Then I was able to use: mysql_result($result, 0); to get the result.
Regards,
Sumarlidi Einar Dadason
SED - Graphic Design
------------------------------------------
Phone: (+354) 4615501
Mobile: (+354) 8960376
Fax: (+354) 4615503
E-mail: [EMAIL PROTECTED]
Homepage: www.sed.is <- New Homepage!
------------------------------------------
-----Original Message-----
From: SED [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, March 20, 2001 1:15 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Simple PHP 4 and MySQL question about query
Hi,
I'm trying to get a result from the following query:
$result = mysql_query("SELECT 'islname' FROM $table WHERE id='$id'");
Because "id" is a unique key in my table, I know it has only one value. What
mysql_funtion should I use to echo the result and with what parameters?
(I have tried many most of the functions but I don't get the correct result,
and the manual is not helping me :)
Regards,
Sumarlidi Einar Dadason
SED - Graphic Design
------------------------------------------
Phone: (+354) 4615501
Mobile: (+354) 8960376
Fax: (+354) 4615503
E-mail: [EMAIL PROTECTED]
Homepage: www.sed.is <- New Homepage!
------------------------------------------
--
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]