php-general Digest 18 Nov 2001 06:02:16 -0000 Issue 1001
Topics (messages 74987 through 75023):
Re: relative paths
74987 by: Gaylen Fraley
Re: Multiviews and GET requests no longer working?
74988 by: James Green
74989 by: James Green
Transfer variable to next web-page
74990 by: Olav Drageset
74991 by: Richard S. Crawford
75000 by: Matthew Loff
free online PHP books ?
74992 by: trongduc
74999 by: Fred
How to get mysql-result into a php variable
74993 by: Olav Drageset
75002 by: Fred
Difference of queries in PHP/mySQL?
74994 by: Jeff Lewis
74996 by: Jack Dempsey
Re: alzheimers and confused
74995 by: jimmy elab
75001 by: Matthew Loff
75003 by: Fred
words in a string
74997 by: wloeffelholz.xh9.net
75004 by: Johan Holst Nielsen
75005 by: Julio Nobrega Trabalhando
Re: Form's : making me sick!
74998 by: Steve Maroney
Converting dates?
75006 by: Jeff Lewis
75007 by: Jack Dempsey
75008 by: Jeff Lewis
Re: Apache 2.0.28
75009 by: Jobarr
75017 by: Tyler Longren
comma-formatting numbers
75010 by: Scott Dudley
75011 by: Paul Wolstenholme
Standalone PHP Application
75012 by: John Monfort
Re: [PHP-DEV] ldap_search sort extension, patch included
75013 by: Andre Oppermann
PHP Backing up a Database?
75014 by: cosmin laslau
75016 by: Jack Dempsey
Setting up PHP and ODBC on Linux
75015 by: mweb
Re: Question on variable variables
75018 by: Papp Gyozo
75019 by: Papp Gyozo
Re: working HEADER in PHP
75020 by: Papp Gyozo
Mortgage Leads Available!
75021 by: masscash2002.yahoo.com
Re: Advantages of php
75022 by: John Lim
What's wrong with this date ?
75023 by: trongduc
Administrivia:
To subscribe to the digest, e-mail:
[EMAIL PROTECTED]
To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]
To post to the list, e-mail:
[EMAIL PROTECTED]
----------------------------------------------------------------------
--- Begin Message ---
You've answered your own question. If document-root is set to
/usr/web/htdocs then require("/somefile") will expect to find "somefile" in
document-root.
--
Gaylen
[EMAIL PROTECTED]
Home http://www.gaylenandmargie.com
PHP KISGB v2.22 Guestbook http://www.gaylenandmargie.com/phpwebsite
"Mitja Pagon" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi!
>
> I want to know if there is a way to include(require) a file using a path
> relative to web server root.
>
> I'm aware of the fact that you can specify include path, but I believe
that
> this is not the best solution, since applications written that way aren't
> easily portable.
>
> What I'm looking for is something similar to what "/" does in HTML paths
and
> SSI include directives.
>
> Thanks,
>
> Mitja Pagon
>
>
--- End Message ---
--- Begin Message ---
On Fri, 2001-11-16 at 17:49, James Green wrote:
> If I call foo?id=1, not only is the id variable not set,
> _SERVER[QUERY_STRING] isn't either. Cookies and session variables work
> fine, it's just variables passed via GET. If I turn off Multiviews, the
> variables come through fine, but it means calling foo.php.
Solved. There's a bug in Apache-1.3.22 which causes this. I'm
downgrading to 1.3.20 now.
jg
--- End Message ---
--- Begin Message ---
On Fri, 2001-11-16 at 17:49, James Green wrote:
> If I call foo?id=1, not only is the id variable not set,
> _SERVER[QUERY_STRING] isn't either. Cookies and session variables work
> fine, it's just variables passed via GET. If I turn off Multiviews, the
> variables come through fine, but it means calling foo.php.
Solved. There's a bug in Apache-1.3.22 which causes this. I'm
downgrading to 1.3.20 now.
jg
--- End Message ---
--- Begin Message ---
I just started..
How do you transfer a variable from one web-page to another
I try to use a form like this:
<?
echo("<P>
<FORM method='POST' action='join2.php'>
text for button
<INPUT type='submit' value='Next step'>
<INPUT type='hidden' name='htmlVariableName' value='$phpVariableName'>
</FORM>
");
?>
and catch it in join2.php by:
$phpVariableName=htmlVariableName;
echo"$phpVariableName";
This do not work.
Can anyone tel me what should be done
Neither books, php-manual nor HTML-specification does tel me.
Olav
--- End Message ---
--- Begin Message ---
Use
$phpVariableName = $htmlVariableName;
Remember to use the $ in front of the variable that you toss from the HTML
form.
At 10:00 AM 11/17/2001, Olav Drageset wrote:
>I just started..
>
>How do you transfer a variable from one web-page to another
>I try to use a form like this:
><?
>echo("<P>
><FORM method='POST' action='join2.php'>
>text for button
><INPUT type='submit' value='Next step'>
><INPUT type='hidden' name='htmlVariableName' value='$phpVariableName'>
></FORM>
>");
>?>
>
>and catch it in join2.php by:
>
>$phpVariableName=htmlVariableName;
>
>echo"$phpVariableName";
>
>This do not work.
>Can anyone tel me what should be done
>Neither books, php-manual nor HTML-specification does tel me.
>
>Olav
>
>
>
>
>--
>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]
Sliante,
Richard S. Crawford
http://www.mossroot.com
mailto:[EMAIL PROTECTED]
AIM: Buffalo2K ICQ: 11646404 Y!: rscrawford
"It is only with the heart that we see rightly; what is essential is
invisible to the eye." --Antoine de Saint Exupéry
"Push the button, Max!"
--- End Message ---
--- Begin Message ---
Richard already answered the variable part, but I thought I'd point out
that you need to use double quotes in your HTML tags... Single quotes
are incorrect...
<?
echo("<P>
<FORM method=\"POST\" action=\"join2.php\">
text for button
<INPUT type=\"submit\" value=\"Next step\">
<INPUT type=\"hidden\" name=\"htmlVariableName\"
value=\"$phpVariableName\">
</FORM>
");
?>
Or...
<?
echo('<P>
<FORM method="POST" action="join2.php">
text for button
<INPUT type="submit" value="Next step">
<INPUT type="hidden" name="htmlVariableName" value="'. $phpVariableName
.'">
</FORM>
");
?>
Or... Better yet, why not just:
<P>
<FORM method="POST" action="join2.php">
text for button
<INPUT type="submit" value="Next step">
<INPUT type="hidden" name="htmlVariableName"
value="<?=$phpVariableName?>">
</FORM>
See the PHP manual for escaping HTML and string literals if you're
confused by any of this..
http://www.php.net/manual/en/language.basic-syntax.php#language.basic-sy
ntax.phpmode
http://www.php.net/manual/en/language.types.string.php
-----Original Message-----
From: Olav Drageset [mailto:[EMAIL PROTECTED]]
Sent: Saturday, November 17, 2001 1:01 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Transfer variable to next web-page
I just started..
How do you transfer a variable from one web-page to another
I try to use a form like this:
<?
echo("<P>
<FORM method='POST' action='join2.php'>
text for button
<INPUT type='submit' value='Next step'>
<INPUT type='hidden' name='htmlVariableName' value='$phpVariableName'>
</FORM>
");
?>
and catch it in join2.php by:
$phpVariableName=htmlVariableName;
echo"$phpVariableName";
This do not work.
Can anyone tel me what should be done
Neither books, php-manual nor HTML-specification does tel me.
Olav
--
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]
--- End Message ---
--- Begin Message ---
hi,
Does anyone know where the Online Free PHP Books are ?
I cannot buy a book with Amazon.com in my country.
There're a lot of free tutorials on the net, but they 're not enough for me
to understand PHP clearly.
Please let me know the URLs like that
thanks so much...
(I love PHP)
--- End Message ---
--- Begin Message ---
You may not be able to get an entire free book, but Amazon has lots of
sample chapters from several PHP books here
http://www.amazon.com/exec/obidos/search-handle-form/103-3308426-8753433
Trongduc <[EMAIL PROTECTED]> wrote in message
004d01c16f94$3ddcd490$190b10ac@d">news:004d01c16f94$3ddcd490$190b10ac@d...
> hi,
> Does anyone know where the Online Free PHP Books are ?
> I cannot buy a book with Amazon.com in my country.
> There're a lot of free tutorials on the net, but they 're not enough for
me
> to understand PHP clearly.
> Please let me know the URLs like that
>
> thanks so much...
> (I love PHP)
>
--- End Message ---
--- Begin Message ---
This is perhaps elementary, but I cannot find solution in the documentation
I want to transfer to a php variable wheter I find a matching firstname in a group
from mysql db
function lookupFirstname ($fname, $gr, $conection)
{ $sql = "SELECT firstname AS matches ";
$sql .= "FROM persons ";
$sql .= "WHERE firstname = '$fname' AND group='$gr';";
if (!$sql_result = mysql_query($sql,$connection) )
{echo "<P>query: "; echo mysql_error(); }
$store = mysql_store_result($conn);
$result = mysql_num_rows($store);
IF ($result > 0) {return 'match' ;} ELSE {return 'nomatch';}
}
I get error message that funcion mysql_stor_result() is not defined
How shall I use thees two funcions?
Thank you
Olav
--- End Message ---
--- Begin Message ---
I'm not sure where you found the function mysql_store_result, but it is not
a built-in PHP function and that is why you are getting an error.
If you just want to return Match if one or more rows in the group match the
first name use something like this:
function LookupFirstname ($FName, $Group, $Conn)
{
$SQL = "SELECT .....";
$Result = mysql_query($SQL,$Conn) or die (mysql_error());
if (mysql_num_rows($Result) > 0)
{ $Match = "Match"; }
else
{$Match = "NoMatch";}
return $Match;
}
Olav Drageset <[EMAIL PROTECTED]> wrote in message
1104_1006021222@alfa">news:1104_1006021222@alfa...
> This is perhaps elementary, but I cannot find solution in the
documentation
>
> I want to transfer to a php variable wheter I find a matching firstname in
a group from mysql db
>
> function lookupFirstname ($fname, $gr, $conection)
> { $sql = "SELECT firstname AS matches ";
> $sql .= "FROM persons ";
> $sql .= "WHERE firstname = '$fname' AND group='$gr';";
>
> if (!$sql_result = mysql_query($sql,$connection) )
> {echo "<P>query: "; echo mysql_error(); }
>
> $store = mysql_store_result($conn);
> $result = mysql_num_rows($store);
>
> IF ($result > 0) {return 'match' ;} ELSE {return 'nomatch';}
> }
>
> I get error message that funcion mysql_stor_result() is not defined
> How shall I use thees two funcions?
>
> Thank you
> Olav
>
--- End Message ---
--- Begin Message ---
I am wondering if there are any difference between using PHP and using the
command line for mySQL. Entering this at the comman line returns all the
membergroups properly. When I use this in my PHP program, it doesn't
continue past this line:
$request = mysql_query("SELECT membergroup FROM membergroups WHERE 1 ORDER
BY ID_GROUP");
Jeff
--- End Message ---
--- Begin Message ---
are you actually doing anything with $request? that just gets a mysql result
back in a variable, you then have to extract the data from it...
Jeff Lewis wrote:
> I am wondering if there are any difference between using PHP and using the
> command line for mySQL. Entering this at the comman line returns all the
> membergroups properly. When I use this in my PHP program, it doesn't
> continue past this line:
>
> $request = mysql_query("SELECT membergroup FROM membergroups WHERE 1 ORDER
> BY ID_GROUP");
>
> Jeff
>
> --
> 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]
--- End Message ---
--- Begin Message ---
de Morgan and Boole, not Alzheimer nor Confusius
!(A OR B) = (!A) AND (!B)
--- End Message ---
--- Begin Message ---
I was waiting for someone to meantion de Morgan! 10 points for Mr.
Elab. Ha ha...
-----Original Message-----
From: jimmy elab [mailto:[EMAIL PROTECTED]]
Sent: Saturday, November 17, 2001 1:41 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Re: alzheimers and confused
de Morgan and Boole, not Alzheimer nor Confusius
!(A OR B) = (!A) AND (!B)
--
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]
--- End Message ---
--- Begin Message ---
Brilliant. For those of us unfamiliar with the laws of de Morgan:
http://www.unc.edu/~rowlett/Math81/notes/DeMorgan.html
Fred
Jimmy Elab <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> de Morgan and Boole, not Alzheimer nor Confusius
>
> !(A OR B) = (!A) AND (!B)
--- End Message ---
--- Begin Message ---
hey ..
i want php to do an IF, when he founds a special word in a string (ex:
text_-_write_-_text ) .. i m not able to manage it ..
thnx for helping in foward
greetings
wolf.dietrich von loeffelholz
--- End Message ---
--- Begin Message ---
> i want php to do an IF, when he founds a special word in a string (ex:
> text_-_write_-_text ) .. i m not able to manage it ..
<?php
function doThis($x) {
//something?
$result = $x." phplover";
return $result;
}
$string = "Hi whats your name? Hi whats your name?";
$string_arr = explode(" ", $string);
$newstring = ""
for($i=0; $i<sizeof($string_arr); $i++) {
if($string_arr[$i] == "Hi") { //Or ereg if the word only have to contain
$string_arr[$i] = doThis($string_arr[$i]);
}
$newstring .= " ".$string_arr[$i];
}
//Return Hi phplover whats your name? Hi phplover whats your name?
echo $newstring;
?>
Could you use this example?
Regards,
Johan
--- End Message ---
--- Begin Message ---
if (ereg('special word', $string)) {
echo 'Found';
} else {
echo 'Not Found';
}
--
Julio Nobrega
No matter where you go, &this.
<[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> hey ..
>
> i want php to do an IF, when he founds a special word in a string (ex:
> text_-_write_-_text ) .. i m not able to manage it ..
>
> thnx for helping in foward
>
> greetings
>
> wolf.dietrich von loeffelholz
>
--- End Message ---
--- Begin Message ---
Thats sounds right becasuse anything between <form> ... </form> can only
will be passeed only to one script.
Steve
On Tue, 13 Nov 2001, George Pitcher wrote:
> I don't think that you can nest forms.
>
> George
>
> ----- Original Message -----
> From: "De Necker Henri" <[EMAIL PROTECTED]>
> To: "PHP-General (E-mail)" <[EMAIL PROTECTED]>
> Sent: Tuesday, November 13, 2001 1:09 PM
> Subject: [PHP] Form's : making me sick!
>
>
> > I just want to know how to make a <form> inside a <form> get to respond or
> > dont make any browser errors?
> >
> > It looks someting like this :
> >
> > <form>
> > <input type = "text">
> > <input type = "text">
> > <form>
> > <select onchange = "this.form.submit();"> //This must
> > change the next <select> values !
> > </select>
> > </form>
> > <select>
> > //this values must be cahnge
> > </select>
> > </form>
> >
> > Everthing is working fine but i just cant get the two forms to work
> > together.If i only can get some ideas on what action,or onchange values to
> > change it will be greatfull!
> >
> >
> > --
> > 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]
>
>
> _________________________________________________________
> Do You Yahoo!?
> Get your free @yahoo.com address at http://mail.yahoo.com
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>
Thank you,
Steve Maroney
--- End Message ---
--- Begin Message ---
I am storing a birthdate in my database as a Unix timestamp but when I
display it I want to calculate the different between that date and todays
date and display the persons age.
How can I do that with PHP?
I also want to know if it is currently their birthday. So trying to set
$isbday to yes if todays month and day are the same as their birthdate in
the database.
Jeff
--- End Message ---
--- Begin Message ---
search the archives there are tons of messages dealing with date
manipulation.....
basically take the timestamps find the difference in seconds, convert to
days, etc
jack
-----Original Message-----
From: Jeff Lewis [mailto:[EMAIL PROTECTED]]
Sent: Saturday, November 17, 2001 3:17 PM
To: PHP is not a drug.
Subject: [PHP] Converting dates?
I am storing a birthdate in my database as a Unix timestamp but when I
display it I want to calculate the different between that date and todays
date and display the persons age.
How can I do that with PHP?
I also want to know if it is currently their birthday. So trying to set
$isbday to yes if todays month and day are the same as their birthdate in
the database.
Jeff
--
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]
--- End Message ---
--- Begin Message ---
Yes thanks for that, I already have this but am having a brain cramp on how
to obtain years.
function datediff($now, $old)
{
/
$DIS = $now - $old; // Diff In Secs
$secs = $DIS % 60; // modulo
$DIS -= $secs;
$days = floor($DIS / (24*60*60));
$DIS -= $days * (24*60*60);
$hours = floor($DIS / (60*60));
$DIS -= $hours * (60*60);
$mins = floor($DIS / 60);
$DIS -= $mins * 60;
$diffstr= "$days Days, $hours Hours, $mins Minutes, $secs Seconds";
return $days;
}
----- Original Message -----
From: "Jack Dempsey" <[EMAIL PROTECTED]>
To: "Jeff Lewis" <[EMAIL PROTECTED]>; "PHP is not a drug."
<[EMAIL PROTECTED]>
Sent: Saturday, November 17, 2001 3:30 PM
Subject: RE: [PHP] Converting dates?
> search the archives there are tons of messages dealing with date
> manipulation.....
> basically take the timestamps find the difference in seconds, convert to
> days, etc
>
> jack
>
> -----Original Message-----
> From: Jeff Lewis [mailto:[EMAIL PROTECTED]]
> Sent: Saturday, November 17, 2001 3:17 PM
> To: PHP is not a drug.
> Subject: [PHP] Converting dates?
>
>
> I am storing a birthdate in my database as a Unix timestamp but when I
> display it I want to calculate the different between that date and todays
> date and display the persons age.
>
> How can I do that with PHP?
>
> I also want to know if it is currently their birthday. So trying to set
> $isbday to yes if todays month and day are the same as their birthdate in
> the database.
>
> Jeff
>
>
> --
> 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]
>
>
>
>
--- End Message ---
--- Begin Message ---
I read something saying that the API changed from 2.026 to 2.0.28 and when I
tried using a Apache2 php module, it said it was not compatible with this
version of Apache.
-Jobarr
"Vincent Stoessel" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> The current php will work with apache 2.x
> use: --with-apxs2
> when you configure php
--- End Message ---
--- Begin Message ---
Hello,
I tried compiling apache 2.0.28 w/ php 4.0.6. Here's how I did it:
Install apache:
./configure --prefix=/usr/local/apache2 --enable-module=so
make
make install
Install PHP:
./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql --with-xml
--disable-debug --enable-track-vars
make
PHP fails on the make command. Here's the error message:
make[3]: Entering directory `/root/packages/devel/php-4.0.6/sapi/apache'
/bin/sh /root/packages/devel/php-4.0.6/libtool --silent --mode=compile
cc -I. -I/root/packages/devel/php-4.0.6/sapi/apache -I/root/packages/devel/
php-4.0.6/main -I/root/packages/devel/php-4.0.6 -I/usr/local/apache2/include
-I/root/packages/devel/php-4.0.6/Zend -I/root/packages/devel/php-4.0.6/ext/
mysql/libmysql -I/root/packages/devel/php-4.0.6/ext/xml/expat/xmltok -I/root
/packages/devel/php-4.0.6/ext/xml/expat/xmlparse -I/root/packages/devel/php-
4.0.6/TSRM -DSUPPORT_UTF8 -DXML_BYTE_ORDER=12 -g -O2 -c sapi_apache.c
sapi_apache.c: In function `apache_php_module_main':
sapi_apache.c:80: `NOT_FOUND' undeclared (first use in this function)
sapi_apache.c:80: (Each undeclared identifier is reported only once
sapi_apache.c:80: for each function it appears in.)
make[3]: *** [sapi_apache.lo] Error 1
make[3]: Leaving directory `/root/packages/devel/php-4.0.6/sapi/apache'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/root/packages/devel/php-4.0.6/sapi/apache'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/root/packages/devel/php-4.0.6/sapi'
make: *** [all-recursive] Error 1
Know how to fix/why that happens?
Thanks,
Tyler Longren
----- Original Message -----
From: "Vincent Stoessel" <[EMAIL PROTECTED]>
To: "Jobarr" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Saturday, November 17, 2001 9:51 AM
Subject: Re: [PHP] Apache 2.0.28
> The current php will work with apache 2.x
> use: --with-apxs2
> when you configure php
>
> Jobarr wrote:
>
> > I need a build of PHP that can be used as a module with Apache 2.0.28
beta.
> > Anyone know where I could find one?
> >
> > thanks
> > -Jobarr
> >
> >
> >
> >
>
>
> --
> Vincent Stoessel [EMAIL PROTECTED]
> Java Linux Apache Mysql Php (JLAMP) Engineer
> (301) 362-1750 Mobile (410) 419-8588
> AIM, MSN: xaymaca2020 , Yahoo Messenger: vks_jamaica
>
>
> --
> 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]
>
>
--- End Message ---
--- Begin Message ---
i'm new to php and am having difficulty translating this tiny awk
function that i use to comma format numbers. can someone assist? my
stumbling block thus far have been the fact the the php regex matching
functions don't return the byte offset within the haystack and the regex
replace functions don't support the awk and perl-like ampersand "&" in
the replacement pattern. please help and thanks.
function commas(num) {
while (num ~ /[0-9][0-9][0-9][0-9]/)
sub (/[0-9][0-9][0-9]$|[0-9][0-9][0-9][,]/, ",&", num)
return num
}
--- End Message ---
--- Begin Message ---
You can do this using the number_format function or probably sprintf.
/Paul
On Saturday, November 17, 2001, at 01:36 PM, Scott Dudley wrote:
>
> i'm new to php and am having difficulty translating this tiny awk
> function that i use to comma format numbers. can someone assist? my
> stumbling block thus far have been the fact the the php regex matching
> functions don't return the byte offset within the haystack and the regex
> replace functions don't support the awk and perl-like ampersand "&" in
> the replacement pattern. please help and thanks.
>
> function commas(num) {
> while (num ~ /[0-9][0-9][0-9][0-9]/)
> sub (/[0-9][0-9][0-9]$|[0-9][0-9][0-9][,]/, ",&", num)
>
> return num
> }
>
>
> --
> 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]
>
--- End Message ---
--- Begin Message ---
Hello Everyone !
I'm looking for information on using PHP for standalone applications.
Specifically, I need to create a PHP-based application that can be runned
from a CD-ROM. Have any of you done this?
Any suggestions?
On another note:
I need to develop a CD-ROM based Survey, where the result will be saved
in an external file. What software, would you recommend, to use for this?
I'm currently using Multimedia Builder, and was wondering if
there is something better.
I need something that allows customization(via scripting) and more
interaction with external files/commands.
Any help would be appreciated.
Thanks!
-John
__________John Monfort_________________
_+-----------------------------------+_
P E P I E D E S I G N S
www.pepiedesigns.com
"The world is waiting, are you ready?"
-+___________________________________+-
--- End Message ---
--- Begin Message ---
Stig Venaas wrote:
>
> On Sat, Nov 17, 2001 at 04:31:26AM +0100, Andre Oppermann wrote:
> > Hello all,
> >
> > This patch enhances PHP4's ldap_search with a call to
> > ldap_sort_entries().
>
> In what LDAP APIs are ldap_sort_entries defined? What lib/API are you
> using? I wonder how well this works, sorting all kinds of Unicode is
> more or less impossible, but if some APIs have this function...
This function is supported by OpenLDAP 1.x/2.x, UMICH and Netscape
SDK as well.
Unicode is no problem because you can specify your own comparsion
function callback (the last parameter "strcmpncase").
> I was also thinking of adding support for server side sorting. I'm
The problem with server side sorting is that it is a LDAPv3 only
function and there is no requirement that LDAP server implements
this.
> thinking of a different PHP API, so that we don't need to add even
> more parameters to ldap_search(). Adding parameters to ldap_search()
I added it only to ldap_search() because only there I have access to
the full LDAPMessage chain. The function needs **ldap_res, not just
the *ldap_res that is delivered by that internal function in PHP.
> that only are valid with some APIs is bad I think. What I have in
> mind is something like:
ldap_search is valid with basically every ldap lib out there.
> ldap_sort($ld, $sortfilter);
> ldap_search($ld,...); (as usual)
>
> where the filter is used for all following searches, until a new filter
> is defined. Empty filter could turn it off.
Until now the right thing to do (see ldapsearch tool in OpenLDAP/UMICH)
to do this:
ldap_search($ld,...);
ldap_sort($ld, $res, $sortlist, [OPT_UNICODE | WHATEVER]);
> Do people think that this is better? I'm about to commit a patch that
> replaces the current link pointer, with a structure that might contain
> other state PHP needs per link. The link pointer will then be just a
> part of the struct. This is needed for set_rebind_proc() which I'm
> working on right now. This won't be visible in PHP land, except that
> it makes it easy to have an API like what I suggest for ldap_sort().
I think your structure patch makes sense.
> Before deciding on ldap_sort() I would like to know a bit about what
> APIs support it though.
Well, there no problem in providing both API. The ldap_sort() call is
useable today with all ldap libs and with any LDAP server. Server side
sorting is nice if you have LDAPv3 and your server supports it.
--
Andre
--- End Message ---
--- Begin Message ---
Hi,
Say I'm not really confident in the prowess of my server, and I want to
download my database onto my computer. Can that be done? What can I look
(FTP access) in the directory structure. I guess, where is it usually
located?
Thanks.
Cosmin Laslau
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp
--- End Message ---
--- Begin Message ---
mysqldump
check it out, either man or google
then ftp that file down, load it wherever, and mysql database < dump.sql
jack
-----Original Message-----
From: cosmin laslau [mailto:[EMAIL PROTECTED]]
Sent: Saturday, November 17, 2001 5:25 PM
To: [EMAIL PROTECTED]
Subject: [PHP] PHP Backing up a Database?
Hi,
Say I'm not really confident in the prowess of my server, and I want to
download my database onto my computer. Can that be done? What can I look
(FTP access) in the directory structure. I guess, where is it usually
located?
Thanks.
Cosmin Laslau
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp
--
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]
--- End Message ---
--- Begin Message ---
Hello,
as you may remember, some day ago, I asked how to develop
on linux PHP pages accessing Mysql via ODBC (The reasons why I *have*
to cope with this exact sub optimal set up are in the original
message, no reason to repeat them here). I have installed
all the UnixODBC rpms I could find ( I have RH 7.1); the iodbc
packages on the openlinksw were not accessible.
Now I have the following packages installed:
[root@ari mweb] rpm -qa|egrep -i 'php|odbc|sql'
php-4.0.4pl1-9
php-manual-4.0.4pl1-9
mysql-server-3.23.36-1
MyODBC-2.50.39-1
unixODBC-devel-2.0.7-1
asp2php-0.75.11-1
mysql-3.23.36-1
mysql-devel-3.23.36-1
php-mysql-4.0.4pl1-9
unixODBC-2.0.7-1
unixODBC-generic-2.0.7-1
mysqlclient9-3.23.22-4
unixODBC-mysql-2.0.7-1
However, I currently have PHP set up as pasted below (from phpinfo):
that means I have to recompile it from scratch, doesn't it? If so,
with which options? Is it enough to change --without-mysql to
--with-mysql and add --with-odbc?
Also, is it safer/worst/irrelevant/mandatory to erase the php rpm
package before building it again from source?
TIA,
mweb
'./configure' '--prefix=/usr' '--with-config-file-path=/etc'
'--disable-debug'
'--enable-pic' '--enable-shared'
'--enable-inline-optimization'
'--with-apxs=/usr/sbin/apxs'
'--with-exec-dir=/usr/bin' '--with-regex=system'
'--with-gettext' '--with-gd'
'--with-jpeg-dir=/usr' '--with-png' '--with-zlib'
'--with-db2' '--with-db3'
'--with-gdbm' '--enable-debugger'
'--enable-magic-quotes'
'--enable-safe-mode' '--enable-sockets' '--enable-sysvsem'
'--enable-sysvshm'
'--enable-track-vars' '--enable-yp' '--enable-ftp'
'--enable-wddx' '--without-mysql'
'--without-oracle' '--without-oci8' '--with-xml'
--
If you have the right attitude, interesting problems will find you
Eric S. Raymond, "The Cathedral and the bazaar", chapter 2
--- End Message ---
--- Begin Message ---
have you tried /e modifier?
preg_replace("/<yabb\s+$tags[1]>/e",'${$1}', $curline);
it's just a tip.
----- Original Message -----
From: "Jeff Lewis" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, November 17, 2001 2:25 PM
Subject: Re: [PHP] Question on variable variables
> Thanks Jason and Christoper for replying, here is the solution I came up
> with. It takes into account that there could be multiple instances of what
> I'm looking for on the same line - got it working late last night:
>
> while (preg_match ("/<yabb\s+(\w+)>/",$curline,$tags))
> $curline = preg_replace("/<yabb\s+$tags[1]>/",${$tags[1]},$curline);
>
> Jeff
> ----- Original Message -----
> From: "Jason G." <[EMAIL PROTECTED]>
> To: "Jeff Lewis" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
> Sent: Saturday, November 17, 2001 7:02 AM
> Subject: Re: [PHP] Question on variable variables
>
>
> > It seems to me that the use of a temp variable may be the clearest
> > solution, and I doubt any overhead would matter really.
> >
> > $a = "dog";
> > $tmp = "MY".$a; //$tmp = "MYdog";
> >
> > So the following two would be the same:
> > $$tmp = "Spot";
> > $MYdog = "Spot";
> >
> > Good Luck,
> >
> > Jason Garber
> > IonZoft.com
> >
> > At 09:47 PM 11/16/2001 -0500, Jeff Lewis wrote:
> > >I've a question regarding variable variable I was hoping someone could
> > >help me with:
> > >
> > >All the examples in the manual have the entire variable name being
> > >variable e.g.
> > >$a = "hello" and
> > >$$a being the same as $hello
> > >
> > >What I need to do, however, is append a variable portion to a constant
> > >prefix. So I have a set of variables that are named $MYdog, $MYcat etc.
> > >and I need to do
> > >
> > >$a = "dog"
> > >${"MY$a"} being the same as $MYdog
> > >
> > >Can this be done, and if so - how? I can't get it to work.
> > >
> > >Jeff
> >
> >
> >
>
>
> --
> 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]
>
--- End Message ---
--- Begin Message ---
Oops...
> have you tried /e modifier?
>
> preg_replace("/<yabb\s+$tags[1]>/e",'${$1}', $curline);
preg_replace("/<yabb\s+(\w+)>/e",'${$1}', $curline);
>
> it's just a tip.
>
>
> ----- Original Message -----
> From: "Jeff Lewis" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Saturday, November 17, 2001 2:25 PM
> Subject: Re: [PHP] Question on variable variables
>
>
> > Thanks Jason and Christoper for replying, here is the solution I came up
> > with. It takes into account that there could be multiple instances of what
> > I'm looking for on the same line - got it working late last night:
> >
> > while (preg_match ("/<yabb\s+(\w+)>/",$curline,$tags))
> > $curline = preg_replace("/<yabb\s+$tags[1]>/",${$tags[1]},$curline);
> >
> > Jeff
> > ----- Original Message -----
> > From: "Jason G." <[EMAIL PROTECTED]>
> > To: "Jeff Lewis" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
> > Sent: Saturday, November 17, 2001 7:02 AM
> > Subject: Re: [PHP] Question on variable variables
> >
> >
> > > It seems to me that the use of a temp variable may be the clearest
> > > solution, and I doubt any overhead would matter really.
> > >
> > > $a = "dog";
> > > $tmp = "MY".$a; //$tmp = "MYdog";
> > >
> > > So the following two would be the same:
> > > $$tmp = "Spot";
> > > $MYdog = "Spot";
> > >
> > > Good Luck,
> > >
> > > Jason Garber
> > > IonZoft.com
> > >
> > > At 09:47 PM 11/16/2001 -0500, Jeff Lewis wrote:
> > > >I've a question regarding variable variable I was hoping someone could
> > > >help me with:
> > > >
> > > >All the examples in the manual have the entire variable name being
> > > >variable e.g.
> > > >$a = "hello" and
> > > >$$a being the same as $hello
> > > >
> > > >What I need to do, however, is append a variable portion to a constant
> > > >prefix. So I have a set of variables that are named $MYdog, $MYcat etc.
> > > >and I need to do
> > > >
> > > >$a = "dog"
> > > >${"MY$a"} being the same as $MYdog
> > > >
> > > >Can this be done, and if so - how? I can't get it to work.
> > > >
> > > >Jeff
> > >
> > >
> > >
> >
> >
> > --
> > 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]
> >
>
--- End Message ---
--- Begin Message ---
> Hi,
>
> I used
> header("content-type:text/html;charset='windows-1256'");
> and header("content-language:'fa'");
I suggest to try "Content-Type" "Content-Language"
with initial capitals rather than all lowercase and
simply fa, without qoutes.
header("Content-Type: text/html; charset=windows-1256");
header("Content-Language: fa");
> for showing my Farsi messages, in PHP, on browser
> but these could not work.
>
> Please help me!
> Thanks.
>
>
> __________________________________________________
> Do You Yahoo!?
> Find the one for you at Yahoo! Personals
> http://personals.yahoo.com
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
--- End Message ---
--- Begin Message ---
Are you a Mortgage Office in need of leads?
We receive refinance requests direct from borrowers
throughout the United States daily!
Whether your office services one state or multiple states,
our leads will meet your needs!
A few features of our program:
*Leads are exclusive---sold ONLY to you!
*Leads contain 30 pieces of information regarding each borrower!
*Leads delivered within 24-48 hours from borrower's original request!
*Leads are sent daily--depending on your needs!
*And best of all....pricing to meet your marketing budget!
Dont forget to ask about our volume discount!
TO ORDER YOUR LEADS, CALL (888) 725-9246!
**********************************************************************************************
To be removed from this mailing please mail [EMAIL PROTECTED] with
remove in the subject line. Thank you
**********************************************************************************************
--- End Message ---
--- Begin Message ---
See http://php.weblogs.com/php_vs_asp and
http://php.weblogs.com/php_asp_7_reasons
The articles need to be updated for Microsoft.Net though.
Jason G. <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> You could check the list archives... This question flys by every week or
> two...
>
> -Jason Garber
> IonZoft.com
>
> At 01:41 PM 11/17/2001 +0530, Adrian D'Costa wrote:
> >Hi,
> >
> >Is there somewhere on the PHP site that give a list of advantages, speed,
> >etc in comparsion with other similar programs. I have a client that is
in
> >ASP and would like to move to PHP and need this info.
> >
> >Thanks
> >
> >Adrian
> >
> >
> >--
> >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]
>
--- End Message ---
--- Begin Message ---
hi there,
I try to save a record (in the "date" type in MySQL) from the <INPUT
type=text> by :
$query = "INSERT INTO $table VALUES ($post_id, 0, '$topic', '$uname',
'$body', $date, '$newdate', 0) ";
But it couldn't work (I used $date or '$date' on above, but they got the
same results) !
It showed me the wrong value, as : 1970-0-0 (always this, although I try to
input different values in the text box with the date format is YYYY-MM-DD)
I don't understand the way MySQL saves my date field in his data (is it
YYYY-MM-DD ?)
Can anyone help me in this case ?
Thanks much...
ps : I used the $date field in "varchar(20) type" instead. BWT, what's
different beween the Varchar(length) type with the Char(length) type ?
--- End Message ---