|
Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com |
php-general-digest-help_at_lists.php.net
Date: Wed Nov 06 2002 - 18:59:26 CST
php-general Digest 7 Nov 2002 00:59:26 -0000 Issue 1689
Topics (messages 122976 through 123089):
Re: addslashes/stripslashes
122976 by: Paul Dionne
Socket Programming Problem
122977 by: ªüYam
Re: How do I convert an array into a mask?
122978 by: Daevid Vincent
122980 by: Daevid Vincent
122983 by: John W. Holmes
123004 by: Ernest E Vogelsinger
123008 by: Tom Rogers
123009 by: Ford, Mike [LSS]
Re: Permissions
122979 by: Marek Kilimajer
Re: Session Handling
122981 by: Uma Shankari T.
122985 by: John W. Holmes
ceil() function
122982 by: Marcelo Garcia
122984 by: John W. Holmes
Re: PHP 4.3.0 and Zend Engine 2
122986 by: Aaron Gould
Re: php4.2.2 remembers last GET and POST vars in HTTP_SESSION_VARS also
122987 by: Seung Hwan Kang
122990 by: Alexander Piavka
Re: Installation error with 4.2.3
122988 by: Paul Nicholson
122989 by: Seung Hwan Kang
Re: xml
122991 by: Jay Blanchard
122994 by: Maxim Maletsky
Re: Grammar/how toes?
122992 by: Jay Blanchard
Re: Help me learn! with an explanation of these two functions.
122993 by: Steve Jackson
123016 by: Jason Wong
php and electronic pay system
122995 by: Martin Hudec
123005 by: Ernest E Vogelsinger
New to PHP, and stuck
122996 by: Markus Jäntti
122997 by: Edward Peloke
122999 by: Erwin
123000 by: Edward Peloke
123001 by: Steve Bradwell
123002 by: John W. Holmes
123006 by: Ernest E Vogelsinger
Re: undefined symbol: curl-global-init
122998 by: Ernest E Vogelsinger
123007 by: Marek Kilimajer
123010 by: Marek Kilimajer
123011 by: Ernest E Vogelsinger
123013 by: Ernest E Vogelsinger
Re: session vs. header
123003 by: huge junk mail
123012 by: dwalker
123014 by: dwalker
Re: Javascript and PHP
123015 by: Tom Rogers
Converting variables to integer
123017 by: drparker.clam.rutgers.edu
123039 by: Kevin Stone
123042 by: Marek Kilimajer
123044 by: Kevin Stone
Running functions as other than nobody
123018 by: Davíð Örn Jóhannsson
123019 by: Marco Tabini
publishing php > mysql website on cd-rom
123020 by: ROBERT MCPEAK
123021 by: Marco Tabini
123023 by: .: B i g D o g :.
123024 by: John Wards
123025 by: Maxim Maletsky
123036 by: ROBERT MCPEAK
123061 by: John Wards
Re: generically accessing member variables problem
123022 by: John Kenyon
123026 by: Maxim Maletsky
123028 by: John Kenyon
123029 by: Tom Rogers
123030 by: Maxim Maletsky
123032 by: Tom Rogers
123033 by: Maxim Maletsky
123034 by: John Kenyon
123035 by: Maxim Maletsky
123048 by: John Kenyon
123052 by: Maxim Maletsky
123071 by: John Kenyon
Re: Trouble with php-4.2.3, apache-1.3.27, sablotron 0.96
123027 by: Tom Rogers
123055 by: Evan Nemerson
Code Advice
123031 by: Jason Young
123037 by: Kevin Stone
123038 by: Ford, Mike [LSS]
123040 by: Ernest E Vogelsinger
123041 by: Kevin Stone
123043 by: Ernest E Vogelsinger
123045 by: Ford, Mike [LSS]
123046 by: Ford, Mike [LSS]
123047 by: Maxim Maletsky
123050 by: Jason Young
123051 by: Ernest E Vogelsinger
123053 by: Ernest E Vogelsinger
123054 by: Kevin Stone
123056 by: Chris Wesley
123057 by: Kevin Stone
123059 by: Jason Young
123063 by: Ernest E Vogelsinger
123067 by: Jason Young
filemtime() error
123049 by: Jule Slootbeek
To Move Recordset back to initial position
123058 by: ppf
123065 by: Kevin Stone
123066 by: Evan Nemerson
mysql list
123060 by: electroteque
123068 by: Jay Blanchard
123069 by: Kevin Stone
installing PHP with netscape on Sun Solaris
123062 by: Joydeep Ghosh
Help Needed with PhpMailer
123064 by: Pushpinder Sngh Garcha
123070 by: Evan Nemerson
Getting Newest
123072 by: Stephen
123073 by: Marco Tabini
123074 by: Stephen
123077 by: Stephen
123078 by: Marco Tabini
123079 by: John W. Holmes
123081 by: Stephen
123089 by: Nick Eby
Re: fopen() with permissions?
123075 by: Charles Wiltgen
123076 by: Marco Tabini
123080 by: Ernest E Vogelsinger
123082 by: Charles Wiltgen
123083 by: Charles Wiltgen
123085 by: Charles Wiltgen
123086 by: Ernest E Vogelsinger
123087 by: Charles Wiltgen
123088 by: Charles Wiltgen
Anyone used Phpmailer()
123084 by: Pushpinder Sngh Garcha
Administrivia:
To subscribe to the digest, e-mail:
php-general-digest-subscribe
lists.php.net
To unsubscribe from the digest, e-mail:
php-general-digest-unsubscribe
lists.php.net
To post to the list, e-mail:
php-general
lists.php.net
----------------------------------------------------------------------
attached mail follows:
thanks guys, got it working now. Removed Addslashes and it works fine.
1lt John W. Holmes wrote:
>> I am trying to develop a search for my database.
>>
>> I used addslashes when entering the data, and then use addslashes with
>> the search but nothing comes up:
>>
>> Select * from tblContacts, tblCountries WHERE
>> (tblContacts.CountryCode=tblCountries.CountryID) AND (Organization LIKE
>> '%o\'mallies%' )
>>
>> I check in the database and o'mallies is indeed there as o\'mallies. And
> a
>> search for just mallies works fine.
>
> If you see it in the database as o\'mallies, then you are running
> addslashes() twice on the data you are inserting. If you insert o\'mallies
> into the database, the \ is only there to tell the database that the
> following character is escaped. In this case, the ' is not the end of the
> string, but something that should be included in the data that's put into
> the database. The actual \ isn't put in the database.
>
> So, with that said, you can fix your code and find out where you are
> addslashes() twice. You can run some queries to replace \' in your
> database with ', too.
>
> Or you can just search for o\\\'mallies in your database, which will
> search for a literal \ and a literal ' in the data.
>
> ---John Holmes...
attached mail follows:
I have a web server and want to make it as a file provider...
Works similiar to the BBS....However, the problem is appeared...
How can I trigger the user to download those file while they requested??
What can i do after fsock_open() ?
thx a lot
attached mail follows:
Ernest, close but you have it reversed for my needs (i.e. true binary
form). Notice that my LSB is to the left, not right.
As Evan Nemerson pointed out to me, the decbin(), bindec(), Dec2Bin()
and Bin2Dec() functions shed some light. What I need is the equivillant
functions but with a way to flip the order of the bits from LSB to MSB.
I believe that is called "little endian" and "big endian"?
I've been playing with one function to convert my purchitem[] to a
decimal value, then use the decbin() to get a string, then reverse it...
Seems cumbersome but mebbe that's the solution?
function Array2Dec($array)
{
$decimal = 0;
while ( list($Key, $Val) = each($array) )
{
//notice the ($Val - 1) because
//our array starts at index 0, not 1
$decBit = pow(2, ($Val - 1));
$decimal += $decBit;
echo "<br>array[".$Key."] = ".$Val." :: ".$decBit;
}
return $decimal;
}
function reverseString($myString)
{
$charArray = preg_split('//', $myString, -1,
PREG_SPLIT_NO_EMPTY);
$revchars = array_reverse($charArray);
$revString = "";
while ( list($Key, $Val) = each($revchars) ) { $revString .=
$Val; }
return $revString;
}
> -----Original Message-----
> From: Ernest E Vogelsinger [mailto:ernest
vogelsinger.at]
> Sent: Wednesday, November 06, 2002 1:28 AM
> To: php-general
lists.php.net
> Subject: RE: [PHP] How do I convert an array into a mask?
>
>
> At 10:18 06.11.2002, Daevid Vincent said:
> --------------------[snip]--------------------
> >doesn't lend itself nicely to expansion, but may be my only
> way. I just
> >have a gut feeling that it can be automated somehow. To turn
> 1,3,4 into
> >10110 seems like there is some 'math' there that can work. I also
> --------------------[snip]--------------------
>
> It's quite easy using the left-shift operator "<<". Note that
> the function below only works for values 1-31 on 32bit systems.
>
> <?php
>
> function makebits(&$array)
> {
> $result = 0;
> foreach ($array as $seq) {
> if (is_numeric($seq)) {
> $i = 1 << ($seq-1);
> // assuming ID's are 1-based
> $result += $i;
> }
> }
> return $result;
> }
>
> $a = array(1,3,5,9); // 0001 0001 0101 = 0x115
> echo '<xmp>', sprintf('0x%x', makebits($a)), "\n</xmp>";
>
> ?>
attached mail follows:
Oooh! I think you're on to something there. Nice!
Hey, what's the "
" symbol for? I see in the manual the "&" is a
reference (like a pointer in C I assume), but I can't find the "
"
explained.
> if(
$purchitem[$y] == $x)
attached mail follows:
> Oooh! I think you're on to something there. Nice!
>
> Hey, what's the "
" symbol for? I see in the manual the "&" is a
> reference (like a pointer in C I assume), but I can't find the "
"
> explained.
>
> > if(
$purchitem[$y] == $x)
It'll suppress warnings and errors. If the $purchitem does not have a
key 4 or 5, like in your example, then you'll get a warning for
undefined offset, depending on your error reporting level. This just
suppresses that.
If you do it this way, you may want to sort $purchitem if you can't
guarantee it's going to be in ascending order. Or you can use in_array()
and not care about the order.
---John Holmes...
attached mail follows:
At 13:43 06.11.2002, Daevid Vincent said:
--------------------[snip]--------------------
>Ernest, close but you have it reversed for my needs (i.e. true binary
>form). Notice that my LSB is to the left, not right.
Ah, ic, you want a <<string>> like "00001100101" - that's easy :)
Note that I do _not_ pass the array by reference here since I modify it
(using asort).
function make_a_special_bitlike_string($array)
{
$result = '';
sort($array, SORT_NUMERIC);
$max = $array[count($array)-1];
for ($i = 1; $i <= $max; ++$i) {
if (in_array($i, $array))
$result .= '1';
else
$result .= '0';
}
return $result;
}
if you need this as a number, simply return "(int)$result", but beware that
this breaks if there are more than 32 digits (highest value > 32).
--
>O Ernest E. Vogelsinger
(\) ICQ #13394035
^ http://www.vogelsinger.at/
attached mail follows:
Hi,
Wednesday, November 6, 2002, 2:56:33 PM, you wrote: DV> Does anyone know of a nice efficient way to convert an array of values DV> into a "mask"...
DV> Here's the deal. Given an array such that:
DV> $purchitem[0] = 1; DV> $purchitem[1] = 3; DV> $purchitem[2] = 4;
DV> I want to end up with a variable like this:
DV> $mask = "10110";
DV> Additionally, my theory is that then the person purchases another book DV> later
DV> $purchitem[0] = 2;
DV> My new mask should be $purchmask = "01000";
DV> Then I can load their previous mask from the database and boolean OR it DV> with the new mask to set the correct permissions. i.e.
DV> $newmask = $mask | $purchmask;
DV> Or ideally = "11110"
DV> Can I boolean OR strings like that in the way I 'hope' it will work? Do DV> I need to convert it to an intermediate stage or cast it or anything?
DV> Does this make sense? It's for an online book shopping cart. I have the DV> reverse working, where I can split the mask into what books. And I also DV> have the $purchitem[] working.
This should do it:
$purchitem[0] = 1; $purchitem[1] = 3; $purchitem[2] = 4;
$s = '00000'; while(list($key,$val) = each($purchitem)){ $s[$val-1] = '1'; } echo "s = $s <br>";
-- regards, Tom
attached mail follows:
> -----Original Message-----
> From: Daevid Vincent [mailto:daevid
daevid.com]
> Sent: 06 November 2002 12:23
> To: php-general
lists.php.net
>
> That's the EASY part John!
>
> The hard part is converting the array (which was a checkbox
> array from a
> form submission) into the binary string (as per the original post)
>
> > Here's the deal. Given an array such that:
> > $purchitem[0] = 1; //purchased book #1 checkbox enabled
> > $purchitem[1] = 3; //purchased book #3 checkbox enabled
> > $purchitem[2] = 4; //purchased book #4 checkbox enabled
> > I want to end up with a variable like this:
> > $mask = "10110";
>
> Get it now? ;-)
Nah, that's dead easy:
$mask = str_repeat("0", number_of_books_to_be_tracked);
foreach($purchitem as $book_no): $mask{$book_no} = "1"; endforeach;
Cheers!
Mike
---------------------------------------------------------------------
Mike Ford, Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS, LS6 3QS, United Kingdom
Email: m.ford
lmu.ac.uk
Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211
attached mail follows:
You can use array with the user permissions (stored in a session variable), and use it someway like if($_SESSION['perm']['do_that']) echo '<a href="do_that.php">Do that</a>';
Shaun wrote:
>Hi > >I want to make a secure site. The username , password and permission of the >users must be stored in database. >I only want certain icons (navigation bars) to be available to certain >users. How would i be able to do this with permissions ? > >Thanks > Shaun > > > > >
attached mail follows:
On Wed, 6 Nov 2002, John W. Holmes wrote:
JWH>You must call session_start before any output to the browser. A blank JWH>line or space outside of PHP blocks is considered output. The error JWH>message tells you exactly where the output started. Read the manual for JWH>more information, it's all covered.
Hello,
Actually i have started some javascript where its pointing as error..other than that i didn;t leave any line space..Can any one please tell me how to do this..
Regards Uma
attached mail follows:
> JWH>You must call session_start before any output to the browser. A blank > JWH>line or space outside of PHP blocks is considered output. The error > JWH>message tells you exactly where the output started. Read the manual > for > JWH>more information, it's all covered. > > Hello, > > Actually i have started some javascript where its pointing as > error..other than that i didn;t leave any line space..Can any one please > tell me how to do this.. > > Regards > Uma
Okay.... anything outside of the <? And ?> php tags is considered output to the browser. Session_start must be before all of this.
In other words, you file should start like this:
<? session_start();
//other PHP stuff ?> <html> ...
---John Holmes...
attached mail follows:
I need a function that rounds up fractions (0.10) not an integer like ceil, or what parameters do I need to give to ceil() to round up fractions? I hope you understood me. Thanxs. MArcelo
attached mail follows:
> I need a function that rounds up fractions (0.10) not an integer like > ceil, or what parameters do I need to give to ceil() to round up > fractions? > I hope you understood me. > Thanxs. > Marcelo
How about round()?
www.php.net/round
---John Holmes...
attached mail follows:
I have read from various sources that Zend Engine 2 will make an appearance in PHP 5.0. It's a pretty significant update, and as such, I doubt it would be smart to implement it in the middle of a major series (4.x).
Mind you, it's been a while since I've read anything on ZE2, so things may have changed by now... the PHP powers that be would only be able to give me a definitive answer.
-- Aaron Gould webdevelpartscanada.com Web Developer Parts Canada
----- Original Message ----- From: <matt
eclecticperceptions.com> To: <php-general
lists.php.net> Sent: Tuesday, November 05, 2002 8:31 PM Subject: [PHP] PHP 4.3.0 and Zend Engine 2
> Can anybody tell me if PHP 4.3.0 will use Zend Engine 2? > > Thanks, > matt westgate > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
PHP 4.2.* has "register_globals = off" as a default. You variables has to be $_POST["fname"] or $_POST["fname"] or $_SERVER["PHP_SELF"] etc.,
or you can simple incides one file eg.
//extract.php <? extract($_SERVER); extract($_ENV); extract($_GET); extract($_POST); extract($_REQUEST); ?>
in your old codes...
require_once "extract.php";
"Alexander Piavka" <piavka
cs.bgu.ac.il> wrote in message
news:Pine.GSO.4.33.0211061433030.21449-200000
indigo...
>
> Hi, we have upgraded from php4.0.6 to php4.2.2
> The problem is that php4.2.2 remembers last GET and POST vars in
HTTP_SESSION_VARS also.
> This ruins the functionality of many programs we are running.
> both 4.0.6 and 4.2.2 were configured and compiled with exactly the same
> parameters and we are using the same php.ini conf (which is attached in
the mail)
>
> In the features added between 4.0.6 and 4.2.2 we did not notice any
> changes that make such a change in php behaviour.
> Please advise how can we fix this behaviour without making changes in the
> code.
> Thanks a lot
>
> ps. these are configure options for php4.0.6 and php4.2.2 we used.
>
>
./configure --prefix=/usr/local/web/progs/php-4.0.6 --with-db3 --with-db --w
ith-jpeg-dir -with-tiff-dir \
> --with-jpeg-dir --with-png-dir --enable-force-cgi-redirect --enable-discar
d-path --with-openssl \
> --with-zlib --with-bz2 --enable-ftp --with-gettext --enable-sockets --enab
le-shared \
> --with-gnu-ld --enable-versioning --enable-static --with-config-file-path=
/usr/local/web/apache-php/conf \
> --enable-magic-quotes --enable-track-vars --with-apxs=/usr/local/web/apach
e-php/bin/apxs \
> --with-tsrm-pthreads --enable-yp --with-kerberos --with-imap --with-imap-s
sl --without-dmalloc \
> --enable-trans-sid --enable-mbstr-enc-trans --enable-mbstring
>
>
./configure --prefix=/usr/local/web/progs/php-4.2.2 --with-db3 --with-db --
with-jpeg-dir -with-tiff-dir \
> --with-jpeg-dir --with-png-dir --enable-force-cgi-redirect --enable-discar
d-path --with-openssl \
> --with-zlib --with-bz2 --enable-ftp --with-gettext --enable-sockets --enab
le-shared \
> --with-gnu-ld --enable-versioning --enable-static --with-config-file-path=
/usr/local/web/apache-php/conf \
> --enable-magic-quotes --enable-track-vars --with-apxs=/usr/local/web/apach
e-php/bin/apxs \
> --with-tsrm-pthreads --enable-yp --with-kerberos --with-imap --with-imap-s
sl --without-dmalloc \
> --enable-trans-sid --enable-mbstr-enc-trans --enable-mbstring
>
attached mail follows:
but in the php.ini i have "register_globals = on"
> PHP 4.2.* has "register_globals = off" as a default. You variables has to
> be $_POST["fname"] or $_POST["fname"] or $_SERVER["PHP_SELF"] etc.,
>
> or you can simple incides one file
> eg.
>
> //extract.php
> <?
> extract($_SERVER);
> extract($_ENV);
> extract($_GET);
> extract($_POST);
> extract($_REQUEST);
> ?>
>
> in your old codes...
>
> require_once "extract.php";
>
> "Alexander Piavka" <piavka
cs.bgu.ac.il> wrote in message
> news:Pine.GSO.4.33.0211061433030.21449-200000
indigo...
> >
> > Hi, we have upgraded from php4.0.6 to php4.2.2
> > The problem is that php4.2.2 remembers last GET and POST vars in
> HTTP_SESSION_VARS also.
> > This ruins the functionality of many programs we are running.
> > both 4.0.6 and 4.2.2 were configured and compiled with exactly the same
> > parameters and we are using the same php.ini conf (which is attached in
> the mail)
> >
> > In the features added between 4.0.6 and 4.2.2 we did not notice any
> > changes that make such a change in php behaviour.
> > Please advise how can we fix this behaviour without making changes in the
> > code.
> > Thanks a lot
> >
> > ps. these are configure options for php4.0.6 and php4.2.2 we used.
> >
> >
> ./configure --prefix=/usr/local/web/progs/php-4.0.6 --with-db3 --with-db --w
> ith-jpeg-dir -with-tiff-dir \
> > --with-jpeg-dir --with-png-dir --enable-force-cgi-redirect --enable-discar
> d-path --with-openssl \
> > --with-zlib --with-bz2 --enable-ftp --with-gettext --enable-sockets --enab
> le-shared \
> > --with-gnu-ld --enable-versioning --enable-static --with-config-file-path=
> /usr/local/web/apache-php/conf \
> > --enable-magic-quotes --enable-track-vars --with-apxs=/usr/local/web/apach
> e-php/bin/apxs \
> > --with-tsrm-pthreads --enable-yp --with-kerberos --with-imap --with-imap-s
> sl --without-dmalloc \
> > --enable-trans-sid --enable-mbstr-enc-trans --enable-mbstring
> >
> >
> ./configure --prefix=/usr/local/web/progs/php-4.2.2 --with-db3 --with-db --
> with-jpeg-dir -with-tiff-dir \
> > --with-jpeg-dir --with-png-dir --enable-force-cgi-redirect --enable-discar
> d-path --with-openssl \
> > --with-zlib --with-bz2 --enable-ftp --with-gettext --enable-sockets --enab
> le-shared \
> > --with-gnu-ld --enable-versioning --enable-static --with-config-file-path=
> /usr/local/web/apache-php/conf \
> > --enable-magic-quotes --enable-track-vars --with-apxs=/usr/local/web/apach
> e-php/bin/apxs \
> > --with-tsrm-pthreads --enable-yp --with-kerberos --with-imap --with-imap-s
> sl --without-dmalloc \
> > --enable-trans-sid --enable-mbstr-enc-trans --enable-mbstring
> >
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
Piavlo XanderAl BGU CS Lab Evil Admin
attached mail follows:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Hey, I think your problem has something to do with "--enable-mbstr-enc-trans". I remember hearing about problems with that.....check the archives(I think it was on PHP-DEV). HTH! ~Paul
On Wednesday 06 November 2002 05:04 am, Daniele Baroncelli wrote: > No one replied to this message yet. > I am trying to address it again, as probably the previuos newsmessage title > wasn't very descriptive. > > Thanks > > Daniele > > > ================= > > Hi guys, > > I have very weird problem. > > I have installed the PHP version 4.2.3 on the LINUX virtual server of my > web project. > Previously I had the PHP version 4.0.6. > > The error I get is very weird. > When I insert a record with the phpMyAdmin, the first 4 characters of each > field don't get saved. > Same thing happened with some data entry interfaces I coded! > > > The only difference I can see in the two installation (provided the php.ini > file is in the same location): > > The old version 4.0.6 was installed by the server provider and my virtual > server space I can only see the .so file. > The new version 4.2.3 is actually inside my virtual server space. > Hence, the path I provided in the php configuration is different (I don't > have idea if this can influence something). > > NEW VERSION (4.2.3) configuration run by me > './configure' '--with-apxs=/usr/local/apache/1.3/bin/apxs' > '--prefix=/usr/home/rockit/usr/local' > '--with-mysql=/usr/home/rockit/usr/local/mysql' '--with-xml' > '--enable-xslt' '--with-xslt-sablot=/usr/home/rockit/usr/local' > '--with-regex=system' '--with-expat-dir=/usr/home/rockit/usr/local' > '--with-iconv=/usr/home/rockit/usr/local' '--enable-inline-optimization' > '--disable-debug' '--enable-memory-limit' '--enable-sigchild' > '--without-pear' '--enable-mbstring' '--enable-mbstr-enc-trans' > '--with-gdbm=/usr/local' '--enable-sockets' '--enable-versioning' > '--with-ttf=/usr/local' '--enable-ftp' '--with-gd=/usr/local' '--with-zlib' > '--enable-gd-native-ttf' > > OLD VERSION (4.0.6) configuration run by the server provider > './configure' '--enable-inline-optimization' > '--with-apxs=/usr/local/apache/1.3/bin/apxs' > '--with-config-file-path=/usr/local/lib' '--disable-debug' > '--enable-memory-limit' '--enable-sigchild' '--with-gettext' > '--without-pear' '--with-regex=system' '--enable-mbstring' > '--enable-mbstr-enc-trans' '--with-iconv=/usr/local' > '--with-gdbm=/usr/local' '--with-dbm=/usr/local' '--enable-sockets' > '--enable-versioning' '--with-freetype-dir=/usr/local' > '--with-ttf=/usr/local' '--enable-ftp' '--with-curl=/usr/local/curl' > '--with-openssl=/usr/local/openssl' '--with-gd=/usr/local' > '--with-freetype-dir=/usr/local' '--with-ttf=/usr/local' > '--with-jpeg-dir=/usr/local' '--with-png-dir=/usr/local' > '--with-t1lib=/usr/local' '--with-zlib' '--enable-gd-native-ttf' > '--with-imap' '--with-mcrypt=/usr/local' '--with-mhash=/usr/local' > '--with-dom=/usr/local' '--with-mysql=/usr/local/mysql' '--with-zlib' > '--with-zlib' > > > I must admit that I didn't not include all parameter as the old > installation, as I didn't know most options and thought is not needed. In > the new installation I instead provided additional XML parameter (after > installing the correspond modules, which all seem to work fine). > > > Hints on problem are very well welcome! > > > Daniele
- --
~Paul Nicholson
Design Specialist
WebPower Design
"The web....the way you want it!"
paul
webpowerdesign.net
"It said uses Windows 98 or better, so I loaded Linux!" Registered Linux User #183202 using Register Linux System # 81891 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (GNU/Linux) Comment: For info see http://www.gnupg.org
iD8DBQE9yRVvDyXNIUN3+UQRAmRaAJ4+XnqM9eIkG2XKeXI3Pam3emXl7wCfUmnH sXth4YcEhlJJ5LiZOTdFNA8= =kkzH -----END PGP SIGNATURE-----
attached mail follows:
Are you aware of register_globals = off?
It might be the problem. You can set register_globals = on in php.ini
or
you better use $_POST, $_GET, $_SERVER ...
eg.
$fname -> $_POST["finame"] or $_GET["fname"]
"Daniele Baroncelli" <ubimmc93
libero.it> wrote in message
news:20021106100419.63359.qmail
pb1.pair.com...
> No one replied to this message yet.
> I am trying to address it again, as probably the previuos newsmessage
title
> wasn't very descriptive.
>
> Thanks
>
> Daniele
>
>
> =================
>
> Hi guys,
>
> I have very weird problem.
>
> I have installed the PHP version 4.2.3 on the LINUX virtual server of my
web
> project.
> Previously I had the PHP version 4.0.6.
>
> The error I get is very weird.
> When I insert a record with the phpMyAdmin, the first 4 characters of each
> field don't get saved.
> Same thing happened with some data entry interfaces I coded!
>
>
> The only difference I can see in the two installation (provided the
php.ini
> file is in the same location):
>
> The old version 4.0.6 was installed by the server provider and my virtual
> server space I can only see the .so file.
> The new version 4.2.3 is actually inside my virtual server space.
> Hence, the path I provided in the php configuration is different (I don't
> have idea if this can influence something).
>
> NEW VERSION (4.2.3) configuration run by me
> './configure' '--with-apxs=/usr/local/apache/1.3/bin/apxs'
> '--prefix=/usr/home/rockit/usr/local'
> '--with-mysql=/usr/home/rockit/usr/local/mysql' '--with-xml'
'--enable-xslt'
> '--with-xslt-sablot=/usr/home/rockit/usr/local' '--with-regex=system'
> '--with-expat-dir=/usr/home/rockit/usr/local'
> '--with-iconv=/usr/home/rockit/usr/local' '--enable-inline-optimization'
> '--disable-debug' '--enable-memory-limit' '--enable-sigchild'
> '--without-pear' '--enable-mbstring' '--enable-mbstr-enc-trans'
> '--with-gdbm=/usr/local' '--enable-sockets' '--enable-versioning'
> '--with-ttf=/usr/local' '--enable-ftp' '--with-gd=/usr/local'
'--with-zlib'
> '--enable-gd-native-ttf'
>
> OLD VERSION (4.0.6) configuration run by the server provider
> './configure' '--enable-inline-optimization'
> '--with-apxs=/usr/local/apache/1.3/bin/apxs'
> '--with-config-file-path=/usr/local/lib' '--disable-debug'
> '--enable-memory-limit' '--enable-sigchild' '--with-gettext'
> '--without-pear' '--with-regex=system' '--enable-mbstring'
> '--enable-mbstr-enc-trans' '--with-iconv=/usr/local'
> '--with-gdbm=/usr/local' '--with-dbm=/usr/local' '--enable-sockets'
> '--enable-versioning' '--with-freetype-dir=/usr/local'
> '--with-ttf=/usr/local' '--enable-ftp' '--with-curl=/usr/local/curl'
> '--with-openssl=/usr/local/openssl' '--with-gd=/usr/local'
> '--with-freetype-dir=/usr/local' '--with-ttf=/usr/local'
> '--with-jpeg-dir=/usr/local' '--with-png-dir=/usr/local'
> '--with-t1lib=/usr/local' '--with-zlib' '--enable-gd-native-ttf'
> '--with-imap' '--with-mcrypt=/usr/local' '--with-mhash=/usr/local'
> '--with-dom=/usr/local' '--with-mysql=/usr/local/mysql' '--with-zlib'
> '--with-zlib'
>
>
> I must admit that I didn't not include all parameter as the old
> installation, as I didn't know most options and thought is not needed. In
> the new installation I instead provided additional XML parameter (after
> installing the correspond modules, which all seem to work fine).
>
>
> Hints on problem are very well welcome!
>
>
> Daniele
>
>
attached mail follows:
[snip] What the hell is XML anyway? [/snip]
Extensible Markup Language, a derivitave of SGML (Standard Generalized Markup Language). You can read all about it at http://www.w3c.org
HTH!
Jay
attached mail follows:
Just read things here:
http://www.phpbeginner.com/ray/xml http://www.vbxml.com/xml/articles/whatisxml/ http://www.zvon.org http://www.xml.com
You should learn it if haven't done so yet
-- Maxim Maletsky maximphp.net
"Jay Blanchard" <jay.blanchard
niicommunications.com> wrote... :
> [snip] > What the hell is XML anyway? > [/snip] > > Extensible Markup Language, a derivitave of SGML (Standard Generalized > Markup Language). You can read all about it at http://www.w3c.org > > HTH! > > Jay > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >
attached mail follows:
[snip] Where is there a good place to learn How and what the ( ) means and what to put in qoautes Basically the right way to properly code? [/snip]
If you want to learn PHP start with http://www.php.net . Also there are many good books on the subject of programming which illustrate many methods of coding. Search http://www.amazon.com for computer programming languages.
HTH!
Jay
attached mail follows:
> On Wednesday 06 November 2002 16:52, Steve Jackson wrote: > > Ok this is starting to get complex! (For me anyway) > > This is my function: > > function get_order_numbers() > > { > > $conn = db_connect(); > > $query = "select orders.orderid from orders, email where > > orders.orderid = email.orderid and email.checked='no'"; $result = > > mysql_query($query) or die("Error: cannot select > > orderid<BR>$query<BR>".mysql_error()); > > while( $row = mysql_fetch_array($result)) > > { > > extract($row); > > According to your query it should return a single result > (assuming your > orderid is unique -- and it should be), and that single > result contains a > single field called "orderid". > > Use print_r($row) to see exactly what it contains (good for > reference and > debugging).
It doesn't contain a single result. It returns 16 order numbers (which is correct - 8 should be in the table emails with no checked and therefore the query has worked and pulled out 8 from the orders table also). What I want the function to do is say OK where the orderid's match pull out all the address details for each orderid and display what I want displayed accordingly. At the moment I get this array returned by using print_r($row). Array ( [0] => 100040 [orderid] => 100040 ) Array ( [0] => 100041 [orderid] => 100041 ) Array ( [0] => 100043 [orderid] => 100043 ) Array ( [0] => 100044 [orderid] => 100044 ) Array ( [0] => 100046 [orderid] => 100046 ) Array ( [0] => 100050 [orderid] => 100050 ) Array ( [0] => 100051 [orderid] => 100051 ) Array ( [0] => 100052 [orderid] => 100052 )
Where do I go from here?
attached mail follows:
On Wednesday 06 November 2002 21:46, Steve Jackson wrote:
> It doesn't contain a single result. It returns 16 order numbers (which > is correct - 8 should be in the table emails with no checked and > therefore the query has worked and pulled out 8 from the orders table > also). What I want the function to do is say OK where the orderid's > match pull out all the address details for each orderid and display what > I want displayed accordingly. At the moment I get this array returned by > using print_r($row). > Array ( [0] => 100040 [orderid] => 100040 ) Array ( [0] => 100041 > [orderid] => 100041 ) Array ( [0] => 100043 [orderid] => 100043 ) Array > ( [0] => 100044 [orderid] => 100044 ) Array ( [0] => 100046 [orderid] => > 100046 ) Array ( [0] => 100050 [orderid] => 100050 ) Array ( [0] => > 100051 [orderid] => 100051 ) Array ( [0] => 100052 [orderid] => 100052 ) > > Where do I go from here?
Well, like I said in my previous post if you remove the line:
$orderid = $row;
then your second query *should* work.
-- Jason Wong -> Gremlins Associates -> www.gremlins.com.hk Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development */* New members are urgently needed in the Society for Prevention of Cruelty to Yourself. Apply within. */
attached mail follows:
Hello,
does anyone have experience with implementation of electronic pay system for website based on PHP? Can you give me directions about this?
-- Best regards, Martin Hudec mailto:corwincorwin.sk
attached mail follows:
At 14:50 06.11.2002, Martin Hudec said: --------------------[snip]-------------------- >Hello, > >does anyone have experience with implementation of electronic pay >system for website based on PHP? Can you give me directions about >this? > --------------------[snip]--------------------
Usually these sites have an interface based on SSL to POST data to, optionally calling back any URL you submit (at least FirePay works this way).
You might consider using curl to SSL-post data to the CC aquirer.
Most clearing houses are offering prefab PHP solutions, with and/or without a little shop solution. Try to check the docs with your aquirer.
--
>O Ernest E. Vogelsinger
(\) ICQ #13394035
^ http://www.vogelsinger.at/
attached mail follows:
I'm working myself through Julie C. Meloni's book "PHP" and now I'm stuck at chapter 12. My script gives me this error: You have an error in your SQL syntax near '()' at line 1 even tho I've even tried replacing my own work with the file from the book's companion-files. I'd be very happy if someone would take the time to look through this and tell me what the problem might be. Hard to move forward when I don't understand this.
Here's the script:
<? //indicate the database you want to use $db_name ="testDB";
//connect to database
$connection =
mysql_connect("localhost","john","doe99") or
die(mysql_error());
$db =
mysql_select_db($db_name,$connection) or die(mysql_error());
//start creating the SQL statement $sql ="CREATE TABLE $_POST[table_name] ((";
//continue the SQL statement for each new field for ($i =0;$i < count($_POST[field_name]);$i++){ $sql .= $_POST[field_name][$i]."".$_POST[field_type][$i]; if ($_POST [field_length][$i] != "") { $sql .= "(".$_POST [field_length][$i]."),"; } else { $sql .= ","; } }
//clean up the end of the string $sql = substr($sql,0,-1); $sql .= ")";
//execute the query $result = mysql_query($sql,$connection) or die(mysql_error());
//get a good message for display upon success if ($result) { $msg ="<P>".$_POST[table_name]." has been created!</P>"; }
?>
<HTML> <HEAD> <TITLE>Create a Database Table:Step 3</TITLE> </HEAD> <BODY> <h1>Adding table to <? echo "$db_name"; ?>...</h1>
<? echo "$msg"; ?>
</BODY> </HTML>
attached mail follows:
I am not php expert but why are there two (( after your create table?
-----Original Message-----
From: Markus Jäntti [mailto:janmark
bodo.kommune.no]
Sent: Wednesday, November 06, 2002 8:34 AM
To: php-general
lists.php.net
Subject: [PHP] New to PHP, and stuck
I'm working myself through Julie C. Meloni's book "PHP" and now I'm stuck at chapter 12. My script gives me this error: You have an error in your SQL syntax near '()' at line 1 even tho I've even tried replacing my own work with the file from the book's companion-files. I'd be very happy if someone would take the time to look through this and tell me what the problem might be. Hard to move forward when I don't understand this.
Here's the script:
<? //indicate the database you want to use $db_name ="testDB";
//connect to database
$connection =
mysql_connect("localhost","john","doe99") or
die(mysql_error());
$db =
mysql_select_db($db_name,$connection) or die(mysql_error());
//start creating the SQL statement $sql ="CREATE TABLE $_POST[table_name] ((";
//continue the SQL statement for each new field for ($i =0;$i < count($_POST[field_name]);$i++){ $sql .= $_POST[field_name][$i]."".$_POST[field_type][$i]; if ($_POST [field_length][$i] != "") { $sql .= "(".$_POST [field_length][$i]."),"; } else { $sql .= ","; } }
//clean up the end of the string $sql = substr($sql,0,-1); $sql .= ")";
//execute the query $result = mysql_query($sql,$connection) or die(mysql_error());
//get a good message for display upon success if ($result) { $msg ="<P>".$_POST[table_name]." has been created!</P>"; }
?>
<HTML> <HEAD> <TITLE>Create a Database Table:Step 3</TITLE> </HEAD> <BODY> <h1>Adding table to <? echo "$db_name"; ?>...</h1>
<? echo "$msg"; ?>
</BODY> </HTML>
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
Markus JäNtti wrote: > I'm working myself through Julie C. Meloni's book "PHP" and now I'm > stuck at chapter 12. > My script gives me this error: You have an error in your SQL syntax > near '()' at line 1 > even tho I've even tried replacing my own work with the file from the > book's companion-files. > I'd be very happy if someone would take the time to look through this > and tell me what the problem might be. Hard to move forward when I > don't understand this. >
The $_POST array exists of keys and values. The keys are strings (in the case of $_POST), so you'll have to access them like strings. Use $_POST['table_name'] instead of $_POST[table_name]. The same goed also for $_POST[field_name], $_POST[field_type] and $_POST[field_length].
HTH Erwin
> <?
> //indicate the database you want to use
> $db_name ="testDB";
>
> //connect to database
> $connection =
mysql_connect("localhost","john","doe99") or
> die(mysql_error());
> $db =
mysql_select_db($db_name,$connection) or die(mysql_error());
>
> //start creating the SQL statement
> $sql ="CREATE TABLE $_POST[table_name] ((";
>
> //continue the SQL statement for each new field
> for ($i =0;$i < count($_POST[field_name]);$i++){
> $sql .= $_POST[field_name][$i]."".$_POST[field_type][$i];
> if ($_POST [field_length][$i] != "") {
> $sql .= "(".$_POST [field_length][$i]."),";
> } else {
> $sql .= ",";
> }
> }
>
> //clean up the end of the string
> $sql = substr($sql,0,-1);
> $sql .= ")";
>
> //execute the query
> $result = mysql_query($sql,$connection) or die(mysql_error());
>
> //get a good message for display upon success
> if ($result) {
> $msg ="<P>".$_POST[table_name]." has been created!</P>";
> }
>
> ?>
>
> <HTML>
> <HEAD>
> <TITLE>Create a Database Table:Step 3</TITLE>
> </HEAD>
> <BODY>
> <h1>Adding table to <? echo "$db_name"; ?>...</h1>
>
> <? echo "$msg"; ?>
>
> </BODY>
> </HTML>
attached mail follows:
ok, nevermind, I think I see why...
-----Original Message-----
From: Edward Peloke [mailto:epeloke
echoman.com]
Sent: Wednesday, November 06, 2002 9:20 AM
To: Markus Jäntti; php-general
lists.php.net
Subject: RE: [PHP] New to PHP, and stuck
I am not php expert but why are there two (( after your create table?
-----Original Message-----
From: Markus Jäntti [mailto:janmark
bodo.kommune.no]
Sent: Wednesday, November 06, 2002 8:34 AM
To: php-general
lists.php.net
Subject: [PHP] New to PHP, and stuck
I'm working myself through Julie C. Meloni's book "PHP" and now I'm stuck at chapter 12. My script gives me this error: You have an error in your SQL syntax near '()' at line 1 even tho I've even tried replacing my own work with the file from the book's companion-files. I'd be very happy if someone would take the time to look through this and tell me what the problem might be. Hard to move forward when I don't understand this.
Here's the script:
<? //indicate the database you want to use $db_name ="testDB";
//connect to database
$connection =
mysql_connect("localhost","john","doe99") or
die(mysql_error());
$db =
mysql_select_db($db_name,$connection) or die(mysql_error());
//start creating the SQL statement $sql ="CREATE TABLE $_POST[table_name] ((";
//continue the SQL statement for each new field for ($i =0;$i < count($_POST[field_name]);$i++){ $sql .= $_POST[field_name][$i]."".$_POST[field_type][$i]; if ($_POST [field_length][$i] != "") { $sql .= "(".$_POST [field_length][$i]."),"; } else { $sql .= ","; } }
//clean up the end of the string $sql = substr($sql,0,-1); $sql .= ")";
//execute the query $result = mysql_query($sql,$connection) or die(mysql_error());
//get a good message for display upon success if ($result) { $msg ="<P>".$_POST[table_name]." has been created!</P>"; }
?>
<HTML> <HEAD> <TITLE>Create a Database Table:Step 3</TITLE> </HEAD> <BODY> <h1>Adding table to <? echo "$db_name"; ?>...</h1>
<? echo "$msg"; ?>
</BODY> </HTML>
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
The first thing I do when confronted with this kind of problem is to print out the sql statement and carefully look through it. So if you have not done this yet, comment out the $result = statement. Above that add an echo $sql; Now look through the sql statement and make sure all fields are there and there is no syntax problem with your query, this is most likley the case. If you are using mysql I would recommend downloading phpMyAdmin which is a php GUI interface to mysql, once this is running, you can simply cut and paste the sql statement into the phpMyAdmin query box and try to run it from there, it will tell you where your syntax is wrong.
HTH, Steve Bradwell MIS Department.
"If you give someone a program, you will frustrate them for a day. If you teach them how to program, you will frustrate them for a lifetime."
-----Original Message-----
From: Markus Jäntti [mailto:janmark
bodo.kommune.no]
Sent: Wednesday, November 06, 2002 8:34 AM
To: php-general
lists.php.net
Subject: [PHP] New to PHP, and stuck
I'm working myself through Julie C. Meloni's book "PHP" and now I'm stuck at chapter 12. My script gives me this error: You have an error in your SQL syntax near '()' at line 1 even tho I've even tried replacing my own work with the file from the book's companion-files. I'd be very happy if someone would take the time to look through this and tell me what the problem might be. Hard to move forward when I don't understand this.
Here's the script:
<? //indicate the database you want to use $db_name ="testDB";
//connect to database
$connection =
mysql_connect("localhost","john","doe99") or
die(mysql_error());
$db =
mysql_select_db($db_name,$connection) or die(mysql_error());
//start creating the SQL statement $sql ="CREATE TABLE $_POST[table_name] ((";
//continue the SQL statement for each new field for ($i =0;$i < count($_POST[field_name]);$i++){ $sql .= $_POST[field_name][$i]."".$_POST[field_type][$i]; if ($_POST [field_length][$i] != "") { $sql .= "(".$_POST [field_length][$i]."),"; } else { $sql .= ","; } }
//clean up the end of the string $sql = substr($sql,0,-1); $sql .= ")";
//execute the query $result = mysql_query($sql,$connection) or die(mysql_error());
//get a good message for display upon success if ($result) { $msg ="<P>".$_POST[table_name]." has been created!</P>"; }
?>
<HTML> <HEAD> <TITLE>Create a Database Table:Step 3</TITLE> </HEAD> <BODY> <h1>Adding table to <? echo "$db_name"; ?>...</h1>
<? echo "$msg"; ?>
</BODY> </HTML>
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
Also, you should echo out $sql so you can see what is actually created. It will probably be obvious what the error is.
---John Holmes...
----- Original Message -----
From: "Edward Peloke" <epeloke
echoman.com>
To: "Markus Jäntti" <janmark
bodo.kommune.no>; <php-general
lists.php.net>
Sent: Wednesday, November 06, 2002 9:19 AM
Subject: RE: [PHP] New to PHP, and stuck
> I am not php expert but why are there two (( after your create table?
>
> -----Original Message-----
> From: Markus Jäntti [mailto:janmark
bodo.kommune.no]
> Sent: Wednesday, November 06, 2002 8:34 AM
> To: php-general
lists.php.net
> Subject: [PHP] New to PHP, and stuck
>
>
> I'm working myself through Julie C. Meloni's book "PHP" and now I'm stuck
at
> chapter 12.
> My script gives me this error: You have an error in your SQL syntax near
> '()' at line 1
> even tho I've even tried replacing my own work with the file from the
book's
> companion-files.
> I'd be very happy if someone would take the time to look through this and
> tell me what the problem might be. Hard to move forward when I don't
> understand this.
>
> Here's the script:
>
>
> <?
> //indicate the database you want to use
> $db_name ="testDB";
>
> //connect to database
> $connection =
mysql_connect("localhost","john","doe99") or
> die(mysql_error());
> $db =
mysql_select_db($db_name,$connection) or die(mysql_error());
>
> //start creating the SQL statement
> $sql ="CREATE TABLE $_POST[table_name] ((";
>
> //continue the SQL statement for each new field
> for ($i =0;$i < count($_POST[field_name]);$i++){
> $sql .= $_POST[field_name][$i]."".$_POST[field_type][$i];
> if ($_POST [field_length][$i] != "") {
> $sql .= "(".$_POST [field_length][$i]."),";
> } else {
> $sql .= ",";
> }
> }
>
> //clean up the end of the string
> $sql = substr($sql,0,-1);
> $sql .= ")";
>
> //execute the query
> $result = mysql_query($sql,$connection) or die(mysql_error());
>
> //get a good message for display upon success
> if ($result) {
> $msg ="<P>".$_POST[table_name]." has been created!</P>";
> }
>
> ?>
>
> <HTML>
> <HEAD>
> <TITLE>Create a Database Table:Step 3</TITLE>
> </HEAD>
> <BODY>
> <h1>Adding table to <? echo "$db_name"; ?>...</h1>
>
> <? echo "$msg"; ?>
>
> </BODY>
> </HTML>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
attached mail follows:
At 14:34 06.11.2002, Markus Jäntti said: --------------------[snip]-------------------- >$sql ="CREATE TABLE $_POST[table_name] (("; --------------------[snip]--------------------
If you are including an array expression within a string, you should enclose it in curly braces, like this:
$sql ="CREATE TABLE {$_POST[table_name]} ((";
--
>O Ernest E. Vogelsinger
(\) ICQ #13394035
^ http://www.vogelsinger.at/
attached mail follows:
At 13:39 06.11.2002, Marek Kilimajer said: --------------------[snip]-------------------- >Do you have libcurl intaled? > >Ernest E Vogelsinger wrote: > >>Hi list, >> >>maybe someone has a simple answer to this: >> >>I am running Apache 1.3.22 with libphp4.so. Everything's fine, but when >>starting php from the command line I get: >> >>php: relocation error: php: undefined symbol: curl-global-init >> >>Any idea what I should try? --------------------[snip]--------------------
Yes, I have (located in /usr/lib). With the apache module, as I said, PHP works, even curl calls.
I'm not really a Linux guru, but I found that /usr/lib is nowhere mentioned in the environment (# env). Shouldn't this?
--
>O Ernest E. Vogelsinger
(\) ICQ #13394035
^ http://www.vogelsinger.at/
attached mail follows:
Ernest E Vogelsinger wrote:
>At 13:39 06.11.2002, Marek Kilimajer said: >--------------------[snip]-------------------- > > >>Do you have libcurl intaled? >> >>Ernest E Vogelsinger wrote: >> >> >> >>>Hi list, >>> >>>maybe someone has a simple answer to this: >>> >>>I am running Apache 1.3.22 with libphp4.so. Everything's fine, but when >>>starting php from the command line I get: >>> >>>php: relocation error: php: undefined symbol: curl-global-init >>> >>>Any idea what I should try? >>> >>> >--------------------[snip]-------------------- > >Yes, I have (located in /usr/lib). With the apache module, as I said, PHP >works, even curl calls. > >I'm not really a Linux guru, but I found that /usr/lib is nowhere mentioned >in the environment (# env). Shouldn't this? > > No, this is not neccessery. Maybe you don't have the right version. Where did you get apache and php rpms?
attached mail follows:
Where does "ldd libphp4.so" point to?
Ernest E Vogelsinger wrote:
>At 15:41 06.11.2002, Marek Kilimajer spoke out and said: >--------------------[snip]-------------------- > > >>>Yes, I have (located in /usr/lib). With the apache module, as I said, PHP >>>works, even curl calls. >>> >>>I'm not really a Linux guru, but I found that /usr/lib is nowhere mentioned >>>in the environment (# env). Shouldn't this? >>> >>> >>> >>> >>No, this is not neccessery. Maybe you don't have the right version. >>Where did you get apache and php >>rpms? >> >> >--------------------[snip]-------------------- > >Both apache and php are compiled from the tarballs since RedHat doesn't >provide rpms with the latest versions. > >server-version sez: "Apache/1.3.22 (Unix) (Red-Hat/Linux) mod_ssl/2.8.5 >OpenSSL/0.9.6b DAV/1.0.2 PHP/4.2.2 mod_perl/1.26" > ># ls -al /usr/lib/libcurl* >-rw-r--r-- 1 root root 196084 Jun 20 08:28 /usr/lib/libcurl.a >-rwxr-xr-x 1 root root 719 Jun 20 08:28 /usr/lib/libcurl.la >lrwxrwxrwx 1 root root 16 Aug 4 19:47 /usr/lib/libcurl.so -> >libcurl.so.2.0.2 >-rw-rw-r-- 1 root root 95928 Aug 4 18:54 /usr/lib/libcurl.so.1 >lrwxrwxrwx 1 root root 16 Aug 4 19:47 /usr/lib/libcurl.so.2 -> >libcurl.so.2.0.2 >-rwxr-xr-x 1 root root 152214 Jun 20 08:28 /usr/lib/libcurl.so.2.0.2 > >grep curl_global_init /usr/lib/libcurl* returns: >Binary file /usr/lib/libcurl.a matches >Binary file /usr/lib/libcurl.so matches >Binary file /usr/lib/libcurl.so.2 matches >Binary file /usr/lib/libcurl.so.2.0.2 matches > >Any idea? > > > >
attached mail follows:
At 16:25 06.11.2002, Marek Kilimajer spoke out and said: --------------------[snip]-------------------- >Where does "ldd libphp4.so" point to? --------------------[snip]--------------------
Oops: # ldd libphp4.so ldd: ./libphp4.so: No such file or directory
I found libphp4.so in /etc/httpd/modules (the correct path for apache extensions on RedHat), and in /usr/lib/apache (from the default compile).
--
>O Ernest E. Vogelsinger
(\) ICQ #13394035
^ http://www.vogelsinger.at/
attached mail follows:
At 16:25 06.11.2002, Marek Kilimajer spoke out and said: --------------------[snip]-------------------- >Where does "ldd libphp4.so" point to? --------------------[snip]--------------------
Been too fast when hitting the reply button...
# ldd /etc/http/modules/libphp4.so libdl.so.2 => /lib/libdl.so.2 (0x40153000) libpam.so.0 => /lib/libpam.so.0 (0x40157000) libexpat.so.0 => /usr/lib/libexpat.so.0 (0x4015f000) libmm.so.11 => /usr/lib/libmm.so.11 (0x4017c000) libgmp.so.3 => /usr/lib/libgmp.so.3 (0x40181000) libgd.so.1.8 => /usr/lib/libgd.so.1.8 (0x401a3000) libfreetype.so.6 => /usr/lib/libfreetype.so.6 (0x401d5000) libjpeg.so.62 => /usr/lib/libjpeg.so.62 (0x40209000) libz.so.1 => /usr/lib/libz.so.1 (0x40228000) libm.so.6 => /lib/i686/libm.so.6 (0x40236000) libxml2.so.2 => /usr/lib/libxml2.so.2 (0x40259000) libgdbm.so.2 => /usr/lib/libgdbm.so.2 (0x402fe000) libcrypto.so.2 => /lib/libcrypto.so.2 (0x40305000) libssl.so.2 => /lib/libssl.so.2 (0x403c9000) >>> libcurl.so.2 => /usr/lib/libcurl.so.2 (0x403f6000) libbz2.so.1 => /usr/lib/libbz2.so.1 (0x40418000) libcrypt.so.1 => /lib/libcrypt.so.1 (0x40428000) libresolv.so.2 => /lib/libresolv.so.2 (0x40456000) libnsl.so.1 => /lib/libnsl.so.1 (0x40468000) libc.so.6 => /lib/i686/libc.so.6 (0x4047e000) libpng.so.2 => /usr/lib/libpng.so.2 (0x405ba000) /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x80000000)
BUT ]# ldd /usr/bin/php libpam.so.0 => /lib/libpam.so.0 (0x40028000) libssl.so.2 => /lib/libssl.so.2 (0x40030000) libcrypto.so.2 => /lib/libcrypto.so.2 (0x4005d000) libdl.so.2 => /lib/libdl.so.2 (0x40121000) libz.so.1 => /usr/lib/libz.so.1 (0x40125000) libresolv.so.2 => /lib/libresolv.so.2 (0x40133000) libexpat.so.0 => /usr/lib/libexpat.so.0 (0x40146000) libmm.so.11 => /usr/lib/libmm.so.11 (0x40163000) libpspell.so.4 => /usr/lib/libpspell.so.4 (0x40168000) libltdl.so.3 => /usr/lib/libltdl.so.3 (0x40182000) libpspell-modules.so.1 => /usr/lib/libpspell-modules.so.1 (0x40188000) libstdc++-libc6.2-2.so.3 => /usr/lib/libstdc++-libc6.2-2.so.3 (0x4018a000) libc.so.6 => /lib/i686/libc.so.6 (0x401cd000) libgmp.so.3 => /usr/lib/libgmp.so.3 (0x40309000) libgd.so.1.8 => /usr/lib/libgd.so.1.8 (0x4032a000) libxml2.so.2 => /usr/lib/libxml2.so.2 (0x4035c000) libdb-3.2.so => /lib/libdb-3.2.so (0x40400000) libgdbm.so.2 => /usr/lib/libgdbm.so.2 (0x404a7000) >>> libcurl.so.1 => /usr/lib/libcurl.so.1 (0x404af000) libbz2.so.1 => /usr/lib/libbz2.so.1 (0x404c9000) libcrypt.so.1 => /lib/libcrypt.so.1 (0x404d9000) libttf.so.2 => /usr/lib/libttf.so.2 (0x40506000) libm.so.6 => /lib/i686/libm.so.6 (0x40530000) libfreetype.so.6 => /usr/lib/libfreetype.so.6 (0x40553000) libpng.so.2 => /usr/lib/libpng.so.2 (0x40588000) libjpeg.so.62 => /usr/lib/libjpeg.so.62 (0x405aa000) libnsl.so.1 => /lib/libnsl.so.1 (0x405c9000) libgssapi_krb5.so.2 => /usr/kerberos/lib/libgssapi_krb5.so.2 (0x405df000) libkrb5.so.3 => /usr/kerberos/lib/libkrb5.so.3 (0x405f2000) libk5crypto.so.3 => /usr/kerberos/lib/libk5crypto.so.3 (0x4064a000) libcom_err.so.3 => /usr/kerberos/lib/libcom_err.so.3 (0x4065c000) /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000) libssl.so.0 => /usr/lib/libssl.so.0 (0x4065f000) libcrypto.so.0 => /usr/lib/libcrypto.so.0 (0x4068c000)
--
>O Ernest E. Vogelsinger
(\) ICQ #13394035
^ http://www.vogelsinger.at/
attached mail follows:
I think I have to re-explain the problem completely. I want to use this script in a login form. Once, someone is authenticated, then I register variables for indentifying him/her through session. After I register those variables I want to redirect him/her to a page, which required authenticated users (and it's done by registering variables through session). Due to this, I decide to use header: location. Futhermore, I use IE 5.5, Apache 1.3.26, PHP 4.2.1 [, MySQL 3.23.51] which running on Windows ME. Here is the script (register globals is off, due to security and default setting in php.ini).
<?php $user = $_POST['user']; $user = $_POST['password']; if (authenticate($user)) { session_start(); $_SESSION['user'] = $user; $_SESSION['password'] = $password; header('Location: http://www.mysite.com/member.php'); exit(); } else { header('Location: http://www.mysite.com/login.php'); exit(); } ?>
When I try this code with an authenticated user, it seemed browser don't redirect to the page I specify above. The progress bar looked like searching something then it led to an error. I don't know why this could happen.
Am I missing something?
Thank you.
huge junk mail <huge_junk_mail
yahoo.com> wrote:Can someone tell me why I can't have
$_SESSION['foo'] = 'content of foo';
following by
header('Location: http://www.mysite.com');
Someone from www.php.net told me that it can confuse browser (http://bugs.php.net/19991). But, still I can't the idea why it can happen. Does register session means sending a 'header: location' too?
Thanks.
===== Regards,
mahara
__________________________________________________ Do you Yahoo!? Y! Web Hosting - Let the expert host your web site http://webhosting.yahoo.com/
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.phpRegards,
mahara
--------------------------------- Do you Yahoo!? HotJobs - Search new jobs daily now
attached mail follows:
What I've done : 1. Allow the user to login 2. Use the login.php page as its own 'form action' 3. Let the login form decide when to redirect the user to the 'destination' page. 4. force the destination page (welcome.php) to do additional authentication checking by comparing the users input to some other piece of information (session variable, cookie, database info, etc...)
Pseudo code for login page
<? php if $user_input = something || $more_user_info=somethingelse { header ('Location: http://www.mysite.com/welcome.php'); } ?>
<HTML> what ever the login page looks like </html>
Pseudo code for welcome.php:
<? php if $user_input != something || $more_user_info!=somethingelse { header ('Location: http://www.mysite.com/login.php'); } ?>
<HTML> what ever the welcome page looks like </html>
-----Original Message-----
From: huge junk mail <huge_junk_mail
yahoo.com>
To: php-general
lists.php.net <php-general
lists.php.net>
Date: Wednesday, November 06, 2002 9:03 AM
Subject: Re: [PHP] session vs. header
>
>I think I have to re-explain the problem completely. I want to use this
script in a login form. Once, someone is authenticated, then I register
variables for indentifying him/her through session. After I register those
variables I want to redirect him/her to a page, which required authenticated
users (and it's done by registering variables through session). Due to this,
I decide to use header: location. Futhermore, I use IE 5.5, Apache 1.3.26,
PHP 4.2.1 [, MySQL 3.23.51] which running on Windows ME. Here is the script
(register globals is off, due to security and default setting in php.ini).
>
><?php
>$user = $_POST['user'];
>$user = $_POST['password'];
>if (authenticate($user))
>{
> session_start();
> $_SESSION['user'] = $user;
> $_SESSION['password'] = $password;
> header('Location: http://www.mysite.com/member.php');
> exit();
>}
>else
>{
> header('Location: http://www.mysite.com/login.php');
> exit();
>}
>?>
>
>When I try this code with an authenticated user, it seemed browser don't
redirect to the page I specify above. The progress bar looked like searching
something then it led to an error. I don't know why this could happen.
>
>Am I missing something?
>
>Thank you.
>
> huge junk mail <huge_junk_mail
yahoo.com> wrote:Can someone tell me why I
can't have
>
>$_SESSION['foo'] = 'content of foo';
>
>following by
>
>header('Location: http://www.mysite.com');
>
>Someone from www.php.net told me that it can confuse
>browser (http://bugs.php.net/19991). But, still I
>can't the idea why it can happen. Does register
>session means sending a 'header: location' too?
>
>Thanks.
>
>=====
>Regards,
>
>mahara
>
>__________________________________________________
>Do you Yahoo!?
>Y! Web Hosting - Let the expert host your web site
>http://webhosting.yahoo.com/
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>Regards,
>
>mahara
>
>
>---------------------------------
>Do you Yahoo!?
>HotJobs - Search new jobs daily now
attached mail follows:
I believe the php code gets executed before html code is processed.
-----Original Message-----
From: dwalker <dwalker
healthyproductsplus.com>
To: huge junk mail <huge_junk_mail
yahoo.com>; php-general
lists.php.net
<php-general
lists.php.net>
Date: Wednesday, November 06, 2002 10:44 AM
Subject: Re: [PHP] session vs. header
>What I've done :
>1. Allow the user to login
>2. Use the login.php page as its own 'form action'
>3. Let the login form decide when to redirect the user to the 'destination'
>page.
>4. force the destination page (welcome.php) to do additional authentication
>checking by comparing the users input to some other piece of information
>(session variable, cookie, database info, etc...)
>
>Pseudo code for login page
>
><? php
>if $user_input = something || $more_user_info=somethingelse {
>header ('Location: http://www.mysite.com/welcome.php');
>}
>?>
>
><HTML>
>what ever the login page looks like
></html>
>
>Pseudo code for welcome.php:
>
><? php
>if $user_input != something || $more_user_info!=somethingelse {
>header ('Location: http://www.mysite.com/login.php');
>}
>?>
>
><HTML>
>what ever the welcome page looks like
></html>
>
>
>
>
>
>
>
>-----Original Message-----
>From: huge junk mail <huge_junk_mail
yahoo.com>
>To: php-general
lists.php.net <php-general
lists.php.net>
>Date: Wednesday, November 06, 2002 9:03 AM
>Subject: Re: [PHP] session vs. header
>
>
>>
>>I think I have to re-explain the problem completely. I want to use this
>script in a login form. Once, someone is authenticated, then I register
>variables for indentifying him/her through session. After I register those
>variables I want to redirect him/her to a page, which required
authenticated
>users (and it's done by registering variables through session). Due to
this,
>I decide to use header: location. Futhermore, I use IE 5.5, Apache 1.3.26,
>PHP 4.2.1 [, MySQL 3.23.51] which running on Windows ME. Here is the script
>(register globals is off, due to security and default setting in php.ini).
>>
>><?php
>>$user = $_POST['user'];
>>$user = $_POST['password'];
>>if (authenticate($user))
>>{
>> session_start();
>> $_SESSION['user'] = $user;
>> $_SESSION['password'] = $password;
>> header('Location: http://www.mysite.com/member.php');
>> exit();
>>}
>>else
>>{
>> header('Location: http://www.mysite.com/login.php');
>> exit();
>>}
>>?>
>>
>>When I try this code with an authenticated user, it seemed browser don't
>redirect to the page I specify above. The progress bar looked like
searching
>something then it led to an error. I don't know why this could happen.
>>
>>Am I missing something?
>>
>>Thank you.
>>
>> huge junk mail <huge_junk_mail
yahoo.com> wrote:Can someone tell me why I
>can't have
>>
>>$_SESSION['foo'] = 'content of foo';
>>
>>following by
>>
>>header('Location: http://www.mysite.com');
>>
>>Someone from www.php.net told me that it can confuse
>>browser (http://bugs.php.net/19991). But, still I
>>can't the idea why it can happen. Does register
>>session means sending a 'header: location' too?
>>
>>Thanks.
>>
>>=====
>>Regards,
>>
>>mahara
>>
>>__________________________________________________
>>Do you Yahoo!?
>>Y! Web Hosting - Let the expert host your web site
>>http://webhosting.yahoo.com/
>>
>>--
>>PHP General Mailing List (http://www.php.net/)
>>To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
>>Regards,
>>
>>mahara
>>
>>
>>---------------------------------
>>Do you Yahoo!?
>>HotJobs - Search new jobs daily now
>
>
attached mail follows:
Hi,
Wednesday, November 6, 2002, 2:52:31 AM, you wrote: vaue> Hi. I'm not sure if is here where i have to ask this, but, if it's vaue> not i hope you say to me :D.
vaue> Well the question is: i want to know how can i make to insert into vaue> the $_GET or $_POST arrays, an entry with a value from javascript.
vaue> Thanks
This is a post method:
<script language="JavaScript"> function doit(){ testval = "Hello"; document.form1.result.value = testval; document.form1.submit(); } </script>
<form name="form1" action="<?echo $_SERVER['PHP_SELF']?>" method="post"> <input type="hidden" name="result"> <input type="button" value="Submit" onclick="doit();"> </form>
should end up with $_POST['result'] = Hello
-- regards, Tom
attached mail follows:
I have a bunch of form variables that I need to process as integers. The problem is that some users are writing in values with commas - e.g. 100,000, and that isn't read as an integer. There's more than one variable so I don't want to have to do a string replace for each one. Is there a general way to curb this problem?
Thanks, Doug
attached mail follows:
function str2int($str) { $str = str_replace(',', $str); // http://www.php.net/manual/en/function.str-replace.php
settype($str, "integer"); // http://www.php.net/manual/en/function.settype.php
if (is_int($str)) // http://www.php.net/manual/en/function.is-int.php return $str; else return false; }
Loop through your form variables and call this function. Good luck, -Kevin
----- Original Message -----
From: <drparker
clam.rutgers.edu>
To: <php-general
lists.php.net>
Sent: Wednesday, November 06, 2002 9:05 AM
Subject: [PHP] Converting variables to integer
> I have a bunch of form variables that I need to process as integers. > The problem is that some users are writing in values with commas - e.g. > 100,000, and that isn't read as an integer. There's more than one > variable so I don't want to have to do a string replace for each one. > Is there a general way to curb this problem? > > Thanks, Doug > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >
attached mail follows:
This should work for you, this recursive function loops the array, if it gets array again, calls itself
function convert2int($var) { foreach($var as $k => $v ) { if(is_array($v)) { $var[$k]=convert2int($v); } else { $var[$k]=str_replace(',',$v); } } return $var; }
$_POST=convert2int($_POST);
drparker
clam.rutgers.edu wrote:
>I have a bunch of form variables that I need to process as integers. >The problem is that some users are writing in values with commas - e.g. >100,000, and that isn't read as an integer. There's more than one >variable so I don't want to have to do a string replace for each one. >Is there a general way to curb this problem? > >Thanks, Doug > > > >
attached mail follows:
Ooops my str_replace() function needs one more parameter. str_replace(',', '', $str); -Kevin
----- Original Message -----
From: "Kevin Stone" <kevin
helpelf.com>
To: <php-general
lists.php.net>; <drparker
clam.rutgers.edu>
Sent: Wednesday, November 06, 2002 11:45 AM
Subject: Re: [PHP] Converting variables to integer
>
> function str2int($str)
> {
> $str = str_replace(',', $str); //
> http://www.php.net/manual/en/function.str-replace.php
>
> settype($str, "integer"); //
> http://www.php.net/manual/en/function.settype.php
>
> if (is_int($str)) // http://www.php.net/manual/en/function.is-int.php
> return $str;
> else
> return false;
> }
>
> Loop through your form variables and call this function. Good luck,
> -Kevin
>
>
> ----- Original Message -----
> From: <drparker
clam.rutgers.edu>
> To: <php-general
lists.php.net>
> Sent: Wednesday, November 06, 2002 9:05 AM
> Subject: [PHP] Converting variables to integer
>
>
> > I have a bunch of form variables that I need to process as integers.
> > The problem is that some users are writing in values with commas - e.g.
> > 100,000, and that isn't read as an integer. There's more than one
> > variable so I don't want to have to do a string replace for each one.
> > Is there a general way to curb this problem?
> >
> > Thanks, Doug
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
attached mail follows:
I need to chmod files which are owned by a nother user than nobody with a php script runing from a browser. lets say i have a file called image.gif and I want to chmod(“imgage.gif”, 0777); and I want to run it as user: myuser with passwd: passwd. Can I do this? Regards, David
attached mail follows:
There was actually a brief thread about this last night. If you're using Apache, you could look into suexec--this may or may not be a possibility depending on the degree of control that you have on your server.
Marco
-- ------------ php|architect - The magazine for PHP Professionals The first monthly worldwide magazine dedicated to PHP programmerCome visit us at http://www.phparch.com!
attached mail follows:
I need to chmod files which are owned by a nother user than nobody with a php script runing from a browser. lets say i have a file called image.gif and I want to chmod(imgage.gif, 0777); and I want to run it as user: myuser with passwd: passwd. Can I do this? Regards, David
--=-hYZdeyC0eZHcVLcSeE/R--
attached mail follows:
My organization has a need to publish some of our web content on a CD-ROM. I'm in search of suggestions on how to publish our dynamic content (php/mysql templates) in some sort of "runtime" configuration that would let users browse the site from cd.
What's involved with this? Is there such a thing as runtime mySQL? What would it take to serve PHP from a CD?
Help! I don't know where to begin and am looking for advice.
Thanks,
Bob
attached mail follows:
That would be a bit difficult--you would have licensing issues, particularly with MySQL, unless you actually distribute the sources.
Would publishing all the files in "static" format be an option?
-- ------------ php|architect - The magazine for PHP Professionals The first monthly worldwide magazine dedicated to PHP programmerCome visit us at http://www.phparch.com!
attached mail follows:
My organization has a need to publish some of our web content on a CD-ROM. I'm in search of suggestions on how to publish our dynamic content (php/mysql templates) in some sort of "runtime" configuration that would let users browse the site from cd.
What's involved with this? Is there such a thing as runtime mySQL? What would it take to serve PHP from a CD?
Help! I don't know where to begin and am looking for advice.
Thanks,
Bob
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
That is going to be very hard to do...you might want to look at doing it all static...however, what are u going to do about the database connections...
IMHO, i would take the php site and make it static and then put it on a CD-ROM...it might be out of date, however, it might be the fastest way for ya.
Do you want them to access your site from the CD-ROM pages?
You could create special pages on your site that the CD-ROM pages call. But that would require the user of the disc to have internet access.
But running PHP from a cd-rom will probably not work unless you are doing some commandline cgi stuff...and i dont even want to think how that would work for ya...
i would probably do something where static html pages pull data from your site...
HTH...
On Wed, 2002-11-06 at 16:44, ROBERT MCPEAK wrote: > My organization has a need to publish some of our web content on a CD-ROM. I'm in search of suggestions on how to publish our dynamic content (php/mysql templates) in some sort of "runtime" configuration that would let users browse the site from cd. > > What's involved with this? Is there such a thing as runtime mySQL? What would it take to serve PHP from a CD? > > Help! I don't know where to begin and am looking for advice. > > Thanks, > > Bob > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php
-- .: B i g D o g :.
attached mail follows:
I dunno if its an old wives tail but I have heard that you can get apache/mysql and php running from a CD. You would of course need to turn off all logging etc.
Do a bit off google bashing.
John
On Wednesday 06 Nov 2002 9:50 am, .: B i g D o g :. wrote: > That is going to be very hard to do...you might want to look at doing it > all static...however, what are u going to do about the database > connections... > > IMHO, i would take the php site and make it static and then put it on a > CD-ROM...it might be out of date, however, it might be the fastest way > for ya. > > Do you want them to access your site from the CD-ROM pages? > > You could create special pages on your site that the CD-ROM pages call. > But that would require the user of the disc to have internet access. > > But running PHP from a cd-rom will probably not work unless you are > doing some commandline cgi stuff...and i dont even want to think how > that would work for ya... > > i would probably do something where static html pages pull data from > your site... > > HTH... > > On Wed, 2002-11-06 at 16:44, ROBERT MCPEAK wrote: > > My organization has a need to publish some of our web content on a > > CD-ROM. I'm in search of suggestions on how to publish our dynamic > > content (php/mysql templates) in some sort of "runtime" configuration > > that would let users browse the site from cd. > > > > What's involved with this? Is there such a thing as runtime mySQL? What > > would it take to serve PHP from a CD? > > > > Help! I don't know where to begin and am looking for advice. > > > > Thanks, > > > > Bob > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
Theoretically it is possible, but fact stays - you won't ever make it work well.
So, try to find an alternative for this. Usually, this choice is made by the managers that know nothing about how webcontent works.
-- Maxim Maletsky maximphp.net
"ROBERT MCPEAK" <RMCPEAK
jhuccp.org> wrote... :
> My organization has a need to publish some of our web content on a CD-ROM. I'm in search of suggestions on how to publish our dynamic content (php/mysql templates) in some sort of "runtime" configuration that would let users browse the site from cd. > > What's involved with this? Is there such a thing as runtime mySQL? What would it take to serve PHP from a CD? > > Help! I don't know where to begin and am looking for advice. > > Thanks, > > Bob > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >
attached mail follows:
It's a database site, containing thousands of records, similar to a products catalog like Amazon, for example. Publishing as static pages is not a viable option, and would greatly limit the search functionality.
There must be a way to do this! Thanks for all the feedback.
>>> Maxim Maletsky <maxim
php.net> 11/06/02 12:10PM >>>
Theoretically it is possible, but fact stays - you won't ever make it
work well.
So, try to find an alternative for this. Usually, this choice is made by the managers that know nothing about how webcontent works.
-- Maxim Maletsky maximphp.net
"ROBERT MCPEAK" <RMCPEAK
jhuccp.org> wrote... :
> My organization has a need to publish some of our web content on a CD-ROM. I'm in search of suggestions on how to publish our dynamic content (php/mysql templates) in some sort of "runtime" configuration that would let users browse the site from cd. > > What's involved with this? Is there such a thing as runtime mySQL? What would it take to serve PHP from a CD? > > Help! I don't know where to begin and am looking for advice. > > Thanks, > > Bob > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
Thinking about this more....
A U.K. based electronics company has a CD which is Databse driven. It is compleatly searchable etc....
I think its either RS or Maplin.or it might be someone else ;-) but its a company like them......
John
----- Original Message -----
From: "ROBERT MCPEAK" <RMCPEAK
jhuccp.org>
To: <maxim
php.net>
Cc: "GUY CHALK" <GCHALK
jhuccp.org>; <php-general
lists.php.net>
Sent: Wednesday, November 06, 2002 6:23 PM
Subject: Re: [PHP] publishing php > mysql website on cd-rom
> It's a database site, containing thousands of records, similar to a
products catalog like Amazon, for example. Publishing as static pages is
not a viable option, and would greatly limit the search functionality.
>
> There must be a way to do this! Thanks for all the feedback.
>
> >>> Maxim Maletsky <maxim
php.net> 11/06/02 12:10PM >>>
> Theoretically it is possible, but fact stays - you won't ever make it
> work well.
>
> So, try to find an alternative for this. Usually, this choice is made by
> the managers that know nothing about how webcontent works.
>
>
> --
> Maxim Maletsky
> maxim
php.net
>
>
>
> "ROBERT MCPEAK" <RMCPEAK
jhuccp.org> wrote... :
>
> > My organization has a need to publish some of our web content on a
CD-ROM. I'm in search of suggestions on how to publish our dynamic content
(php/mysql templates) in some sort of "runtime" configuration that would let
users browse the site from cd.
> >
> > What's involved with this? Is there such a thing as runtime mySQL?
What would it take to serve PHP from a CD?
> >
> > Help! I don't know where to begin and am looking for advice.
> >
> > Thanks,
> >
> > Bob
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
Thank you for replying, but I don't think I've made my problem clear enough. Let me give it another shot.
What I want is a function that takes the name of an array as a parameter so that it can be popped into any class that has arrays in it and work without modification. The problem I am having is in converting the passed in array name to the form which the class would recognize as its own member variable, i.e. $this->passed_in_array_name. In other words, it comes in as a string, just the name of the array, I append $this-> to it, but it still isn't getting interpreted the same as if I had written the call explicitely to $this->memberarray. Does this make any more sense?
jck
Marek Kilimajer wrote:
> If I understand you, you need to have a basic class with the > one function and subclass it. Then you can reference the array > as $this->$passed_in_array_name > > John Kenyon wrote: > >> I'm trying to write a function I can plop in a bunch of different >> classes without having to modify it. >> >> Basically I have classes like: >> >> >> class Example >> { >> var $array1; >> var $array2; >> var $array3; >> >> >> etc. >> >> } >> >> and I want to have a function in that class that looks something like >> this: >> >> function do_something_to_array($passed_in_array_name) >> { >> //this is what I've done so far, but which isn't working >> $arr = '$this->' . $passed_in_array_name; >> >> // now I want $passed_in_array_name to be evaluated as an array >> >> eval ("\$arr = \"$arr\";"); >> >> // however even if 'array1' is the passed in value $arr is not the >> // same as $this->array1 >> ... >> } >> >> As a side note there is another aspect of this that confuses me -- if >> I do a print_r($arr) before the eval it returns the string >> '$this->array1', if I do it after it returns Array (which is what it >> seems it should do. However, if I then pass $arr to a function that >> requires an array as an argument, like array_push, for example, I get >> an error that says that function takes an array. Can anyone explain >> this to me? The only guess I have is that my eval function is turning it >> into a string which reads as Array instead of either a String object >> or the >> value of the string. >> >> More important though is the first problem of generically >> accesing a member variable based on the passed in name of the >> variable. In other words I want to be able to choose which array I >> operate on by passing in the name of that array. >> >> >> Any help on this problem is appreciated. I know there must be a way to >> do this. Please let me know if I haven't formulated the problem >> clearly enough. >> >> jck >> >> >> > >
attached mail follows:
You can do:
${"this->$passed_in_array_name"}
not sure right now of the correct syntaxing, I never do that - normally I'd pass the element key.
-- Maxim Maletsky maximphp.net
John Kenyon <jck
croanoke.com> wrote... :
> Thank you for replying, but I don't think I've made my problem clear > enough. Let me give it another shot. > > What I want is a function that takes the name of an array as a parameter > so that it can be popped into any class that has arrays in it and work > without modification. The problem I am having is in converting the > passed in array name to the form which the class would recognize as its > own member variable, i.e. $this->passed_in_array_name. In other words, > it comes in as a string, just the name of the array, I append $this-> to > it, but it still isn't getting interpreted the same as if I had written > the call explicitely to $this->memberarray. Does this make any more sense? > > jck > > Marek Kilimajer wrote: > > > If I understand you, you need to have a basic class with the > > one function and subclass it. Then you can reference the array > > as $this->$passed_in_array_name > > > > John Kenyon wrote: > > > >> I'm trying to write a function I can plop in a bunch of different > >> classes without having to modify it. > >> > >> Basically I have classes like: > >> > >> > >> class Example > >> { > >> var $array1; > >> var $array2; > >> var $array3; > >> > >> > >> etc. > >> > >> } > >> > >> and I want to have a function in that class that looks something like > >> this: > >> > >> function do_something_to_array($passed_in_array_name) > >> { > >> //this is what I've done so far, but which isn't working > >> $arr = '$this->' . $passed_in_array_name; > >> > >> // now I want $passed_in_array_name to be evaluated as an array > >> > >> eval ("\$arr = \"$arr\";"); > >> > >> // however even if 'array1' is the passed in value $arr is not the > >> // same as $this->array1 > >> ... > >> } > >> > >> As a side note there is another aspect of this that confuses me -- if > >> I do a print_r($arr) before the eval it returns the string > >> '$this->array1', if I do it after it returns Array (which is what it > >> seems it should do. However, if I then pass $arr to a function that > >> requires an array as an argument, like array_push, for example, I get > >> an error that says that function takes an array. Can anyone explain > >> this to me? The only guess I have is that my eval function is turning it > >> into a string which reads as Array instead of either a String object > >> or the > >> value of the string. > >> > >> More important though is the first problem of generically > >> accesing a member variable based on the passed in name of the > >> variable. In other words I want to be able to choose which array I > >> operate on by passing in the name of that array. > >> > >> > >> Any help on this problem is appreciated. I know there must be a way to > >> do this. Please let me know if I haven't formulated the problem > >> clearly enough. > >> > >> jck > >> > >> > >> > > > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >
attached mail follows:
Thanks, that may be what I was looking for.
jck
Maxim Maletsky wrote:
>You can do:
>
>${"this->$passed_in_array_name"}
>
>not sure right now of the correct syntaxing, I never do that - normally
>I'd pass the element key.
>
>
>--
>Maxim Maletsky
>maxim
php.net
>
>
>
>John Kenyon <jck
croanoke.com> wrote... :
>
>
>
>>Thank you for replying, but I don't think I've made my problem clear
>>enough. Let me give it another shot.
>>
>>What I want is a function that takes the name of an array as a parameter
>>so that it can be popped into any class that has arrays in it and work
>>without modification. The problem I am having is in converting the
>>passed in array name to the form which the class would recognize as its
>>own member variable, i.e. $this->passed_in_array_name. In other words,
>>it comes in as a string, just the name of the array, I append $this-> to
>>it, but it still isn't getting interpreted the same as if I had written
>>the call explicitely to $this->memberarray. Does this make any more sense?
>>
>>jck
>>
>>Marek Kilimajer wrote:
>>
>>
>>
>>>If I understand you, you need to have a basic class with the
>>>one function and subclass it. Then you can reference the array
>>>as $this->$passed_in_array_name
>>>
>>>John Kenyon wrote:
>>>
>>>
>>>
>>>>I'm trying to write a function I can plop in a bunch of different
>>>>classes without having to modify it.
>>>>
>>>>Basically I have classes like:
>>>>
>>>>
>>>>class Example
>>>>{
>>>> var $array1;
>>>> var $array2;
>>>> var $array3;
>>>>
>>>>
>>>>etc.
>>>>
>>>>}
>>>>
>>>>and I want to have a function in that class that looks something like
>>>>this:
>>>>
>>>>function do_something_to_array($passed_in_array_name)
>>>>{
>>>>//this is what I've done so far, but which isn't working
>>>> $arr = '$this->' . $passed_in_array_name;
>>>>
>>>>// now I want $passed_in_array_name to be evaluated as an array
>>>>
>>>> eval ("\$arr = \"$arr\";");
>>>>
>>>>// however even if 'array1' is the passed in value $arr is not the
>>>>// same as $this->array1
>>>>...
>>>>}
>>>>
>>>>As a side note there is another aspect of this that confuses me -- if
>>>>I do a print_r($arr) before the eval it returns the string
>>>>'$this->array1', if I do it after it returns Array (which is what it
>>>>seems it should do. However, if I then pass $arr to a function that
>>>>requires an array as an argument, like array_push, for example, I get
>>>>an error that says that function takes an array. Can anyone explain
>>>>this to me? The only guess I have is that my eval function is turning it
>>>>into a string which reads as Array instead of either a String object
>>>>or the
>>>>value of the string.
>>>>
>>>>More important though is the first problem of generically
>>>>accesing a member variable based on the passed in name of the
>>>>variable. In other words I want to be able to choose which array I
>>>>operate on by passing in the name of that array.
>>>>
>>>>
>>>>Any help on this problem is appreciated. I know there must be a way to
>>>>do this. Please let me know if I haven't formulated the problem
>>>>clearly enough.
>>>>
>>>>jck
>>>>
>>>>
>>>>
>>>>
>>>>
>>>
>>>
>>
>>--
>>PHP General Mailing List (http://www.php.net/)
>>To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
>>
>
>
>
>
attached mail follows:
Hi,
Thursday, November 7, 2002, 3:11:12 AM, you wrote: MM> You can do:
${"this->>$passed_in_array_name"}
MM> not sure right now of the correct syntaxing, I never do that - normally MM> I'd pass the element key.
MM> --
MM> Maxim Maletsky
MM> maxim
php.net
MM> John Kenyon <jck
croanoke.com> wrote... :
>> Thank you for replying, but I don't think I've made my problem clear >> enough. Let me give it another shot. >> >> What I want is a function that takes the name of an array as a parameter >> so that it can be popped into any class that has arrays in it and work >> without modification. The problem I am having is in converting the >> passed in array name to the form which the class would recognize as its >> own member variable, i.e. $this->passed_in_array_name. In other words, >> it comes in as a string, just the name of the array, I append $this-> to >> it, but it still isn't getting interpreted the same as if I had written >> the call explicitely to $this->memberarray. Does this make any more sense? >> >> jck >> >> Marek Kilimajer wrote: >> >> > If I understand you, you need to have a basic class with the >> > one function and subclass it. Then you can reference the array >> > as $this->$passed_in_array_name >> > >> > John Kenyon wrote: >> > >> >> I'm trying to write a function I can plop in a bunch of different >> >> classes without having to modify it. >> >> >> >> Basically I have classes like: >> >> >> >> >> >> class Example >> >> { >> >> var $array1; >> >> var $array2; >> >> var $array3; >> >> >> >> >> >> etc. >> >> >> >> } >> >> >> >> and I want to have a function in that class that looks something like >> >> this: >> >> >> >> function do_something_to_array($passed_in_array_name) >> >> { >> >> //this is what I've done so far, but which isn't working >> >> $arr = '$this->' . $passed_in_array_name; >> >> >> >> // now I want $passed_in_array_name to be evaluated as an array >> >> >> >> eval ("\$arr = \"$arr\";"); >> >> >> >> // however even if 'array1' is the passed in value $arr is not the >> >> // same as $this->array1 >> >> ... >> >> } >> >> >> >> As a side note there is another aspect of this that confuses me -- if >> >> I do a print_r($arr) before the eval it returns the string >> >> '$this->array1', if I do it after it returns Array (which is what it >> >> seems it should do. However, if I then pass $arr to a function that >> >> requires an array as an argument, like array_push, for example, I get >> >> an error that says that function takes an array. Can anyone explain >> >> this to me? The only guess I have is that my eval function is turning it >> >> into a string which reads as Array instead of either a String object >> >> or the >> >> value of the string. >> >> >> >> More important though is the first problem of generically >> >> accesing a member variable based on the passed in name of the >> >> variable. In other words I want to be able to choose which array I >> >> operate on by passing in the name of that array. >> >> >> >> >> >> Any help on this problem is appreciated. I know there must be a way to >> >> do this. Please let me know if I haven't formulated the problem >> >> clearly enough. >> >> >> >> jck >> >> >> >> >> >> >> > >> > >> >> >> >> -- >> PHP General Mailing List (http://www.php.net/) >> To unsubscribe, visit: http://www.php.net/unsub.php >>
Amazing what you learn on this list :) This works:
class Example { var $array1 = array(); var $array2 = array(); var $array3 = array();
function add2array($array_name,$val){ $this->{"$array_name"}[] = $val; }
} $t = new Example(); $t->add2array('array1',25); $t->add2array('array2',26); $t->add2array('array3',"Hello"); echo '<pre>'; print_r($t); echo '</pre>';
-- regards, Tom
attached mail follows:
Tom Rogers <trogers
kwikin.com> wrote... :
> > Amazing what you learn on this list :) > This works: > > class Example > { > var $array1 = array(); > var $array2 = array(); > var $array3 = array(); > > function add2array($array_name,$val){ > $this->{"$array_name"}[] = $val; > } > > } > $t = new Example(); > $t->add2array('array1',25); > $t->add2array('array2',26); > $t->add2array('array3',"Hello"); > echo '<pre>'; > print_r($t); > echo '</pre>'; >
Yet, this is not a such elegant way doing it. It can be helpful in a lot of cases, but most often, element key is enough. Try rethinking your logic:
class Example { var $array = array();
function add2array($element_name, $val){ $this->$array[$element_name] = $val; }
} $t = new Example(); $t->add2array('array1',25); $t->add2array('array2',26); $t->add2array('array3',"Hello"); echo '<pre>'; print_r($t); echo '</pre>';
Cleaner and more scalable, no?
-- Maxim Maletsky maximphp.net
attached mail follows:
Hi,
Thursday, November 7, 2002, 3:45:34 AM, you wrote:
MM> Yet, this is not a such elegant way doing it. It can be helpful in a lot MM> of cases, but most often, element key is enough. Try rethinking your MM> logic:
MM> class Example { MM> var $array = array();
MM> function add2array($element_name, $val){ MM> $this->$array[$element_name] = $val; MM> }
MM> } MM> $t = new Example(); $t->>add2array('array1',25); $t->>add2array('array2',26); $t->>add2array('array3',"Hello"); MM> echo '<pre>'; MM> print_r($t); MM> echo '</pre>';
MM> Cleaner and more scalable, no?
Yes and to fit the original 3 seperate arrays it would be
function add2array($element_name, $val){ $this->$array[$element_name][] = $val; }
-- regards, Tom
attached mail follows:
Tom Rogers <trogers
kwikin.com> wrote... :
> Hi, > > Thursday, November 7, 2002, 3:45:34 AM, you wrote: > > MM> Yet, this is not a such elegant way doing it. It can be helpful in a lot > MM> of cases, but most often, element key is enough. Try rethinking your > MM> logic: > > > MM> class Example { > MM> var $array = array(); > > MM> function add2array($element_name, $val){ > MM> $this->$array[$element_name] = $val; > MM> } > > MM> } > MM> $t = new Example(); > $t->>add2array('array1',25); > $t->>add2array('array2',26); > $t->>add2array('array3',"Hello"); > MM> echo '<pre>'; > MM> print_r($t); > MM> echo '</pre>'; > > > MM> Cleaner and more scalable, no? > > Yes and to fit the original 3 seperate arrays it would be > > function add2array($element_name, $val){ > $this->$array[$element_name][] = $val; > }
No, because you pass it the name and data. This way every name will become element's name containing the relevant data. Your way just makes it an associative array without a way of directly accessing it.
-- Maxim Maletsky maximphp.net
attached mail follows:
See below:
>>
>>MM> class Example {
>>MM> var $array = array();
>>
>>MM> function add2array($element_name, $val){
>>MM> $this->$array[$element_name] = $val;
>>MM> }
>>
>>MM> }
>>MM> $t = new Example();
>>$t->>add2array('array1',25);
>>$t->>add2array('array2',26);
>>$t->>add2array('array3',"Hello");
>>MM> echo '<pre>';
>>MM> print_r($t);
>>MM> echo '</pre>';
>>
>>
>>MM> Cleaner and more scalable, no?
>>
>>Yes and to fit the original 3 seperate arrays it would be
>>
>>function add2array($element_name, $val){
>> $this->$array[$element_name][] = $val;
>>}
>>
>>
>
>
>No, because you pass it the name and data. This way every name will
>become element's name containing the relevant data. Your way just makes
>it an associative array without a way of directly accessing it.
>
>--
>Maxim Maletsky
>maxim
php.net
>
>
But my problem is that I have several arrays already and I want to be
able to act on a specific array depending on the name I pass in. I don't
see how your solution solves that issue.
jck
attached mail follows:
You pass it the name of the element, and whatever the data inside. You do not need to add other sub-elements to it automatically, as you would need to be "s