|
Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com |
From: php-general-digest-help
lists.php.netDate: Tue Jul 17 2001 - 15:12:23 CDT
php-general Digest 17 Jul 2001 20:12:23 -0000 Issue 761
Topics (messages 58214 through 58334):
Hi all.
58214 by: Johan Vikerskog (ECS)
58222 by: Christopher Ostmo
Re: return
58215 by: Dave Freeman
installation help!!!!!
58216 by: Michael P. Carel
Error compiling apache / php --with-t1lib
58217 by: Sverre Johan Tøvik
Static vs. module, realworld performance difference?
58218 by: Sverre Johan Tøvik
Re: "report" generation with PHP
58219 by: Philip Murray
58232 by: Marius Andreiana
Re: Output (Urgent!)
58220 by: Morten Winkler Jørgensen
58223 by: Fredrik A. Takle
58224 by: Adrian Ciutureanu
58226 by: Jason Rennie
58227 by: Joseph
58228 by: Tim Ward
58229 by: Morten Winkler Jørgensen
58230 by: Adrian Ciutureanu
58236 by: elias
58247 by: Brad Hubbard
58249 by: Fredrik A. Takle
58274 by: Sheridan Saint-Michel
Information about FastTemplate, PHPlib and making big sites.
58221 by: Schill, Johannes
displaying icons
58225 by: Petr Jùza
Re: variables.
58231 by: elias
Re: How to add a new color to JPEG
58233 by: Jennifer
58237 by: Jennifer
58294 by: Matthew Loff
58296 by: Jon Yaggie
Adding elements to an array
58234 by: Sharat Hegde
58239 by: Adrian Ciutureanu
58240 by: Joseph
58243 by: Patrik Wallstrom
ldap
58235 by: Johan Vikerskog (ECS)
58301 by: Dan Lowe
Re: email counter
58238 by: Steve Brett
Re: Known bugs with HTTP upload on Windows NT?
58241 by: elias
Re: mysql_query problem (more suggestions)
58242 by: Alvin Tan
Re: passing variables from forms to the same page repetatively
58244 by: maatt
58305 by: Tim Olsen
58308 by: Sheridan Saint-Michel
58311 by: Neil Kimber
edit xml with php?
58245 by: Jan Grafstrom
58248 by: Brad Hubbard
58252 by: Jens Wabnitz
Extracting from arrays - alphabetically
58246 by: Kevin Price-Ward
SQL in array() ?
58250 by: James Holloway
58254 by: Miles Thompson
58257 by: James Holloway
Re: REPOST: converting multiple URL values for the same variable into an array
58251 by: Garth Dahlstrom
Re: REGEXP
58253 by: Adrian D'Costa
Custom Headers?
58255 by: Fredrik A. Takle
mail() help
58256 by: Patrick W. Rateliff
58261 by: Steve Brett
Re: Credit card number checker?
58258 by: John Monfort
fill in inputs control (part II) PHP + JavaScript
58259 by: Aniceto Lopez
Installing CGI --disable-force-cgi-redirect
58260 by: tau.ukshells.co.uk
LDAP question PLEASE help me.
58262 by: Johan Vikerskog (ECS)
58264 by: Reuben D Budiardja
running php scripts
58263 by: Pétur Björn Thorsteinsson
58265 by: Johan Holst Nielsen
58266 by: Johan Holst Nielsen
58273 by: Pétur Björn Thorsteinsson
Re: echo vs printf
58267 by: hassan el forkani
58328 by: brother
Re: Problem about PHP
58268 by: Mark Roedel
regexp. king needed (is it possible ???)
58269 by: Jeroen Olthof
58272 by: Adrian Ciutureanu
58275 by: Jeroen Olthof
error on mail.....cjk
58270 by: Constantine Koulis
Get filename in php command line
58271 by: Reuben D Budiardja
58281 by: Jason Bell
58286 by: Reuben D Budiardja
58287 by: Boget, Chris
58290 by: Reuben D Budiardja
58291 by: Boget, Chris
58320 by: Reuben D Budiardja
Need help. LDAP
58276 by: Johan Vikerskog (ECS)
note to PHP developers
58277 by: Michael Geier, CDM Systems Admin
58279 by: Nathan Cook
58280 by: Christopher Allen
58292 by: teo.gecadsoftware.com
wordwrap()
58278 by: Tyler Longren
58282 by: scott [gts]
58284 by: Tyler Longren
58285 by: Henrik Hansen
58295 by: Rehuel Lobato de Mesquita
58298 by: Henrik Hansen
Storing image/documents in database vs. filesystem
58283 by: Bob
Getting the current URL (with arguments) as a variable, then removing another variable from that ?
58288 by: Justin Colson
58289 by: ReDucTor
md5 crypt question
58293 by: Jeremy Hansen
Code running function
58297 by: B R
58299 by: Inércia Sensorial
58303 by: Christopher Ostmo
library GD
58300 by: Luiz Fernando \(Tuca\)
58302 by: Johan Holst Nielsen
Send array from php to dll make in vb 6
58304 by: Luiz Fernando \(Tuca\)
GEt Command
58306 by: Clayton Dukes
58307 by: Matthew Loff
58309 by: Clayton Dukes
50 SEX Sites in ONE Affiliate Portal.................
58310 by: Dolores
58319 by: Christopher Ostmo
Data from SQL to a string in a useable format
58312 by: Jason Bell
EO - New FREE web development engine
58313 by: admin.eodeveloper.com
PHP- something i don't undestand
58314 by: Yassel Omar Izquierdo Souchay
58316 by: Jason Bell
PHP- something tha i don't understand
58315 by: Yassel Omar Izquierdo Souchay
58317 by: Boget, Chris
Cannot connect to db when running PHP as Cron
58318 by: Reuben D Budiardja
php- something that i don't understand
58321 by: Yassel Omar Izquierdo Souchay
58322 by: Christopher Ostmo
58323 by: Miles Thompson
58324 by: Sam Masiello
58325 by: Jason Bell
58326 by: Sheridan Saint-Michel
Need help with formatting time
58327 by: John Holcomb
58329 by: Jason Bell
58330 by: Christopher Ostmo
58331 by: Jack Dempsey
58332 by: Rasmus Lerdorf
58333 by: Christopher Ostmo
Thank you all: Need help with formatting time
58334 by: John Holcomb
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:
When i install PHP.
Do i have to make anything special to activate the ldap function?
//Johan
attached mail follows:
Johan Vikerskog (ECS) pressed the little lettered thingies in this order...
> When i install PHP.
>
> Do i have to make anything special to activate the ldap function?
>
> //Johan
>
./configure --with-ldap
http://www.php.net/manual/en/install.configure.php
Good luck...
Christopher Ostmo
a.k.a. tech
AppIdeas.com
AppIdeas.com
Innovative Application Ideas
Meeting cutting edge dynamic
web site needs since the
dawn of Internet time (1995)
Business Applications:
http://www.AppIdeas.com/
Open Source Applications:
http://open.AppIdeas.com/
attached mail follows:
On 16 Jul 01, at 15:25, Tyler Longren wrote:
> <?
> function expDate($date) {
> $month = substr("$date", 0, 2);
> $len = strlen($date);
> $year = substr("$date", $len-2, $len);
> return $month;
> return $year;
> }
> expDate("11/2002");
> print "$month $year";
> ?>
<?
function expDate($date)
{
$month = substr($date, 0, 2);
$year = substr($date, strlen($date) - 2, 2);
return "$month $year";
}
$monyr = expDate("11/2002");
print "$monyr";
?>
would do it I expect.
CYA, Dave
-----------------------------------------------------------------------
Outback Queensland Internet - Longreach, Outback Queensland - Australia
http://www.outbackqld.net.au mailto:dfreeman
outbackqld.net.au
-----------------------------------------------------------------------
attached mail follows:
Hi,
I really have difficulties installing PHP3with mysql support, i've red alot of documentation but i havent installed it successfully.
I've compiled it many times but it doesnt work. I've been using RedHat6.2, Apache-1.3.14-6.2.i386.rpm,MySQL-3.23.39-1.i386.rpm,PHP3.0.18.
I've compiled this ver of PHP but my Apache crush down whenever i've finish all the installation instruction.I've installed apache first using the RPM binary version and MySQL . Please help i really cant make it!
Do you have any RPM version of PHP3 or PHP4 that automatically support Mysql and RedHat linux.
mike
attached mail follows:
Hi,
I'm having trouble compiling php with t1lib support. Actually, php
compiles fine, it stops when compiling apache.
./configure
make
make install
php works fine.
./configure
apache works.
But when I make apache, I get:
gcc -DLINUX" -I/usr/src/network/php-4.0.0
-I/usr/src/network/php-4.0.0/Zend -I/usr/src/network/php-4.0.0/Zend
-I/usr/src/network/php-4.0.0 -DUSE_EXPAT -I./lib/expat-lite
-DNO_DL_NEEDED `./apaci` \
-o httpd buildmark.o modules.o modules/standard/libstandard.a
modules/php4/libphp4.a main/libmain.a ./os/unix/libos.a ap/libap.a
lib/expat-lite/libexpat.a -Wl,-rpath,/usr/local/lib/lib
-Wl,-rpath,/usr/local/pgsql/lib -rdynamic -L/usr/local/lib/lib
-L/usr/local/pgsql/lib -Lmodules/php4 -L../modules/php4
-L../../modules/php4 -lmodphp4 -lgdbm -ldl -lpq -ljpeg -lz -lpng
-lgd -lresolv -lm -ldl -lcrypt -lnsl -lresolv -L/usr/local/lib/lib
-ljpeg -lm -lcrypt
modules/php4/libphp4.a(gd.o): In function `php_minit_gd':
/usr/src/network/php-4.0.0/ext/gd/gd.c:205: undefined reference to
`T1_SetBitmapPad'
/usr/src/network/php-4.0.0/ext/gd/gd.c:206: undefined reference to `T1_InitLib'
... and lots of similar stuff (all "undefined reference to `T1_[*]`),
followed by:
collect2: ld returned 1 exit status
make[2]: *** [target_static] Error 1
make[2]: Leaving directory `/usr/src/network/apache_1.3.19/src'
make[1]: *** [build-std] Error 2
make[1]: Leaving directory `/usr/src/network/apache_1.3.19'
make: *** [build] Error 2
***
Can anyone tell me what's up? (Or down, rather...)
Thanks in advance!
Regards,
Sverre Johan Toevik
-- <disclaimer> I speak for myself only! </disclaimer> "to be yourself, in a world that tries, night and day, to make you just like everybody else - is to fight the greatest battle there ever is to fight, and never stop fighting" -- e.e. cummings
attached mail follows:
Hi,
I've been advised that compiling php static is "faster" than the module version. Can anyone tell me what the realworld performance difference is? If it's not significant, the extra compile time hardly seems worth it.
TIA!
Regards,
Sverre Johan Toevik
-- <disclaimer> I speak for myself only! </disclaimer> "to be yourself, in a world that tries, night and day, to make you just like everybody else - is to fight the greatest battle there ever is to fight, and never stop fighting" -- e.e. cummings
attached mail follows:
> În 17 Jul 2001 19:47:23 +1200 Philip Murray a scris: > > What about using a Windows COM object? There should be one for Access and if > > not you can use the Word one and generate word documents > Don't use Words for that... We've had to generate invoices to be snail-mailed,
I've also done the same thing. Approximately 400 invoices a day all from a backend administration website. However, we forked out a license to use the PDF library.
> imagine if the address in the invoiced didn't matched the envelope's transparent > area... (don't think a word document can handle 6000 invoices anyway)
Yes, well true. But, the point was there is the facility to use a COM object instead of some multi-server or java kludge. If you can find a COM object to do the task (Matt: you talked about using Access for your needs) then that'll probably be the easiest/fasted solution on Win32 (short of paying for PDF).
On a side note, is there some Adobe license which prevents people writing Free for use PDF libraries? Or is it just by chance that the 2 that exist require you to purchase a license?
Philip Murray
attached mail follows:
În 17 Jul 2001 20:41:59 +1200 Philip Murray a scris: > On a side note, is there some Adobe license which prevents people writing > Free for use PDF libraries? don't think so; fop is free
Marius Andreiana
-- You don't have to go to jail for helping your neighbour http://www.gnu.org/philosophy/
attached mail follows:
Hi Frederik
Run this code. It does what you want it to. In your original code you compared two strings in the IF-statement. When the $resolution gotten from your JavaScript returned '800' it would have a lexical higher value than '1024' and thereby do exacely what you wanted it to - actually the code would always return \1024\ since your screen resolution would never return a string with a lexical lower value than '1024'.
By multiplying the string '1024' by 1 you get the integervalue 1024 (that's a trick PHP offers ;) ) which you then compare to the integervalue 1024.
That's the trick....
$resolution = "<SCRIPT LANGUAGE=\"JavaScript\">document.write(screen.width)</SCRIPT>"; echo "--".$resolution."--"; if (($resolution*1) >= 1024) { $resolution = "1024"; } else { $resolution = "800"; } echo "**".$resolution."**";
Venlig hilsen ha' en bra dag, Morten Winkler
attached mail follows:
This fixed it, but I don't like it! If you have any other suggestions, feel free to email me.
<SCRIPT LANGUAGE="JavaScript"> if (screen.width >= 1024) { var resolution = ("1024") } else { var resolution = ("800") } </SCRIPT>
Best Regards Fredrik A. Takle
"Fredrik A
attached mail follows:
I don't think this code do what he want... You are trying to mix client-side code with server-side code, but you can't do in that way. The ONLY way to obtain client screen resolution into a PHP variable is send data from client to server.
> -----Original Message-----
> From: Morten Winkler Jørgensen [mailto:madmax
mip.sdu.dk]
> Sent: 17 iulie 2001 12:14
> To: php-general
lists.php.net
> Subject: RE: [PHP] Output (Urgent!)
>
>
> Hi Frederik
>
> Run this code. It does what you want it to.
> In your original code you compared two strings in the IF-statement.
> When the $resolution gotten from your JavaScript returned
> '800' it would
> have a lexical higher value than '1024' and thereby do exacely what
> you wanted it to - actually the code would always return \1024\ since
> your screen resolution would never return a string with a lexical
> lower value than '1024'.
>
> By multiplying the string '1024' by 1 you get the integervalue 1024
> (that's a trick PHP offers ;) ) which you then compare to the
> integervalue 1024.
>
> That's the trick....
>
> $resolution = "<SCRIPT
> LANGUAGE=\"JavaScript\">document.write(screen.width)</SCRIPT>";
> echo "--".$resolution."--";
> if (($resolution*1) >= 1024) {
> $resolution = "1024";
> } else {
> $resolution = "800";
> }
> echo "**".$resolution."**";
>
> Venlig hilsen ha' en bra dag,
> Morten Winkler
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail:
> php-list-admin
lists.php.net
>
>
attached mail follows:
> $resolution = "<SCRIPT > LANGUAGE=\"JavaScript\">document.write(screen.width)</SCRIPT>"; > > if ($resolution >= '1024') { > $resolution = "1024"; > } else { > $resolution = "800"; > } > echo $resolution; > > It always output 1024
At a guess becasue your mixing and matching languages.
If you got the input from a hidden field in a form (perhaps an entry page?) then it would be possible to get the data you want.
Jason
attached mail follows:
How you want to get a value from client side to php on the same page? Joseph
"Orv î?÷inklÏ ²ørÏkîskî" <madmax
mip.sdu.dk> wrote in message
news:197425618832.20010717111347
mip.sdu.dk...
> Hi Frederik
>
> Run this code. It does what you want it to.
> In your original code you compared two strings in the IF-statement.
> When the $resolution gotten from your JavaScript returned '800' it would
> have a lexical higher value than '1024' and thereby do exacely what
> you wanted it to - actually the code would always return \1024\ since
> your screen resolution would never return a string with a lexical
> lower value than '1024'.
>
> By multiplying the string '1024' by 1 you get the integervalue 1024
> (that's a trick PHP offers ;) ) which you then compare to the
> integervalue 1024.
>
> That's the trick....
>
> $resolution = "<SCRIPT
LANGUAGE=\"JavaScript\">document.write(screen.width)</SCRIPT>";
> echo "--".$resolution."--";
> if (($resolution*1) >= 1024) {
> $resolution = "1024";
> } else {
> $resolution = "800";
> }
> echo "**".$resolution."**";
>
> Venlig hilsen ha' en bra dag,
> Morten Winkler
>
>
attached mail follows:
all this is happening on the server. on the server $resolution is just a string so "if ($resolution >= '1024')" compares the two strings (using ascii values) and finds that "<"(60) is greater than "1"(49). If you want the server to know the screen width of the client you'll need to dig into the header info sent with the request, or you may need to get javascript to send it back to you, I'm not too sure about this.
Tim Ward Senior Systems Engineer
Please refer to the following disclaimer in respect of this message: http://www.stivesdirect.com/e-mail-disclaimer.html
> -----Original Message-----
> From: Fredrik A. Takle [mailto:ftakle
online.no]
> Sent: 17 July 2001 08:35
> To: php-general
lists.php.net
> Subject: Output (Urgent!)
>
>
> Why doesn't this work? Any ideas?!
>
> $resolution = "<SCRIPT
> LANGUAGE=\"JavaScript\">document.write(screen.width)</SCRIPT>";
>
> if ($resolution >= '1024') {
> $resolution = "1024";
> } else {
> $resolution = "800";
> }
> echo $resolution;
>
> It always output 1024
>
> Best regards
> Fredrik A. Takle
> Bergen, Norway
>
>
>
attached mail follows:
>> How you want to get a value from client side to php on the same page?
Well. Actually I didn't invent the code. I just correcteded it so it worked on my installation. I must admit I was amazed that it somehow worked, but it did.
Kind regards, Morten Winkler
attached mail follows:
How do you know it worked? :)
> -----Original Message-----
> From: Morten Winkler Jørgensen [mailto:madmax
mip.sdu.dk]
> Sent: 17 iulie 2001 12:54
> To: php-general
lists.php.net
> Subject: Re: [PHP] Output (Urgent!)
>
>
>
> >> How you want to get a value from client side to php on the
> same page?
>
> Well. Actually I didn't invent the code. I just correcteded it so it
> worked on my installation. I must admit I was amazed that it somehow
> worked, but it did.
>
>
> Kind regards,
> Morten Winkler
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail:
> php-list-admin
lists.php.net
>
>
attached mail follows:
Well, Yes... you have to stick to JavaScript + JavaScript and not JavaScript + PHP! You can let PHP talk w/ JavaScript and not the reverse!
<SCRIPT LANGUAGE="JavaScript" type="text"> if (screen.width >= 1024) { var resolution = "1024"; } else { var resolution = "800"; } document.write(resolution); </SCRIPT>
btw, why don't you like it?
"Fredrik A. Takle" <ftakle
online.no> wrote in message
news:20010717085824.84803.qmail
pb1.pair.com...
> This fixed it, but I don't like it! If you have any other suggestions,
feel
> free to email me.
>
> <SCRIPT LANGUAGE="JavaScript">
> if (screen.width >= 1024) {
> var resolution = ("1024")
> } else {
> var resolution = ("800")
> }
> </SCRIPT>
>
> Best Regards
> Fredrik A. Takle
>
> "Fredrik A
>
>
attached mail follows:
This discussion reflects a surprisingly common misunderstanding of client v. server side scripting. PHP, all processing takes place on the server. Javascript, all processing takes place on the client. I've seen this misconception with ASP v. VBscript/javascript too.
Strange.... you would think this would be the most basic of fundamentals.
My 2c, Brad
attached mail follows:
Don't like it 'cause it is client-side, but it works fine!
...Fredrik:)
"Elias" <elias_bachaalany
yahoo.com> wrote in message
news:20010717100649.25727.qmail
pb1.pair.com...
> Well, Yes...
> you have to stick to JavaScript + JavaScript and not JavaScript + PHP!
> You can let PHP talk w/ JavaScript and not the reverse!
>
> <SCRIPT LANGUAGE="JavaScript" type="text">
> if (screen.width >= 1024) {
> var resolution = "1024";
> } else {
> var resolution = "800";
> }
> document.write(resolution);
> </SCRIPT>
>
> btw, why don't you like it?
> "Fredrik A. Takle" <ftakle
online.no> wrote in message
> news:20010717085824.84803.qmail
pb1.pair.com...
> > This fixed it, but I don't like it! If you have any other suggestions,
> feel
> > free to email me.
> >
> > <SCRIPT LANGUAGE="JavaScript">
> > if (screen.width >= 1024) {
> > var resolution = ("1024")
> > } else {
> > var resolution = ("800")
> > }
> > </SCRIPT>
> >
> > Best Regards
> > Fredrik A. Takle
> >
> > "Fredrik A
> >
> >
>
>
attached mail follows:
You aren't getting the value to the PHP script... allow me to walk through what is actually happening
$resolution = "<SCRIPT LANGUAGE=\"JavaScript\">document.write(screen.width)</SCRIPT>"; echo "--".$resolution."--";
You have just set a variable to "<SCRIPT LANGUAGE=\"JavaScript\">document.write(screen.width)</SCRIPT>" and then echoed that string. so it looks like you have
--1024-- or whatever your resolution is. if you view source though you see you really have
--<SCRIPT LANGUAGE=\"JavaScript\">document.write(screen.width)</SCRIPT>--
and the client browser is just interpreting that JavaScript statement
if (($resolution*1) >= 1024) { $resolution = "1024"; } else { $resolution = "800"; } echo "**".$resolution."**";
The reason this isn't acting the way you expect is because you AREN'T saying if ((1024*1) >= 1024 { You are actually saying if ((<SCRIPT LANGUAGE=\"JavaScript\">document.write(screen.width)</SCRIPT>*1) >= 1024) {
You are not actually passing anything from JavaScript to PHP... you are just tricking yourself =)
Sheridan
----- Original Message -----
From: Morten Winkler Jørgensen <madmax
mip.sdu.dk>
To: <php-general
lists.php.net>
Sent: Tuesday, July 17, 2001 4:54 AM
Subject: Re: [PHP] Output (Urgent!)
> > >> How you want to get a value from client side to php on the same page? > > Well. Actually I didn't invent the code. I just correcteded it so it > worked on my installation. I must admit I was amazed that it somehow > worked, but it did. > > > Kind regards, > Morten Winkler
attached mail follows:
Hello,
I'm quite new to this list so i guess you've had this subject hundereds of times before(?).
Anyway - I'm looking for articles/information about PHPlib, FastTemplate and their clones.
I'm also looking for information about how to do big/complex sites. OOP in php, filestructures etc. Right now I don't even know what a file containing classes should be named, i've seen such files with .php, .inc, .obj and .object as extension.
Thanks!
Best regards, Johannes Schill
attached mail follows:
Hi everybody! Please, have somebody any experience with displaying icons (type files *.ico) in web pages?
When I have a pure html file that contain <img src="abduction.ico">, all is OK - the icon is shown. But when I create a html page with assistance PHP, the icon isn't shown.
Please, could you help me?? Thank you!
Best Regards, PETER.
attached mail follows:
Hmm... It seems that you're variables are beeing reposted upon each page reload.
yes, some code might help.
"Johan Vikerskog" <Johan.Vikerskog
ecs.ericsson.se> wrote in message
news:A9D7A677B724D411A8B600204840355E0351507B
eseldnt102.ld.sw.ericsson.se..
.
> ok, i still am a newbie to this and therefor ill ask this silly question.
>
> I have made a small test script which checks the inputted name and pass
against my database and if
> it was successfull it typed out success! and if it wasnt successfull it
types out wrong password!
>
> My problem is. everytime i reload the page it prints out the last result.
> I mean when i want to reload the page it should be empty.
> But it isnt.
>
> Does anyone know how i can do this?
> If you dont understand my question ill post the script here, i just
thought i wouldent flame your mailboxes.
>
> //Johan
attached mail follows:
> > > -----Original Message-----
> > > From: SED [mailto:sed
sed.is]
> > > According to the manual, you can only get closest value of your
> > > desired color by letting the ImageColorClosest() find it. Therefore,
> > > if the image is totally black, you can not get the yellow color. I
> > > have not found a way to do this though I believe I have tried
> > > everything. And yet, I have not found any documents covering this
> > > other than PHP-manual.
I didn't get this from reading the manual, but I struggled with this problem for days and finally gave up. I posted to some other forums when this one was done and found no answers.
Now, I know it isn't just me and I know what the problem is, but I still don't know a solution.
I am creating an image on the fly and I have no problem if I am just using a background color and adding text to it or if I use ImageCreateFromPNG, but if I use ImageCreateFromJPEG and try to add text on top of that or even a rectangle or anything on top, it seems to ignore the color that I specify and always came out grey. (Of course now if I use ImageColorClosest(), some colors work because they are in my image.)
It doesn't matter what I output it as, only what I read it in as.
And if I read it in as a png, the image quality is horrible which I also don't understand. It seems to have drastically reduced the number of colors used.
My phphinfo says GD version 1.6.2 or higher I'm using PHP Version 4.0.1pl2
Here is my test page. http://216.122.251.174/test/test.php
Here is the source for the graphic http://216.122.251.174/test/button.phps
Any idea on how solutions?
Jennifer
attached mail follows:
Jennifer wrote: > it seems to ignore the color that I specify and always came out > grey. (Of course now if I use ImageColorClosest(), some colors > work because they are in my image.) > > > Any idea on how solutions? >
Oops. I didn't read far enough. I found the following in a separate thread.
> I experienced the same, but i use following workaround: > Create a new Jpeg, Allocate your colours, and copy your original jpg > into the new one. then you have all the colours you have allocated in > your new pic...
So now my question is, how do I copy one image into another?
I see ImageCopy(), but it mentions copying a part of the image, so do I have to use GetImageSize to determine the size of the src image first?
Jennifer
attached mail follows:
I don't know a way around the problem you're describing with your version of PHP, but PHP 4.0.6 with GD 2.0.1 allows you to call ImageCreateTrueColor(), which eliminates the 256-color limitation with JPEG files-- solved my problem right away.
-----Original Message-----
From: Jennifer [mailto:toxlists
canada.com]
Sent: Tuesday, July 17, 2001 5:55 AM
To: php-general
lists.php.net
Subject: Re: [PHP] How to add a new color to JPEG
> > > -----Original Message-----
> > > From: SED [mailto:sed
sed.is]
> > > According to the manual, you can only get closest value of your
> > > desired color by letting the ImageColorClosest() find it.
> > > Therefore, if the image is totally black, you can not get the
> > > yellow color. I have not found a way to do this though I believe I
> > > have tried everything. And yet, I have not found any documents > > > covering this other than PHP-manual.
I didn't get this from reading the manual, but I struggled with this problem for days and finally gave up. I posted to some other forums when this one was done and found no answers.
Now, I know it isn't just me and I know what the problem is, but I still don't know a solution.
I am creating an image on the fly and I have no problem if I am just using a background color and adding text to it or if I use ImageCreateFromPNG, but if I use ImageCreateFromJPEG and try to add text on top of that or even a rectangle or anything on top, it seems to ignore the color that I specify and always came out grey. (Of course now if I use ImageColorClosest(), some colors work because they are in my image.)
It doesn't matter what I output it as, only what I read it in as.
And if I read it in as a png, the image quality is horrible which I also don't understand. It seems to have drastically reduced the number of colors used.
My phphinfo says GD version 1.6.2 or higher I'm using PHP Version 4.0.1pl2
Here is my test page. http://216.122.251.174/test/test.php
Here is the source for the graphic http://216.122.251.174/test/button.phps
Any idea on how solutions?
Jennifer
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribelists.php.net For additional commands, e-mail: php-general-help
lists.php.net To contact the list administrators, e-mail: php-list-admin
lists.php.net
attached mail follows:
has this problem
check the annoted manual on php.net. i believe there is a work arround posted on imagecolorallocate() and i reposted the same thing under imagecreatefromjpeg. basically you create and image, allocate colors, and then copy your jpeg on it.
Thank You,
Jon Yaggie www.design-monster.com
And they were singing . . .
'100 little bugs in the code 100 bugs in the code fix one bug, compile it again 101 little bugs in the code
101 little bugs in the code . . .'
And it continued until they reached 0
----- Original Message -----
From: "Matthew Loff" <matt
willetts.com>
To: "'Jennifer'" <toxlists
canada.com>; <php-general
lists.php.net>
Sent: Wednesday, July 18, 2001 12:01 AM
Subject: RE: [PHP] How to add a new color to JPEG
>
> I don't know a way around the problem you're describing with your
> version of PHP, but PHP 4.0.6 with GD 2.0.1 allows you to call
> ImageCreateTrueColor(), which eliminates the 256-color limitation with
> JPEG files-- solved my problem right away.
>
> -----Original Message-----
> From: Jennifer [mailto:toxlists
canada.com]
> Sent: Tuesday, July 17, 2001 5:55 AM
> To: php-general
lists.php.net
> Subject: Re: [PHP] How to add a new color to JPEG
>
>
> > > > -----Original Message-----
> > > > From: SED [mailto:sed
sed.is]
> > > > According to the manual, you can only get closest value of your
> > > > desired color by letting the ImageColorClosest() find it.
> > > > Therefore, if the image is totally black, you can not get the
> > > > yellow color. I have not found a way to do this though I believe I
>
> > > > have tried everything. And yet, I have not found any documents
> > > > covering this other than PHP-manual.
>
> I didn't get this from reading the manual, but I struggled with this
> problem for days and finally gave up. I posted to some other forums
> when this one was done and found no answers.
>
> Now, I know it isn't just me and I know what the problem is, but I still
> don't know a solution.
>
> I am creating an image on the fly and I have no problem if I am just
> using a background color and adding text to it or if I use
> ImageCreateFromPNG, but if I use ImageCreateFromJPEG and try to add text
> on top of that or even a rectangle or anything on top, it seems to
> ignore the color that I specify and always came out grey. (Of course now
> if I use ImageColorClosest(), some colors work because they are in my
> image.)
>
> It doesn't matter what I output it as, only what I read it in as.
>
> And if I read it in as a png, the image quality is horrible which I also
> don't understand. It seems to have drastically reduced the number of
> colors used.
>
> My phphinfo says GD version 1.6.2 or higher I'm using PHP Version
> 4.0.1pl2
>
> Here is my test page.
> http://216.122.251.174/test/test.php
>
> Here is the source for the graphic
> http://216.122.251.174/test/button.phps
>
> Any idea on how solutions?
>
> Jennifer
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net To
> contact the list administrators, e-mail: php-list-admin
lists.php.net
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
attached mail follows:
Hello,
I have a requirement to add elements to an associate array dynamically based on some conditions. I initialize the array with the 1st associate array element $MyArray = array('DATETIME' => $DateTime);
How do I add more elements to this associate array. I am using PHP 3 and array_merge and other functions for arrays are not supported in PHP3. I am trying the following: $MyArray[] = array("BUYVAL" => "1.23"); but if I try and get the value of $MyArray[BUYVAL], I get nothing.
I am sure this must be simple, but I do not seem to be getting it right!!
Regards, Sharat Hegde Phone: 6560360 Ext 4680
attached mail follows:
$MyArray['BUYVAL'] = 1.23;
> -----Original Message-----
> From: Sharat Hegde [mailto:shah
sonata-software.com]
> Sent: 17 iulie 2001 13:11
> To: php-general
lists.php.net
> Subject: [PHP] Adding elements to an array
>
>
> Hello,
>
> I have a requirement to add elements to an associate array
> dynamically based
> on some conditions. I initialize the array with the 1st
> associate array
> element
> $MyArray = array('DATETIME' => $DateTime);
>
> How do I add more elements to this associate array. I am
> using PHP 3 and
> array_merge and other functions for arrays are not supported
> in PHP3. I am
> trying the following:
> $MyArray[] = array("BUYVAL" => "1.23");
> but if I try and get the value of $MyArray[BUYVAL], I get nothing.
>
> I am sure this must be simple, but I do not seem to be
> getting it right!!
>
> Regards,
> Sharat Hegde
> Phone: 6560360 Ext 4680
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail:
> php-list-admin
lists.php.net
>
>
attached mail follows:
Try $MyArray = array('DATETIME' => $DateTime); $MyArray["BUYVAL" ] = "1.23";
"Sharat Hegde" <shah
sonata-software.com> wrote in message
news:30402B4CB8C7D311A3C600C04F1513BC7E8976
bg2ipmail...
> Hello,
>
> I have a requirement to add elements to an associate array dynamically
based
> on some conditions. I initialize the array with the 1st associate array
> element
> $MyArray = array('DATETIME' => $DateTime);
>
> How do I add more elements to this associate array. I am using PHP 3 and
> array_merge and other functions for arrays are not supported in PHP3. I am
> trying the following:
> $MyArray[] = array("BUYVAL" => "1.23");
> but if I try and get the value of $MyArray[BUYVAL], I get nothing.
>
> I am sure this must be simple, but I do not seem to be getting it right!!
>
> Regards,
> Sharat Hegde
> Phone: 6560360 Ext 4680
>
attached mail follows:
On Tue, 17 Jul 2001, Sharat Hegde wrote:
> Hello, > > I have a requirement to add elements to an associate array dynamically based > on some conditions. I initialize the array with the 1st associate array > element > $MyArray = array('DATETIME' => $DateTime); > > How do I add more elements to this associate array. I am using PHP 3 and > array_merge and other functions for arrays are not supported in PHP3. I am > trying the following: > $MyArray[] = array("BUYVAL" => "1.23"); > but if I try and get the value of $MyArray[BUYVAL], I get nothing.
What you have done here is that you have added an array to your array, but you wished to have the value added to your array. The $MyArray[] pushes a new value to the array, in this case another array. You want $MyArray['BUYVAL'] = 1.23.
More info on arrays from the php docs: http://php.net/manual/en/language.types.array.php
-- patrik wallstrom | f o o d f i g h t tel: +46-8-6188428 | s t o c k h o l m gsm: +46-708405080 | - - - - - - - - -
attached mail follows:
I made a search in ldap. I got one entrie.
How do i list the email for that entry? Ill get one answer from this, now i want to print out the email adress for that entry. How do i do that?
//Johan
<?php
echo "<h3>LDAP query test</h3>"; echo "Connecting ..."; $ds=ldap_connect("SERVER");
$dn = "o=Company, c=SV"; $filter="(|(sn=name)(givenname=name))"; $justthese = array( "ou", "sn", "givenname", "mail");
$sr=ldap_search($ds, $dn, $filter, $justthese);
$info = ldap_get_entries($ds, $sr);
print $info["count"]." entries returned<p>";
?>
Johan Vikerskog Technician - CAE Tools Support Research & Technology Development ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' Ericsson Mobile Communications AB Mobile Phones & Terminals Telephone: +46 46 19 33 38 Nya Vattentornet Telefax: +46 46 19 32 36 SE-221 83 Lund, Sweden
attached mail follows:
Previously, Johan Vikerskog (ECS) said: > > How do i list the email for that entry? Ill get one answer from this, now > i want to print out the email adress for that entry. > How do i do that? > > $sr=ldap_search($ds, $dn, $filter, $justthese); > $info = ldap_get_entries($ds, $sr); > print $info["count"]." entries returned<p>";
This should do what you want; just stick it at the end of the code you already had in this email.
for ($i = 0; $i < $info['count']; $i++) { print $info[$i]['mail'][0] . '<br>'; }
That's assuming there is always only one value for "mail" in a given entry.
-dan
-- The main reason Santa is so jolly is because he knows where all the bad girls live. -George Carlin
attached mail follows:
how about using php mail functions if you've got the support on your server ....
then a simple form to send the mail and you can track everything you need to ...
Steve
"Jorg krause" <krause
comzept.de> wrote in message
news:GAEMKLLHIJCHLEKLFACHMEFDEHAA.krause
comzept.de...
> Hi,
>
> > Brian White [mailto:bwhite
steptwo.com.au] wrote on Tuesday, July 17,
2001
> 5:52 AM
> > To: Jack; php-general
lists.php.net
> > Subject: Re: [PHP] email counter
> >
> >
> > How about changing link to
> >
> > <a href="mymailer.php?email=lucas
starwars.com"> Big George </a>
> >
> > Where mymailer.php is something like
> >
> > <?php
> > /*
> > Do whatever it is you need to do with $email
> > */
> >
> > header("Location: mailto:$email" );
> >
> > ?>
> >
>
> Works, but changes the previous open window into a empty sheet
> and displays "mailto:lucas
starwars.com", so the old page
> disappears (the user has to click the back button). I think this
> solution is not really good for common usage.
>
> Try to use javascript:
>
> <script language="JavaScript">
> x = window.open("mailto:<?php echo $mailaddress ?>", "Site");
> </script>
>
> It's easy to combine it with PHP to count the send mails.
>
> Joerg
> www.php.comzept.de
>
attached mail follows:
Hmm... do you have write access on that directory? IUSR_xxx and IWAM_xxxx users must be appropriate writes on that folder...
"Adam Whitehead" <Adam_Whitehead
dialog.com.au> wrote in message
news:OF3C4EB825.777E77E2-ON69256A8C.001789D5
dialog.com.au...
> Hi All-
>
> I'm having trouble with a simple script that allows HTTP upload. It's a
> direct copy
> of the code available on the PHP web site.
>
> The script works fine on a UNIX machine running PHP 4.0.6 and a Windows 98
> machine running 4.0.6.
>
> However when I test it on a Windows NT machine running PHP 4.0.6, as soon
> as
> the submit button is clicked it causes a page fault in php.exe.
>
> Is this a known issue? In php.ini, the temporary upload path is set to a
> correct
> location and no amount of tweaking this path makes any difference.
>
> The script looks like this:
>
> <?php
> if (is_uploaded_file($userfile)) {
> move_uploaded_file($userfile,"H:\\www\\uploadtest.txt");
> echo "Done.";
> }
> ?>
>
> <FORM ENCTYPE="multipart/form-data" ACTION="uploadtest.php" METHOD="post">
> <INPUT TYPE="hidden" name="MAX_FILE_SIZE" value="500000">
> Send this file: <INPUT NAME="userfile" TYPE="file">
> <INPUT TYPE="submit" VALUE="Send File">
> </FORM>
>
> Regards,
> Adam Whitehead
>
attached mail follows:
Hi Brad,
Took another go at it:
This works for me:
$sql= "SELECT * FROM login_table where Pass = password('$password')"; $testResult = mysql_query($sql) or die ("ouch"); $b = mysql_num_rows($testResult); echo $b;
for sure. I password(ed) the INSERT and it shows the encrypted version in the table, then i created another form and this works! I get the num_rows...
lvin
btw, check you caps again, both your code had different spellings: Login_Table and login_table....
At 03:08 PM 7/17/01, Brad Wright wrote:
>Alvin,
>the values for Pass in the table have been passed into the table using the
>password('') command and I have also veiwed he content of the tables to
>confirm it. IE the value (i've only got one row in the table at the moment)
>I have passed to the table IS encrypted.
>this is the insert command:
>$query = "insert INTO Login_Table(Login,Pass)
> values ('$Login', password('$Pass'))";
>
>The most puzzling thig is that this works, but the use of the same (mySQL)
>password function, in the SELECT statement doesnt work.
>
>
>AAAAHHHH
>
> > From: Alvin Tan <alvintan
inscribe.com.my>
> > Date: Tue, 17 Jul 2001 14:38:58 +0800
> > To: Brad Wright <bradwright
optushome.com.au>, Jason Murray
> > <Jason.Murray
melbourneit.com.au>, PHP General List
> > <php-general
lists.php.net>
> > Subject: Re: [PHP] mysql_query problem (more suggestions)
> >
> > Hi again,
> >
> > Just a long shot: since password() encrypts the password that's passed
> > through it, how did the original password get in to db anyway? Was it
> > encrypted too? Cause if the password in the db is plain text and the user
> > submits a plain text in a form called $password, the password() function
> > WILL encrypt the form input and there will be no matches.
> >
> > try removing the password() function in the sql query and substitute it for
> > $password only. If there is a match, then we know we need to put in the db
> > an INSERT statement with password()..
> >
> >
lvin
> >
> > At 01:57 PM 7/17/01, Brad Wright wrote:
> >> Jason,
> >> I have tried what yoiu suggested. result is the same.
> >>
> >>> From: Jason Murray <Jason.Murray
melbourneit.com.au>
> >>> Date: Tue, 17 Jul 2001 15:28:11 +1000
> >>> To: "'Brad Wright'" <bradwright
optushome.com.au>, Alvin Tan
> >>> <alvintan
inscribe.com.my>, PHP General List <php-general
lists.php.net>
> >>> Subject: RE: [PHP] mysql_query problem (more suggestions)
> >>>
> >>>> Unless i have actually defined a function 'password()', calling 'echo
> >>>> password('$password') will (...does, i just double checked)
> >>>> causes a Fatal
> >>>> Error 'Undefined Function'.
> >>>> Nice try tho :)
> >>>
> >>> the original mail said to echo $query, which will include some
> >>> text in it that says "password('ifovhfoiuf')" ... you should
> >>> then paste that entire query into your MySQL interpreter and
> >>> see what the reaction is instead of trying to secondguess it :)
> >>>
> >>> Jason
> >>>
> >>> --
> >>> PHP General Mailing List (http://www.php.net/)
> >>> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> >>> For additional commands, e-mail: php-general-help
lists.php.net
> >>> To contact the list administrators, e-mail: php-list-admin
lists.php.net
> >>>
> >>
> >>
> >> --
> >> PHP General Mailing List (http://www.php.net/)
> >> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> >> For additional commands, e-mail: php-general-help
lists.php.net
> >> To contact the list administrators, e-mail: php-list-admin
lists.php.net
> >
attached mail follows:
I was doing something similar just yesterday. Ended up with a little function to automatically write hidden <input>s for every variable that's submitted, whether posted or thru the url. Goes like this...
// put this somewhere in your form <?php print get_param_inputs(); ?>
// the function itself function get_param_inputs() { global $HTTP_GET_VARS, $HTTP_POST_VARS; $ret_str = ""; $params = array_merge($HTTP_GET_VARS, $HTTP_POST_VARS); foreach ($params as $k=>$v) { if (is_array($v)) { foreach($v as $kk=>$vv) { $ret_str .= '<input type="hidden" name="'."$k[$kk]".' value="'.$vv.'">'; } } else { $ret_str .= '<input type="hidden" name="'.$k.'" value="'.$v.'">'; } } return $ret_str; }
I also needed to append the variables to links on the same page (for page 1, page 2, page 3... type thing) so did this:
<a href="<?php print $PHP_SELF.get_param_query() ?>">link</a>
function get_param_query() { global $HTTP_GET_VARS, $HTTP_POST_VARS; $ret_str = ""; $params = array_merge($HTTP_GET_VARS, $HTTP_POST_VARS); $j = "?"; foreach ($params as $k=>$v) { if (is_array($v)) { foreach($v as $kk=>$vv) { $ret_str .= $j.urlencode("$k[$kk]=$vv"); $j = "&"; } } else { $ret_str .= $j.urlencode("$k=$v"); $j = "&"; } } return $ret_str; }
Won't work if you're nesting arrays within arrays, but I'm not a recursive type. Hope it helps,
Matt
"David Robley" <huntsman
www.nisu.flinders.edu.au> wrote in message
news:01071716134101.29979
www...
> On Tue, 17 Jul 2001 15:41, Tim Olsen wrote:
> > People,
> > I have 4 forms in four seperate html pages included directly (no links
> > to includes) in the same .php file, i have it so all the form actions
> > is php.self, so when each form is submitted it goes on to display the
> > next form in line, using if and else statements, of course. I want to
> > be able to use variables created by the first form in the html part of
> > the last form. What is the best way to do this?
> >
> > So far, I can only use variables on the next page (form) that is
> > written out. After that those variables have no value. Is there some
> > way to submit all variables present and assigned with the submission of
> > each form? If I make the forms a seperate include file, instead of
> > having them in-line, how does this change the ways variables are passed
> > or submitted by each form? Thanks, - Tim
> > _________________________________________________________________
>
>
> If I understand what you are saying: those variables don't exist until
> you SUBMIT the form. You can demonstrate this by looping through and
> displaying your POST or GET vars at the beginning of the form and see
> what happens when you first open the page, and when it calls itself.
>
> And re-reading, I think what you may want is hidden fields. You want part
> one to call part 2, and retain values from part 1, etc? Echo the values
> into hidden fields in each step of the process.
>
> <INPUT TYPE=hidden NAME=whatever VALUE="<?php echo $whatever ?>">
>
> --
> David Robley Techno-JoaT, Web Maintainer, Mail List Admin, etc
> CENTRE FOR INJURY STUDIES Flinders University, SOUTH AUSTRALIA
>
> I always lie. In fact, I'm lying to you right now!
attached mail follows:
Yeah, I had thought about using hidden inputs, but hidden inputs are not really hidden. They still exist on the HTML page, and although not visible in the browser, are visible in the code. This may not be cool if you have sensitive information that is passed, also if you have a lot of variables to pass, thats just a lot of hidden inputs to pass. Is there no other way to accomplish this? No built in function? I guess it makes sense that there is not, b/c the form submits the form and only the form variables. Thanks. -Tim
----Original Message Follows----
From: David Robley <huntsman
www.nisu.flinders.edu.au>
Reply-To: huntsman
www.nisu.flinders.edu.au
To: "Tim Olsen" <mrtimo
hotmail.com>, php-general
lists.php.net
Subject: Re: [PHP] passing variables from forms to the same page
repetatively
Date: Tue, 17 Jul 2001 16:13:41 +0930
On Tue, 17 Jul 2001 15:41, Tim Olsen wrote: > People, > I have 4 forms in four seperate html pages included directly (no links > to includes) in the same .php file, i have it so all the form actions > is php.self, so when each form is submitted it goes on to display the > next form in line, using if and else statements, of course. I want to > be able to use variables created by the first form in the html part of > the last form. What is the best way to do this? > > So far, I can only use variables on the next page (form) that is > written out. After that those variables have no value. Is there some > way to submit all variables present and assigned with the submission of > each form? If I make the forms a seperate include file, instead of > having them in-line, how does this change the ways variables are passed > or submitted by each form? Thanks, - Tim > _________________________________________________________________
If I understand what you are saying: those variables don't exist until you SUBMIT the form. You can demonstrate this by looping through and displaying your POST or GET vars at the beginning of the form and see what happens when you first open the page, and when it calls itself.
And re-reading, I think what you may want is hidden fields. You want part one to call part 2, and retain values from part 1, etc? Echo the values into hidden fields in each step of the process.
<INPUT TYPE=hidden NAME=whatever VALUE="<?php echo $whatever ?>">
-- David Robley Techno-JoaT, Web Maintainer, Mail List Admin, etc CENTRE FOR INJURY STUDIES Flinders University, SOUTH AUSTRALIAI always lie. In fact, I'm lying to you right now!
_________________________________________________________________ Get your FREE download of MSN Explorer at http://explorer.msn.com
attached mail follows:
There are a thousand ways to pass data... some are just more kludgy than others =)
In addition to using hidden fields You could put the data into a Database You could Write it to a file You could put it in a cookie You could use sessions etc, etc, ad nauseam
Two things to point out, however.
The first is that using Hidden fields is not really frowned down upon (at least not by anyone I know) and will probably lead to the least convoluted code.
The second is that anything passed in a form (unless you are using SSL or something) is already insecure. If you have truly sensitive information you need to be looking into encryption, if not then why sweat the hidden fields?
Sheridan
----- Original Message -----
From: Tim Olsen <mrtimo
hotmail.com>
To: <huntsman
www.nisu.flinders.edu.au>; <php-general
lists.php.net>
Sent: Tuesday, July 17, 2001 1:07 PM
Subject: Re: [PHP] passing variables from forms to the same page
repetatively
> Yeah, I had thought about using hidden inputs, but hidden inputs are not
> really hidden. They still exist on the HTML page, and although not visible
> in the browser, are visible in the code. This may not be cool if you have
> sensitive information that is passed, also if you have a lot of variables
to
> pass, thats just a lot of hidden inputs to pass.
> Is there no other way to accomplish this? No built in function? I guess it
> makes sense that there is not, b/c the form submits the form and only the
> form variables. Thanks.
> -Tim
>
>
> ----Original Message Follows----
> From: David Robley <huntsman
www.nisu.flinders.edu.au>
> Reply-To: huntsman
www.nisu.flinders.edu.au
> To: "Tim Olsen" <mrtimo
hotmail.com>, php-general
lists.php.net
> Subject: Re: [PHP] passing variables from forms to the same page
> repetatively
> Date: Tue, 17 Jul 2001 16:13:41 +0930
>
> On Tue, 17 Jul 2001 15:41, Tim Olsen wrote:
> > People,
> > I have 4 forms in four seperate html pages included directly (no links
> > to includes) in the same .php file, i have it so all the form actions
> > is php.self, so when each form is submitted it goes on to display the
> > next form in line, using if and else statements, of course. I want to
> > be able to use variables created by the first form in the html part of
> > the last form. What is the best way to do this?
> >
> > So far, I can only use variables on the next page (form) that is
> > written out. After that those variables have no value. Is there some
> > way to submit all variables present and assigned with the submission of
> > each form? If I make the forms a seperate include file, instead of
> > having them in-line, how does this change the ways variables are passed
> > or submitted by each form? Thanks, - Tim
> > _________________________________________________________________
>
>
> If I understand what you are saying: those variables don't exist until
> you SUBMIT the form. You can demonstrate this by looping through and
> displaying your POST or GET vars at the beginning of the form and see
> what happens when you first open the page, and when it calls itself.
>
> And re-reading, I think what you may want is hidden fields. You want part
> one to call part 2, and retain values from part 1, etc? Echo the values
> into hidden fields in each step of the process.
>
> <INPUT TYPE=hidden NAME=whatever VALUE="<?php echo $whatever ?>">
>
> --
> David Robley Techno-JoaT, Web Maintainer, Mail List Admin, etc
> CENTRE FOR INJURY STUDIES Flinders University, SOUTH AUSTRALIA
>
> I always lie. In fact, I'm lying to you right now!
>
> _________________________________________________________________
> Get your FREE download of MSN Explorer at http://explorer.msn.com
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
attached mail follows:
We've built a framework that gets around this, without using HIDDEN form fields. It's quite complex so I'll give a high level description, it should give you some ideas. Our framework works on the basis that every page consists of a single form that submits to itself (same URL). All page/form elements are constructed from a library of class objects written in PHP. These elements may, or may not, have a value. By default we make all of these values session variables, so we are gauranteed that the values will be there on the next page submission. We prefix these session variables with a unique prefix. If a page goes to another URL then our framework recognises that the URL has changed and deletes all of the previous pages session variables by identifying them with the defined prefix.
All of this is hidden away from the programmer, the behaviour is encapsulated in our frameworks base classes. When a page loads it begins by constructing the page element objects, during construction the base classes check for the existance for a session variable value. If it exists then that particular form object is assigned that value. The application code can set values for form objects, but it does this through accessor functions, which in turn ensure that the new value is propogated to the session variable. If a value is POSTed to the page then the framework grabs the value and assigns it to the form object via the accessor function (hence it's now a session variable once again).
We took it a little step further and added similar caching of data objects, so on a page reload the same result sets are used from the last time around (if desired) rather than having to make another round trip to the database.
The programmer only has to pick the relevant form objects that they are interested in and position them on the page using a layout table object. The framework takes responsibilty for maintaining state and the coder just has write the app. logic.
This is a very high level description, the solution is not trivial and threw up a number of issues that we've successfully solved. For example, we implemented meaningful name-mangling of form objects to prevent the creation of multiple form objects with the same name. We have implemented an event driven mechanism so that 'onclick' routines are called for those objects that caused a form submission (be that a button, link or listbox selection). If you want to let a user go to another screen then you stick a redirect in the 'onclick' event for that object. Of course, this means that nothing can be displayed before hand, so our framework ensures that nothing is sent to the screen until all application code has run. All screen objects can have javascript associated with themselves, this code is all output together in the correct part of the HTML generation. There are a bunch of other features that we have. This OO approach has saved us a great deal of time.
It works surprisingly well and means that we spend 90% of our time debugging application code rather than debugging niggling issues with PHP/HTML.
-----Original Message-----
From: Tim Olsen [mailto:mrtimo
hotmail.com]
Sent: 17 July 2001 19:07
To: huntsman
www.nisu.flinders.edu.au; php-general
lists.php.net
Subject: Re: [PHP] passing variables from forms to the same page
repetatively
Yeah, I had thought about using hidden inputs, but hidden inputs are not really hidden. They still exist on the HTML page, and although not visible in the browser, are visible in the code. This may not be cool if you have sensitive information that is passed, also if you have a lot of variables to pass, thats just a lot of hidden inputs to pass. Is there no other way to accomplish this? No built in function? I guess it makes sense that there is not, b/c the form submits the form and only the form variables. Thanks. -Tim
----Original Message Follows----
From: David Robley <huntsman
www.nisu.flinders.edu.au>
Reply-To: huntsman
www.nisu.flinders.edu.au
To: "Tim Olsen" <mrtimo
hotmail.com>, php-general
lists.php.net
Subject: Re: [PHP] passing variables from forms to the same page
repetatively
Date: Tue, 17 Jul 2001 16:13:41 +0930
On Tue, 17 Jul 2001 15:41, Tim Olsen wrote: > People, > I have 4 forms in four seperate html pages included directly (no links > to includes) in the same .php file, i have it so all the form actions > is php.self, so when each form is submitted it goes on to display the > next form in line, using if and else statements, of course. I want to > be able to use variables created by the first form in the html part of > the last form. What is the best way to do this? > > So far, I can only use variables on the next page (form) that is > written out. After that those variables have no value. Is there some > way to submit all variables present and assigned with the submission of > each form? If I make the forms a seperate include file, instead of > having them in-line, how does this change the ways variables are passed > or submitted by each form? Thanks, - Tim > _________________________________________________________________
If I understand what you are saying: those variables don't exist until you SUBMIT the form. You can demonstrate this by looping through and displaying your POST or GET vars at the beginning of the form and see what happens when you first open the page, and when it calls itself.
And re-reading, I think what you may want is hidden fields. You want part one to call part 2, and retain values from part 1, etc? Echo the values into hidden fields in each step of the process.
<INPUT TYPE=hidden NAME=whatever VALUE="<?php echo $whatever ?>">
-- David Robley Techno-JoaT, Web Maintainer, Mail List Admin, etc CENTRE FOR INJURY STUDIES Flinders University, SOUTH AUSTRALIAI always lie. In fact, I'm lying to you right now!
_________________________________________________________________ Get your FREE download of MSN Explorer at http://explorer.msn.com
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net For additional commands, e-mail: php-general-help
lists.php.net To contact the list administrators, e-mail: php-list-admin
lists.php.net
attached mail follows:
Hi! I am trying to edit this xml-file: I want to change one of the li-nodes. <?xml version="1.0"?> <kund> <li> <na>per</na> <en>Bylund</en> <ga>Semin</ga> </li> <li> <na>Axel</na> <en>Timan</en> <ga>Semina</ga> </li> <li> <na>Lars</na> <en>Berg</en> <ga>Seminar</ga> </li> </kund> ------------- I have tryed to read and explode on "</li>" $fd = fopen($filename, "r"); $string = fread($fd, filesize($filename)); $fru = explode ("</li>", $string); for ($i=0;$fru[$i];++$i) { $newfru = ("$fru[$i]"."</li>"); $newfru = str_replace("</kund>"."\r\n"."</li>","</kund>",$newfru); print $newfru; } How to replace one of the $fru[i], I have tryed inside the forloop but than it replaces all.
Thanks in advance for any help. Regards Jan
attached mail follows:
On Tue, 17 Jul 2001 20:27, Jan Grafstrom wrote: > Hi! > I am trying to edit this xml-file: > I want to change one of the li-nodes. > <?xml version="1.0"?> <snip>
Your call, but I think you'd be better off using these functions to parse the original file and generate the modified version.
Cheers, Brad
attached mail follows:
> I am trying to edit this xml-file:
Have a look at: http://ww.phpxml.org/
Bye Jens
attached mail follows:
Hi,
A simple problem for you guys (I think),
I have 2 arrays - firstname and lastname, both have the same associative index - lastname, I have then performed asort on both to order them alphabetically. Now I just need to extract and display the array elements that have the associative index beginning with A or B or whatever is defined by $query - thus displaying only names where the lastname begins with A etc.
How do I do this?
Thanks for any help you can offer.
Lar
attached mail follows:
Hey guys,
I saw a post in here the other day that's prompted me to ask this question... Because I can't seem to get the solution mentioned to work. Maybe I'm missing something obvious... Anyway, here goes.
I have a list of categories contained in one table, and a list of entries in another. So
categories: id name 1 category1 2 category2 3 category3
At the moment, the entries table has a field which contains a field mentioning the category by id, so:
entries id cat_id name 1 1 name1 2 1 name2 3 1 name3
The problem is this: I'd like to give some entries more than one category. I attempted to put the category id's into an array. So a row in the revised entries table now looks like this:
entries id cat_id name 1 2 name1 2 1,3 name2 3 1 name3
And I'm trying to list from that table with code similar to this:
<?
$cat[0] = 1; $cat[1] = 3;
$getcats = implode(",", $cat);
$query =
mysql_query("SELECT * FROM entries WHERE cat_id IN($getcats)")
or die (mysql_error());
// Get the results
?>
I get no errors when executing that code, but I don't get any results back, either...... even though I know there are entries in the table with the category id listed as 1,3
Any ideas? I'm having "one of those days" :)
Cheers, James.
attached mail follows:
I'm not going to comment on array processing techniques, but I suggest you are into a situation where you have to rethink your database design from the point of view of performance and normalization.
I don't know how many records you will eventually have, but the key to performance in SQL databases is the effective use of indexes, and queries which match. Even if you have an index on the cat_id field, a query like SELECT * FROM entries WHERE cat_id IN($getcats) forces the database engine into a sequential read of the cat_id field.
So you can drop the cat_id field from entries and create a new table entry_cat which has two fields id cat_id
Which gives you this query, although I'm a little uncertain about the bracketing of the condition.
select entries.id, entries.name, entry.cat_id from entries, entry_cat where (entry_cat.id = 1 || entry_cat.id = 3)
(And which, on reflection, may not yield better performance.)
All this brings me to the question I should have asked up front. How often will you want to select multiple categories, and will it be done by range (>2 , <=3) or individual items ( 1 and 5 and 7 )?
I don't think I've been terribly helpful - Miles
At 12:14 PM 7/17/01 +0100, James Holloway wrote:
>Hey guys,
>
>I saw a post in here the other day that's prompted me to ask this
>question... Because I can't seem to get the solution mentioned to work.
>Maybe I'm missing something obvious... Anyway, here goes.
>
>I have a list of categories contained in one table, and a list of entries in
>another. So
>
>categories:
>id name
>1 category1
>2 category2
>3 category3
>
>At the moment, the entries table has a field which contains a field
>mentioning the category by id, so:
>
>entries
>id cat_id name
>1 1 name1
>2 1 name2
>3 1 name3
>
>The problem is this: I'd like to give some entries more than one category.
>I attempted to put the category id's into an array. So a row in the revised
>entries table now looks like this:
>
>entries
>id cat_id name
>1 2 name1
>2 1,3 name2
>3 1 name3
>
>And I'm trying to list from that table with code similar to this:
>
><?
>
>$cat[0] = 1;
>$cat[1] = 3;
>
>$getcats = implode(",", $cat);
>
>$query =
mysql_query("SELECT * FROM entries WHERE cat_id IN($getcats)")
> or die (mysql_error());
>
>// Get the results
>
>?>
>
>I get no errors when executing that code, but I don't get any results back,
>either...... even though I know there are entries in the table with the
>category id listed as 1,3
>
>Any ideas? I'm having "one of those days" :)
>
>Cheers,
>James.
>
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
>For additional commands, e-mail: php-general-help
lists.php.net
>To contact the list administrators, e-mail: php-list-admin
lists.php.net
attached mail follows:
Thanks for your comments, Miles. To answer your question(s), I'll not be wanting to select multiple categories in anything other than the administration section. The main search form has the categories listed, and the user only has the option to select from one category.
The reason I need to be able to give an entry multiple category listings is this: The Snail and Lettuce is a pub / restaurant. The categories list contains a listing, pub, restaurant. So the user can choose from either pub or restaurant when performing a search, but the entry must be displayed in searches for both pub and restaurant.... Does that makes sense?
Perhaps I'm going about this the wrong way.... Sleep deprivation does funny things to the mind :)
James
> All this brings me to the question I should have asked up front. How often > will you want to select multiple categories, and will it be done by range > (>2 , <=3) or individual items ( 1 and 5 and 7 )?
attached mail follows:
('binary' encoding is not supported, stored as-is) Kurt,
You might have some luck with adding [], I seem to remember that making arrays for form posts, so it might do gets too...
http://myhost/playlist.pls?song[]=100&song[]=101&song[]=102
and if you always end up with an array using [], you might change the condition to count($song) > 1 or something for:
> if ( is_array( $song ) ) {
> else {
> }
Good Luck
-Garth
--- http://www.northern.caOn Mon, 16 Jul 2001 20:03:50 -0700 "Kurt Lieber" wrote:
> I posted this late on Sunday afternoon, so it may have been overlooked. > I haven't figured it out yet, so I'm reposting in the hopes someone can > help. Thanks. > > ------------------------------- > > I'm modifying some code for ampache (ampache.kveton.com) and have run > into a snag that I'm not sure I understand completely. > > Part of the code produces a URL similar to the following: > > http://myhost/playlist.pls?song=100&song=101&song=102 > > and $song then gets passed to this function: > > function get_song_path_from_id ( $song ) { > GLOBAL $dbh, $db_name; > > $songs = ''; > $count = 0; > > if ( is_array( $song ) ) { > while ( list($k,$v) = each($song) ) { > //does some cool stuff > } > } > else { > //does some other stuff > } > return ($songs); > } > > So, am I correct in assuming that $song will never be considered an > array? (basically, given the above code and URL, $song will always equal > 102) > > I'm new to PHP, and since I didn't write the original code, I'm not sure > if this is a bug, or something that I just don't fully understand. > Assuming it is a bug, can anyone offer some suggestions on how to take > the URL and parse it out and input the values into an array called > $song? > (get_song_path_from_id() is used by several other parts of the code, so > any modifications to that code would need to leave the rest of the > functionality > intact) > > Thanks. > > --kurt > > P.S. If anyone is looking for a simple, easy-to-use (and set up) mp3 > manager, I highly recommend ampache. It doesn't have a bunch of bells & > whistles (which I don't want) -- it simply provides a simple, effective > way to manage playlists and play your mp3 songs from anywhere. > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net > For additional commands, e-mail: php-general-help
lists.php.net To > contact the list administrators, e-mail: php-list-admin
lists.php.net > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net > For additional commands, e-mail: php-general-help
lists.php.net > To contact the list administrators, e-mail: php-list-admin
lists.php.net >
attached mail follows:
> > > > This is wrong. It should be > > Content-Type: multipart/mixed; > > boundary="------------B42DA66C4EC07C9B572A58FC" > > > > I don't know why it is not reading the whole string. It seems to treat > > the *boundary* part as another line. > > It _is_ another line; it just happens to starts with whitespace. > check RFC822.
No doubt.
> > If you have the whole message in a string (psuedo-code):
Huh.. Then the below should work. But the stupid header breaks :)
> > list ($h,$msg) =split("\n\n", $mailmsg); > > $h=str_replace("\t", " ", $h); // <tab> -> <space> > $h=str_replace("\n ", " ", $h); // <nl><space> -> <space> > // i.e. continuation of prior line > > $hdrs=split("\n", $h); > > ... > > Regards, >
attached mail follows:
Can I send like custom headers?
header ("Resolution: 1024"); and echo it in the phpscript?
Can I do this or is it a silly question?
Best Regards Fredrik A. Takle
attached mail follows:
I am getting this error when using the trying to use the mail function. Any insite will help, I have been up for too long working on a few projects and my brain is damn near melted.
mail() is not supported in this PHP build in
so when I built PHP 4.06 I am assuming I missed a option, but just want to make sure before i head back and re-do things. Is there a simple option to turn on the mail support.
attached mail follows:
as afr as i know it's a recompile with a path to sendmail ... great when it works though !
Steve
"Patrick W. Rateliff" <pwrateliff
isd194.k12.mn.us> wrote in message
news:20010717114412.99807.qmail
pb1.pair.com...
> I am getting this error when using the trying to use the mail function.
Any
> insite will help, I have been up for too long working on a few projects
and
> my brain is damn near melted.
>
>
> mail() is not supported in this PHP build in
>
> so when I built PHP 4.06 I am assuming I missed a option, but just want to
> make sure before i head back and re-do things. Is there a simple option
to
> turn on the mail support.
>
>
attached mail follows:
> What companies issue card numbers that are not 16 numbers? Are > they non-US cards? I haven't ever seen a card that wasn't 16 numbers.
A valid VISA card has between 13-16 digits.
I believe AMERICAN EXPRESS only has 15 digits.
-john
__________John Monfort_________________ _+-----------------------------------+_ P E P I E D E S I G N S www.pepiedesigns.com "The world is waiting, are you ready?" -+___________________________________+-
On Mon, 16 Jul 2001, Christopher Ostmo wrote:
> Ashley M. Kirchner pressed the little lettered thingies in this order...
>
> > Christopher Ostmo wrote:
> >
> > > By law, the numbers are supposed to be
> > > generated at random and not generated by any kind of algorithm or
> > > formula.
> >
> > CC# must pass the Luhn MOD 10 formula, so the generated numbers can't
> > be
> > (totally) random - they have to conform to the formula.
> >
>
> I just responded to this separately... Basically, my earlier research on
> the issue must have been wrong.
>
> > Also, not all credit cards have 16 numbers.
> >
>
>
> Christopher Ostmo
> a.k.a. tech
AppIdeas.com
> AppIdeas.com
> Innovative Application Ideas
> Meeting cutting edge dynamic
> web site needs since the
> dawn of Internet time (1995)
>
> For a good time,
> http://www.AppIdeas.com/
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
>
>
attached mail follows:
Hello again: some one told me to control the "input" and "text areas" right filling in from a form using java script and this is what I'm trying but problems appear.
Options:
the javascript is doing it's work but nothing is inserted in the db if using <input OnClick="envia();" type="button" name="submit_opina" value="opina">
the javascript checks (only) the filling in of the first input and after this the form is submited without more checking, empty fields are submited <input OnClick="envia();" type="submit" name="submit_opina" value="opina">
some help please? thanks in advance
Ani López http://www.lamundial.net Visit us, download and spread our music
------ opinion.php file -------
<html>
<head>
<title>PHP + JavaScript fill in inputs control</title>
<script language="javascript" type="text/javascript">
function envia(){
if (document.opina.name_in.value.length < 1){
window.alert('Write your name');
} else if (document.opina.email_in.value == "" ||
document.opina.email_in.value.indexOf('
', 0) == -1){
window.alert('Write your email');
} else if (document.opina.text_in.value.length < 1){
window.alert('Your opinion please');
} else {
document.opina.submit();
}
}
</script>
</head>
<body bgcolor="#FFFFFF">
<!-- db conexion -->
<?php $dbcnx =
mysql_connect ("localhost", "xxxxx", "xxxxxx");
mysql_select_db ("xxxxxxxx", $dbcnx); ?>
<!-- Insert to db opinion form --> <form name="opina" action="<?php echo($PHP_SELF); ?>" method="POST"> <table border="0"> <tr> <td> name <input size="26" name="name_in"><br> email <input size="28" name="email_in"><br> text <br><textarea name="text_in" rows="4" cols="65"></textarea><br> <input OnClick="envia();" type="button" name="submit_opina" value="opina"> </td> </tr> </table> </form> <?php if ("opina" == $submit_opina) { $sql = "INSERT INTO opinion SET " . "nombre = '$nombre_in', " . "email = '$email_in', " . "texto = '$texto_in', " . "fecha = CURDATE()"; mysql_query($sql); } ?>
<!-- select, show opinions and db conexion closing--> <?php $result = mysql_query("SELECT nombre, email, texto, fecha FROM opinion ORDER BY fecha DESC"); while ( $row = mysql_fetch_array($result) ) { $nombre_db = $row["nombre"];+ $email_db = $row["email"]; $texto_db = $row["texto"]; $fecha_db = $row["fecha"]; echo( "<table width='550' border='0' cellspacing='0' cellpadding='7'> <tr> <td><a href='mailto:$email_db' class='enlace'><b>$nombre_db</b></a></td> <td><span class='txt_p'>$fecha_db</span></td> </tr> <tr> <td colspan='2'><p align='justify'>$texto_db</p></td> </tr> </table> <br>"); } $dbdecnx = mysql_close ($dbcnx); ?> </body> </html>
attached mail follows:
Hi all,
I have installed PHP 4 pn Redhat 7.0 using an RPM: php-4.0.4pl1-3.i386.rpm
As well as making the apache stuff, it has installed a binary at /usr/bin/php, but the binary has been installed with --enable-force-cgi-redirect.
I want this binary but without this option... can somebody please give me some instructions on how to do this... I've looked around for RPMs that contain just /usr/bin/php and use --disable-for... but can't find any...
What would I have to do to install this by hand ???
Thanks in advance for any help... really appreciated !
James
php
j2w.co.uk
attached mail follows:
People!
I am getting nuts here about this thing i am working on right now. I am trying to get make a ldap php script that get information about a user.
I can connect to the ldap server and get response on how many entries that was found. But how do i print out something of use.
I mean. How do i get all the information from the entrie?
I mean i do a ldap search and get the answer from my script that 1 entrie was found. Now i want to print out that entry. his email first name, last name department
etc etc
But how do i do that? I am getting nuts. If you dont know it perhaps you know a GOOD "how to" that i can use? Please help me with this. Would be really usefull.
This script works and returns the amount of entries. Now i want to display the information.
echo "<h3>LDAP query test</h3>"; echo "Connecting ..."; $ds=ldap_connect("localhost"); // must be a valid LDAP server! echo "connect result is ".$ds."<p>";
if ($ds) { echo "Binding ..."; $r=ldap_bind($ds); // this is an "anonymous" bind, typically // read-only access echo "Bind result is ".$r."<p>";
echo "Searching for (sn=S*) ..."; // Search surname entry $sr=ldap_search($ds,"o=My Company, c=US", "sn=S*"); echo "Search result is ".$sr."<p>";
//Johan
attached mail follows:
Use ldap_get_entries. See here:
http://www.php.net/manual/en/function.ldap-get-entries.php
Check the bottom of your code, I put something in there.
On Tuesday 17 July 2001 07:27 am, Johan Vikerskog (ECS) wrote: > People! >>echo "<h3>LDAP query test</h3>"; > echo "Connecting ..."; > $ds=ldap_connect("localhost"); // must be a valid LDAP server! > echo "connect result is ".$ds."<p>"; > > if ($ds) { > echo "Binding ..."; > $r=ldap_bind($ds); // this is an "anonymous" bind, typically > // read-only access > echo "Bind result is ".$r."<p>"; > > echo "Searching for (sn=S*) ..."; > // Search surname entry > $sr=ldap_search($ds,"o=My Company, c=US", "sn=S*"); > echo "Search result is ".$sr."<p>";
$result = ldap_get_entries($ds, $sr); print_r($result); // Let's just see what's in there.
Hope that helps. Reuben D. Budiardja
> //Johan
attached mail follows:
hi, I was wondering if someone could help me with a small problem I'm having.
I'm running a script that periodically dumps information from one server to a database on another. We're running suse 7.1 and apache on the server containing the information, and the problem is I don't know how to make linux run the php script, or how to set up crobtab with the php script in mind. anyone have any ideas?
-petur
attached mail follows:
> hi, I was wondering if someone could help me with a small problem I'm > having. > > I'm running a script that periodically dumps information from one > server to > a database on another. We're running suse 7.1 and apache on the server > containing the information, and the problem is I don't know how to make > linux run the php script, or how to set up crobtab with the php script in > mind. anyone have any ideas?
You can use this Tutorial http://www.faqts.com/knowledge_base/view.phtml/aid/1005
I think it can help you :o)
Regards
Johan
attached mail follows:
> >We're running suse 7.1 and apache on the server > > containing the information, and the problem is I don't know how to make > > linux run the php script, or how to set up crobtab with the php > script in > > mind. anyone have any ideas? > > You can use this Tutorial > http://www.faqts.com/knowledge_base/view.phtml/aid/1005 > > I think it can help you :o)
If your problem was how to execute the script you can etc. use Lynx (or wget)... if you use lynx use follow
/path-to-lynx/lynx http://www.domain.com/scriptname.php -source
Regards
Johan
attached mail follows:
thanx for the help man, the script is running and I get to keep my job ,)
-petur
"Johan Holst
Nielsen" To: <php-general
lists.php.net>
<johan
1way2pr cc:
int.net> Subject: Re: [PHP] running php scripts
17.07.2001
13:17
> >We're running suse 7.1 and apache on the server > > containing the information, and the problem is I don't know how to make > > linux run the php script, or how to set up crobtab with the php > script in > > mind. anyone have any ideas? > > You can use this Tutorial > http://www.faqts.com/knowledge_base/view.phtml/aid/1005 > > I think it can help you :o)
If your problem was how to execute the script you can etc. use Lynx (or wget)... if you use lynx use follow
/path-to-lynx/lynx http://www.domain.com/scriptname.php -source
Regards
Johan
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribelists.php.net For additional commands, e-mail: php-general-help
lists.php.net To contact the list administrators, e-mail: php-list-admin
lists.php.net
attached mail follows:
"whereas to echo it you'd have to concatenate the string." false you don't have to concat strings with echo you can print vars the same way as print
regards
16/07/01 17:48:43, "Steve Brett" <steve.brett
e-mis.com> wrote:
>i seem to remember reading somewhere that print acts like (is) a function,
>presumably returning false if it cannot print to screen, whereas echo just
>dumps it.
>
>also you can drop vars in print like
>
>print "you have $points points";
>
>whereas to echo it you'd have to concatenate the string.
>
>Steve
>
>
>"Don Read" <dread
texas.net> wrote in message
>news:XFMail.010716104339.dread
texas.net...
>>
>> On 16-Jul-01 brother wrote:
>> > Why should I use printf instead of echo and vice versa?
>> >
>>
>> printf print-formated
>>
>> $a=12.3456;
>>
>> echo $a, '<BR>';
>> printf('%1.2f<BR>', $a);
>>
>> 12.3456<BR>
>> 12.34<BR>
>>
>> > As for today I use printf mostly but I don't know why.
>>
>> You prolly mean print; There may be some minor differences from echo,
>> but i've never seen 'em.
>> (i think they threw print in PHP to keep JAPHs happy).
>>
>> Regards,
>> --
>> Don Read dread
texas.net
>> -- It's always darkest before the dawn. So if you are going to
>> steal the neighbor's newspaper, that's the time to do it.
>
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
>For additional commands, e-mail: php-general-help
lists.php.net
>To contact the list administrators, e-mail: php-list-admin
lists.php.net
>
>
>
>
attached mail follows:
Steve Brett wrote: > > don't echo and printf do different jobs ? > > as i understand it echo will dump anything to screen, fprint will accept > formatted text args like "you owe me %d dollars",$owed_amount) or something > like that. > > i kind of use print by itself (harking back to the old days of basic etc) > but use echo quite a lot. only use printf when i have to put cash amounts in > and stuff like that. > > Steve
printf (""); echo ""; print ();
They do the same but why?
The question that drives us (nice quote!) is if we gain any speed to use one another or if it is too little to be measured.
/brother (now cced to the list too =))
attached mail follows:
> -----Original Message-----
> From: ChengWen_Yu [mailto:ChengWen_Yu
pchome.com.tw]
> Sent: Monday, July 16, 2001 10:54 PM
> To: php-general
lists.php.net
> Subject: [PHP] Problem about PHP
>
>
> I want to write a library for the PHP on Solaris. But I
> don't know how to do and where I should put this library
> than PHP could reach it.
That's going to depend on what you mean by a "library":
If you want to write some functions in PHP and make them available to other scripts, then it's just a matter of placing that file somewhere in your include_path and calling it into your other scripts with include(), require(), auto_prepend_file, etc. You can find some information in the manual on defining functions in PHP at http://php.net/manual/en/functions.php
If you want to actually extend the capabilities of PHP by adding new functions to the language, you'll want to start by reading README.EXT_SKEL in the directory where PHP is installed. That should, I think, give you most of the information you need to get started.
--- Mark Roedel (roedelmletu.edu) | "There cannot be a crisis next week. Systems Programmer / WebMaster | My schedule is already full." LeTourneau University | -- Henry Kissinger
attached mail follows:
ereg_replace("$opentag([^*]*)$closetag", $this->OPENTAG.$loopHandle.$this->CLOSETAG, $template);
how do I get al hold on the "\\1" part of the replacement. basicly I want to replace
opentag1 .........any content in between .............. closetag1
with
opentag2 onewordonly closetag2
but still need the
.........any content in between ..............
is this possible in some way ???
kind regards Jeroen Olthof
attached mail follows:
<? $s = 'somthing opentag1 .........any content in between .............. closetag1 somthing else'; $opentag = 'opentag1'; $closetag = 'closetag1'; $other_content = 'the other content'; $content = ereg_replace(".*$opentag", '', ereg_replace("$closetag.*", '', $s)); $new_str = ereg_replace("$opentag.*$closetag", "$opentag $other_content $closetag", $s); // $content = ' .........any content in between .............. '; // $new_str = 'somthing opentag1 the other content closetag1 somthing else' ?> $content = '<?=$content?>';<br> $new_str = '<?=$new_str?>'
> -----Original Message-----
> From: Jeroen Olthof [mailto:j.olthof
millipede.nl]
> Sent: 17 iulie 2001 17:38
> To: php-general
lists.php.net
> Subject: [PHP] regexp. king needed (is it possible ???)
>
>
> ereg_replace("$opentag([^*]*)$closetag",
> $this->OPENTAG.$loopHandle.$this->CLOSETAG, $template);
>
> how do I get al hold on the "\\1" part of the replacement.
> basicly I want to replace
>
> opentag1 .........any content in between .............. closetag1
>
> with
>
> opentag2 onewordonly closetag2
>
> but still need the
>
> .........any content in between ..............
>
> is this possible in some way ???
>
> kind regards
> Jeroen Olthof
>
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail:
> php-list-admin
lists.php.net
>
>
attached mail follows:
thanks my king :)
it works !!!
"Adrian Ciutureanu" <adrian.ciutureanu
softure.com> schreef in bericht
news:695649D3DC057E4DB74AAE8F9867D5D00583A5
fix02s.fix.ro...
<?
$s = 'somthing opentag1 .........any content in between
............. closetag1 somthing else';
$opentag = 'opentag1';
$closetag = 'closetag1';
$other_content = 'the other content';
$content = ereg_replace(".*$opentag", '',
ereg_replace("$closetag.*", '', $s));
$new_str = ereg_replace("$opentag.*$closetag", "$opentag
$other_content $closetag", $s);
// $content = ' .........any content in between .............. ';
// $new_str = 'somthing opentag1 the other content closetag1 somthing
else'
?>
$content = '<?=$content?>';<br>
$new_str = '<?=$new_str?>'
> -----Original Message-----
> From: Jeroen Olthof [mailto:j.olthof
millipede.nl]
> Sent: 17 iulie 2001 17:38
> To: php-general
lists.php.net
> Subject: [PHP] regexp. king needed (is it possible ???)
>
>
> ereg_replace("$opentag([^*]*)$closetag",
> $this->OPENTAG.$loopHandle.$this->CLOSETAG, $template);
>
> how do I get al hold on the "\\1" part of the replacement.
> basicly I want to replace
>
> opentag1 .........any content in between .............. closetag1
>
> with
>
> opentag2 onewordonly closetag2
>
> but still need the
>
> .........any content in between ..............
>
> is this possible in some way ???
>
> kind regards
> Jeroen Olthof
>
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail:
> php-list-admin
lists.php.net
>
>
attached mail follows:
hello all. i configured my php 4.0.5 with the following command on a REDHAT linux 7.0. #./configure --with-apache=../apache_1.3.20 --with-mysql --enable-trackvar --with-ftp.
Now i am trying to install/configure a NEWSLETTER php program and i have the following message :
Warning: mail() is not supported in this PHP build in /usr/local/htdocs/test/newsletter/phpmynewsletter/include/cls.php3 on line 141
I want to point out that in this SERVER i have the following programs: php 4.0.5 qmail vmailmgr courier-imap apache 1.3.20
and in another server i have the following programs and i have no error with the same commands when i installed it: php 4.0.2 sendmail cyrus-imap apache 1.3.17
Sincerely
_________________________________________________________________________ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
attached mail follows:
Hello, How do I get the filename or script name if I run it in php comamnd line? For example, if I run this
bash$ php test.php
I want to get something inside test.php that tells me the filename is test.php, but *without* the actual path.
Thanks Reuben D. Budiardja
attached mail follows:
$PHP_SELF returns the filename with the full path. from there, you can use split to split the string wherever a / occurs, then call count, to get the total number of values in the array, decrememnt the count by 1 (Arrays begin at 0) then, set a variable to store just the filename, like so:
$fullpath = split('/',$PHP_SELF); $c = count($fullpath); $c--; $filename = $fullpath[$c];
There may be a better way to do it, but this works for me, and it's only 4 lines. :)
JB
----- Original Message -----
From: "Reuben D Budiardja" <reubendb
goshen.edu>
To: <php-general
lists.php.net>
Sent: Tuesday, July 17, 2001 7:48 AM
Subject: [PHP] Get filename in php command line
Hello, How do I get the filename or script name if I run it in php comamnd line? For example, if I run this
bash$ php test.php
I want to get something inside test.php that tells me the filename is test.php, but *without* the actual path.
Thanks Reuben D. Budiardja
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribelists.php.net For additional commands, e-mail: php-general-help
lists.php.net To contact the list administrators, e-mail: php-list-admin
lists.php.net
attached mail follows:
Seems that $PHP_SELF is not defined when it's run from the command line.
Reuben D. Budiardja
On Tuesday 17 July 2001 10:29 am, Jason Bell wrote:
> $PHP_SELF returns the filename with the full path. from there, you can use
> split to split the string wherever a / occurs, then call count, to get the
> total number of values in the array, decrememnt the count by 1 (Arrays
> begin at 0) then, set a variable to store just the filename, like so:
>
> $fullpath = split('/',$PHP_SELF);
> $c = count($fullpath);
> $c--;
> $filename = $fullpath[$c];
>
> There may be a better way to do it, but this works for me, and it's only 4
> lines. :)
>
> JB
>
>
> ----- Original Message -----
> From: "Reuben D Budiardja" <reubendb
goshen.edu>
> To: <php-general
lists.php.net>
> Sent: Tuesday, July 17, 2001 7:48 AM
> Subject: [PHP] Get filename in php command line
>
>
>
> Hello,
> How do I get the filename or script name if I run it in php comamnd line?
> For
> example, if I run this
>
> bash$ php test.php
>
> I want to get something inside test.php that tells me the filename is
> test.php, but *without* the actual path.
>
> Thanks
> Reuben D. Budiardja
>
attached mail follows:
> Seems that $PHP_SELF is not defined when it's run from the > command line.
Try:
__FILE__
Chris
attached mail follows:
I had that before. OK, seems that my problem is not that simple. The thing is , I have something like this in my file test.php:
require('my_api.inc'); echo "This is test.php3";
Now, in my_api.inc, I want to know that I run test.php3, when I do bash$ php test.php3
and the filename is test.php3 . __FILE__ will give my my_api.inc instead. I need it because my_api.inc do all sort of authenticating, session, etc.
Any solutions? Thanks. Reuben D. Budiardja
On Tuesday 17 July 2001 10:52 am, Boget, Chris wrote: > > Seems that $PHP_SELF is not defined when it's run from the > > command line. > > Try: > > __FILE__ > > Chris
attached mail follows:
> I had that before. > OK, seems that my problem is not that simple. The thing is , > I have something > like this in my file test.php: > require('my_api.inc'); > echo "This is test.php3"; > Now, in my_api.inc, I want to know that I run test.php3, when I do > bash$ php test.php3 > and the filename is test.php3 . __FILE__ will give my my_api.inc > instead. I need it because my_api.inc do all sort of authenticating, > session, etc.
__FILE__ will give you the name of the file that uses that constant. So, based on the above, I believe that you are using __FILE__ only in my_api.inc (which is pretty much what you said, I'm just looking for verification).
What you can do instead is this:
in "my_api.inc", have the following code:
echo "Currently Running file is: "; echo ( $CurrentRunningFile ) ? $CurrentRunningFile : __FILE__;
in test.php
<? $CurrentRunningFile = __FILE__;
include( "my_api.inc" ); echo "This is test.php3<br>\n"; ?>
Define "$CurrentRunningFile" on line one of all your files. Or something along those lines...
Chris
attached mail follows:
On Tuesday 17 July 2001 11:14 am, Boget, Chris wrote: > in "my_api.inc", have the following code: > > echo "Currently Running file is: "; > echo ( $CurrentRunningFile ) ? $CurrentRunningFile : __FILE__; > > in test.php > > <? > $CurrentRunningFile = __FILE__; > > include( "my_api.inc" ); > echo "This is test.php3<br>\n"; > ?> > > Define "$CurrentRunningFile" on line one of all your files. Or > something along those lines... > > Chris
Well, I thought about that too. The thing is, this is part of the bigger project to make our apps can be run from command line, and we already have tons of apps that currently running from web. Doing that for every single apps would be a pain. But apparently since there is no other way, at least at this point, it will have do for some apps.
Thanks. Reuben D. Budiardja
attached mail follows:
In the ldap script below i get the results when i use the decide function at the bottom. Anyone have a tip on how i can change this so i can push the results into variables instead?
Thanks in advance
//Johan
<?php function printarray ($what, $display, $info, $i) { for ($j=0; $j < (count($info[$i]["$what"]) -1); $j++) { $show = ereg_replace("\\$", "<BR>", $info[$i]["$what"][$j]); echo "$display: " . $show . "<br>"; } } function decide ($what, $display, $info, $i) { if (gettype($info[$i]["$what"]) == "array") { printarray("$what", "$display", $info, $i); } else { echo "$display: ". $info[$i][