|
Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com |
php-general Digest 8 Oct 2005 21:21:15 -0000 Issue 3726
php-general-digest-help
lists.php.net
Date: Sat Oct 08 2005 - 16:21:15 CDT
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
php-general Digest 8 Oct 2005 21:21:15 -0000 Issue 3726
Topics (messages 223759 through 223776):
Re: Global unavailable?
223759 by: Oliver Grätz
Re: Non-Javascript PHP Onsubmit function?
223760 by: Oliver Grätz
223763 by: Jasper Bryant-Greene
223775 by: Oliver Grätz
Re: Dynamic sub directory listing without redirect
223761 by: Oliver Grätz
223762 by: Greg Donald
223764 by: Philip Hallstrom
223766 by: Jim Moseby
$B"##P#C%=%U%H0BCMHNGd"#6H3&=i%7%9%F%`(B
223765 by: ybpqwiyosg1
Re: Linux/PHP and Windows/MSSQL
223767 by: Frank M. Kromann
Re: How do I POST data with headers & make the browser follow?
223768 by: Ragnar
223769 by: Ragnar
mysqli's equivalence to mysql_result
223770 by: The Gimper
ICQ
223771 by: Al Hafoudh
223772 by: Torgny Bjers
223774 by: Niels Ganser
Does flock over nfs work with linux kernel > 2.6.12 ?
223773 by: kyle
per user php.ini
223776 by: James Benson
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:
Problem not reproducable. Test case used:
-------------------------------
a.inc.php:
<?php
$a = 123;
-------------------------------
b.inc.php:
<?php
require 'a.inc.php';
class b {
function test() {
global $a;
echo $a;
}
}
-------------------------------
t.php:
<?php
require 'b.inc.php';
$x=new b();
$x->test();
-------------------------------
Command line: php t.php
Output: 123
I used PHP-5.1 RC1. No problem whatsoever. Such problems shouldn't arise
in new versions since they are touching very basic concepts that didn't
change.
AllOLLi
____________
"You see, Mr. President: The worlds hates America. And for good reason.
(I wont bother going into details)"
[24 319]
attached mail follows:
zzapper schrieb:
> Hi,
> I'd like to have a non-Javascript based general purpose "Are you quite Sure?" PHP form submitter,
> conventionally done using the Javascript Onsubmit Event.
>
> One way would be to store all the Form Variables in hidden fields generated by a foreach $_POST
> but anyone have anything simpler?
How about the user saying "no"? You would have to return to the form
page and repopulate the form with the data. So not storing the data in a
usable format is not an option.
Here's a dirty hack:
How about displaying the same form in a hidden DIV?
OK, that one was cruel...
A better one:
You could fetch the RAW post data and store it in the session.
Problems arise when there's more than one window open!
Use a unique ID for the form.
Best solution: Use the hidden fields!
AllOLLi
____________
Sidney: "Are you sure you don't wanna stay for dinner."
Eric: "I'd love to but... I gotta save the world."
[Alias 402]
attached mail follows:
Oliver Grätz wrote:
> zzapper schrieb:
>
>>Hi,
>>I'd like to have a non-Javascript based general purpose "Are you quite Sure?" PHP form submitter,
>>conventionally done using the Javascript Onsubmit Event.
>>
>>One way would be to store all the Form Variables in hidden fields generated by a foreach $_POST
>>but anyone have anything simpler?
>
>
> How about the user saying "no"? You would have to return to the form
> page and repopulate the form with the data. So not storing the data in a
> usable format is not an option.
>
> Here's a dirty hack:
> How about displaying the same form in a hidden DIV?
> OK, that one was cruel...
>
> A better one:
> You could fetch the RAW post data and store it in the session.
> Problems arise when there's more than one window open!
> Use a unique ID for the form.
>
> Best solution: Use the hidden fields!
I disagree. Best solution: Don't use a confirmation thing, provide the
ability to undo changes instead. That way you don't piss off the
advanced users who KNOW what they're doing, but you still allow the less
advanced users to undo changes they "accidentally" make.
--
Jasper Bryant-Greene
Freelance web developer
http://jasper.bryant-greene.name/
attached mail follows:
Jasper Bryant-Greene schrieb:
> I disagree. Best solution: Don't use a confirmation thing, provide the
> ability to undo changes instead. That way you don't piss off the
> advanced users who KNOW what they're doing, but you still allow the less
> advanced users to undo changes they "accidentally" make.
Oh, changing the concept was on the menu? Me too,please ;-)
OLLi
attached mail follows:
http://httpd.apache.org/docs/2.0/misc/rewriteguide.html
AllOLLi
attached mail follows:
On 10/7/05, Terence <terence
sunway.edu.my> wrote:
> Hi List,
>
> I am trying to allow dynamic URL's for my users to remember similiar to:
>
> www.mysite.com/joesoap
>
> So I want to use "joesoap" in a PHP script to pick up the user's details
> from a MySQL database. If the "joesoap" does not exist in the table
> I will handle that.
>
> So basically I have one file www.mysite.com/index.php which should do
> all the processing.
>
> I have tried with the apache .htaccess mod_rewrite, however when I echo
> $_SERVER['PHP_SELF'] I can't detect the "joesoap". It returns /index.php.
>
> Of course the easiest way is to do something like
> www.mysite.com/index.php?username=joesoap
> but that is too long and complicated for our users. As we have thousands
> of users, I don't want to create actual directories.
>
> Furthermore can this be done too (without a joesoap file):
> www.mysite.com/joesoap?show_extra_details=yes
>
> Any advice/links would be much appreciated. If I am barking up the wrong
> tree throw me a bone please.
mod_rewrite can handle this easy enough:
RewriteEngine on
RewriteRule ^([a-z].*) /index.php?username=$1 [L,qsappend]
RewriteRule ^$ /index.php [L,qsappend]
$_GET[ 'username' ] will be available in your index.php when you pass
a url like:
www.mysite.com/joesoap
This can be expanded for more variables/matches by adding more
matching groups to the regex. ^([a-z].*)/([a-z].*) and so forth.
--
Greg Donald
Zend Certified Engineer
MySQL Core Certification
http://destiney.com/
attached mail follows:
> Hi List,
>
> I am trying to allow dynamic URL's for my users to remember similiar to:
>
> www.mysite.com/joesoap
>
> So I want to use "joesoap" in a PHP script to pick up the user's details from
> a MySQL database. If the "joesoap" does not exist in the table
> I will handle that.
>
> So basically I have one file www.mysite.com/index.php which should do all the
> processing.
>
> I have tried with the apache .htaccess mod_rewrite, however when I echo
> $_SERVER['PHP_SELF'] I can't detect the "joesoap". It returns /index.php.
>
> Of course the easiest way is to do something like
> www.mysite.com/index.php?username=joesoap
> but that is too long and complicated for our users. As we have thousands of
> users, I don't want to create actual directories.
>
> Furthermore can this be done too (without a joesoap file):
> www.mysite.com/joesoap?show_extra_details=yes
>
> Any advice/links would be much appreciated. If I am barking up the wrong tree
> throw me a bone please.
If you are using apache, add this to your VirtualHost section for
www.mysite.com:
ForceType application/x-httpd-php
Action application/x-httpd-php /script-to-handle-every-request.php
Then in your document root, put a file named
script-to-handle-every-request.php and do whatever you want.
You'll probably want to start by looking at $_SERVER[PATH_INFO] and go
from there.
I do this to make urls easier to remember for our sales guys so they don't
have to remember that www.mysite.com:8001 is their sales demo site.
Instead they can remember salesdemo.mysite.com/philip and it redirects
them.
good luck!
-philip
attached mail follows:
> -----Original Message-----
> From: Terence [mailto:terence
sunway.edu.my]
> Sent: Friday, October 07, 2005 11:19 PM
> To: php-general
lists.php.net
> Subject: [PHP] Dynamic sub directory listing without redirect
>
>
> Hi List,
>
> I am trying to allow dynamic URL's for my users to remember
> similiar to:
>
> www.mysite.com/joesoap
>
> So I want to use "joesoap" in a PHP script to pick up the
> user's details
> from a MySQL database. If the "joesoap" does not exist in the table
> I will handle that.
>
> So basically I have one file www.mysite.com/index.php which should do
> all the processing.
>
> I have tried with the apache .htaccess mod_rewrite, however
> when I echo
> $_SERVER['PHP_SELF'] I can't detect the "joesoap". It returns
> /index.php.
>
> Of course the easiest way is to do something like
> www.mysite.com/index.php?username=joesoap
> but that is too long and complicated for our users. As we
> have thousands
> of users, I don't want to create actual directories.
>
> Furthermore can this be done too (without a joesoap file):
> www.mysite.com/joesoap?show_extra_details=yes
>
> Any advice/links would be much appreciated. If I am barking
> up the wrong
> tree throw me a bone please.
>
> Thanks alot
> Terence
Hi Terence,
I would handle this in a custom 404 error script. Essentially, just have
the 404 page parse out the "joesoap", check the database to see if its
valid, and act accordingly.
JM
attached mail follows:
$B#P#C%f!<%6!<$K$*F
$J>pJs$r0lJ}E*$KG[?.$5$;$F$$$?$
$-$^$7$?$3$H$*OM$S$$$?$7$^$9(B
$B$3$N%a!<%k$OAw?.
lMQ%a!<%k%"%I%l%9$+$iG[?.$5$l$F$$$^$9!#$4JV?.$$$?$
$$$F$b$*Ez$($G$-$^$;$s$N$G$4N;>5$/$
$5$$!#(B
$B$4<ALdEy$N$"$kJ}$O(Bhttp://www.11279.com/$B$N$*Ld$$9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.Dd;_!A!A!A!A!A!A!A!A!A!A!A!A!A!A!A!A!A!A!A!A!A!A!A(B
samurai_madoguti_samurai$B!{(Byahoo.co.jp
$B!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!JCm!K!{$r!w$K$7$FAw?.$7$F$/$
$5$$!#(B
$B!A!A!A!A!A!A!A!A!A!A!A!A!A!A!A!A!A!A!A!A!A!A!A!A!A!A!A!A!A!A(B
$B$3$N%a!<%k$OAw?.
lMQ%a!<%k%"%I%l%9$+$iG[?.$5$l$F$$$^$9!#$4JV?.$$$?$
$$$F$b$*Ez$($G$-$^$;$s$N$G$4N;>5$/$
$5$$!#(B
$B$4<ALdEy$N$"$kJ}$O(Bhttp://www.11279.com/$B$N$*Ld$$9g$o$;$+$i$4O"Mm$/$
$5$$!#(B
$B!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!%$%s%?!<%M%C%H#V#LHG
lLgE9!!%=%U%H;x(B
attached mail follows:
> On Thu, October 6, 2005 8:29 pm, Rick Emery wrote:
> > Knowing that I'm not the only one to want to connect to Microsoft SQL
> > Server on Windows from PHP and Apache on Linux, I'm seeking advice.
>
> You may want to consider using the Sybase drivers if they are
> available as up-to-date RPMs.
>
> Last time I checked, several years ago, they worked better/faster than
> the mssql drivers.
>
The Sybase extension can be linked agains the commercial Sybase libs or
the same FreeTDS lib used for the mssql extension, so there is not a big
difference there. The mssql extension implements about twice as many
functions as the sybase extension.
- Frank
attached mail follows:
Hi Richard,
just to stop and everyone from getting a heart attack right this instant
what I am doing with cURL and the multiple pages attempt is not much
more scary than any other "person leaves credit card info on form"
script you come across.
The server that I am re-sending the data to is our own and I know what
i am sending and where, so it's not like I am toying around sending peoples
creditcard info to some dodgy location.
So what's happening is nothing other than peoples data being re-sent
by the server that belongs to us to a know and trusted source.
Since the data comes in via the checkout form already it is not any "less"
secure than usual.
The main issue for me was that I did not want to store the credit card
details for the second step of the processing.
Anyway, to stop me lamenting and clear this up I am not passing credit card
info around any places that are not verified or trustworthy and was merely
looking for a way to pass this information along without having to store
them on my end before the go across to the payment gateway.
I'll have another look at what I could do differently in this case.
Usually I wouldn't to deal with an issue like this as payment information
would go straight to the payment gateway (handled there, processed there,
stored there) but in this case there was an inbetween step, which I didn't
know how to solve.
Thanks for the input.
> --- Ursprüngliche Nachricht ---
> Von: "Richard Lynch" <ceo
l-i-e.com>
> An: "Ragnar" <Ragnar_7
gmx.de>
> Kopie: php-general
lists.php.net
> Betreff: Re: [PHP] How do I POST data with headers & make the browser
> follow?
> Datum: Fri, 7 Oct 2005 15:56:09 -0500 (CDT)
>
> On Thu, October 6, 2005 4:52 am, Ragnar wrote:
> Everything you are trying to do with the cURL, multiple pages, and
> whatnot scares the bejesus out of me...
>
> Especially that you seem to be passing people's credit card numbers
> around in this manner. [shudder]
--
NEU: Telefon-Flatrate fürs dt. Festnetz! GMX Phone_Flat: 9,99 Euro/Mon.*
Für DSL-Nutzer. Ohne Providerwechsel! http://www.gmx.net/de/go/telefonie
attached mail follows:
Hi Mark,
basically what I am working on is integrating a step inbetween the checkout
and the payment gateway processing.
The cardholder information is checked for enrolment in the first step, if
the cardholder is enrolled he will need to authenticate himself by password
(this is where the 2nd page comes in) if the authentication is successfull
he is forwarded to the 3rd page where the payment gateway processing takes
place.
It's like any other online payment integration i have done before but this
time there is this extra step required due to Visa's and Mastercards new
security feature.
I didn't see an issue with passing this information along since it's already
used in the verification of the cardholder which also requires
the card number.
I do require the payment info again on page 3 to pass it along to the
payment gateway, but didn't want to store it on my end for that.
What I gather from Richards answer earlier that the difference between
$_POST, $_GET or $_COOKIE, $_SESSION is almost irrelevant, I might
as well store the detail in a session to be able to use them on page
3 it seems.
> Is this what happens:
>
> 1. User enters payment data
> 2. XML check that payment data is OK
> 3. redirection to a page (on another site?), where for some reason the
> payment data is required again (why?).
>
> This sounds like a mixture of two ways of implementing online payments.
> Forgive me if I'm telling you what you already know, but in general I
> believe things work as follows:
>
> 1 The whole process from payment to verification takes place on the
> payment
> provider's server
> or
> 2. the whole thing takes place on your server, with some inline (XML in
> this case) communication with your payment provider to verify the card
> details.
>
> You seem to be doing a bit of both, or have I misunderstood?
> Why do you need the payment details on the third page? If you don't
> actually
> need them, then the security problem goes away, and you can use the
> session
> object or whatever to persist the customer data.
> Does this help?
--
NEU: Telefon-Flatrate fürs dt. Festnetz! GMX Phone_Flat: 9,99 Euro/Mon.*
Für DSL-Nutzer. Ohne Providerwechsel! http://www.gmx.net/de/go/telefonie
attached mail follows:
Hello if i just want to recive ONE result from mysql i used to use:
echo mysql_result($result, 0);
Are there any equivalence to this in mysqli? Or what should i use to only
recive ONE result, for example when i query with LIMIT 1.
-------------------------------------------------
FREE E-MAIL IN 1 MINUTE!
- your.name
pc.nu - http://www.pc.nu
attached mail follows:
is it possible to connect to icq, send messages and etc? thanx
attached mail follows:
Al Hafoudh wrote:
> is it possible to connect to icq, send messages and etc? thanx
It should be possible, since PHP has full socket support. I googled a
bit and then checked the PHP Resource Index, and found the following:
http://php.resourceindex.com/Complete_Scripts/Instant_Messaging/ which
doesn't give us the information we're looking for, so I'd suggest taking
a look at the Perl libraries for ICQ/AIM and other IM clients that you
can probably adapt to PHP without too much work. Check www.cpan.org for
this.
Regards,
Torgny
attached mail follows:
> so I'd suggest taking a look at the Perl libraries for ICQ/AIM and
> other IM clients that you can probably adapt to PHP without too much
> work. Check www.cpan.org for this.
Or "sniff" the traffic of a "normal" ICQ client and learn the protocol
that way. Alternatively you could search for a library, I'm quite sure
there are some out there. Try "liboscar", "libicq" or "libaim"..
attached mail follows:
Hi,
from php function manual. I found:
flock() will not work on NFS and many other networked file systems. Check
your operating system documentation for more details.
And from http://nfs.sourceforge.net/#section_d:
flock()/BSD locks act only locally on Linux NFS clients prior to 2.6.12. Use
fcntl()/POSIX locks to ensure that file locks are visible to other clients.
........
The NFS client in 2.6.12 provides support for flock()/BSD locks on NFS files
by emulating the BSD-style locks in terms of POSIX byte range locks. Other
NFS clients that use the same emulation mechanism, or that use fcntl()/POSIX
locks, will then see the same locks that the Linux NFS client sees.
So, does it means that flock over nfs with several clients should work if
the nfs clients are all using kernel > 2.6.12?
Thanks,
Kyle
attached mail follows:
Hey everyone, probably missed the bit in the manual but my current
webhost allows uploading of my own php.ini to my home dir, my question
is how to do this?
My guess would be to set the ./configure line to something like
--with-config-file-path=/home/*/public_html
but I dont wanna re-compile if im wrong, can anyone tell me?
Using apache-1.3.33, php-4.4.0
Many thanks,
James Benson.
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]