php-general Digest 4 Jan 2006 05:57:54 -0000 Issue 3886
Topics (messages 228124 through 228138):
Problems with session data.
228124 by: Duffy, Scott E
mysqli bind_param and store_result don't work well together
228125 by: anirudh dutt
admin variables in CGI version
228126 by: Tim Traver
Problems with sessions .. qualified/non-qualified domain names
228127 by: Kall, Bruce A.
Curl Question
228128 by: Ray Hauge
228129 by: Manuel Lemos
228132 by: Ray Hauge
date processing needed in form
228130 by: Sue
228131 by: Jim Moseby
228133 by: Manuel Lemos
228135 by: Jerry Kita
imagecopyresampled() is same quality of imagecopyresized()
228134 by: Christopher Mobarek
Re: PHP MySQL
228136 by: toylet
Some Help with AD
228137 by: Dean Ericson
Re: HAPPY NEW YEAR!!
228138 by: Lam Cheuk Hin
Administrivia:
To subscribe to the digest, e-mail:
[EMAIL PROTECTED]
To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]
To post to the list, e-mail:
php-general@lists.php.net
----------------------------------------------------------------------
--- Begin Message ---
I thought I was using session data and variables correctly, but I am
having some issues. I am using it to create a login but if I have
another user on a different machine my session data gets changed to who
last logged in. I had changed so it used https but changed it back and
it still seems to be doing the same. Is there something maybe I missed
in the php.ini file? Can it not be used this way? Do I have to uses
cookies?
Any help/suggestions would be appreciated.
Scott Duffy
--- End Message ---
--- Begin Message ---
hi
the subject is pretty much what the problem is.
if i use
$st1 = $sql->stmt_init(); // $sql is a mysqli obj/conn
$st1->prepare("select `num` from `activity` where `id` = ?");
$st1->bind_param('s', $myid);
$myid = '3f6d017d3e728b057bcc082a7db75a57'; // forcing value to check
$st1->execute();
$st1->store_result();
$st1->bind_result($rz);
$st1->fetch();
echo "rows: {$st1->num_rows}, ";
echo "num: $rz";
gives rows: 0, num: 0
but if i use this prepare instead (without the bind_param and value inserted)
$st1->prepare("select `num` from `activity` where `id` =
'3f6d017d3e728b057bcc082a7db75a57'");
i get rows: 1, num: 7 (the correct result)
if i use $st1 = $sql->prepare... instead of stmt_init(), the results
are identical. is this a bug with bind_param or is it supposed to this
way?
also, if i use an sql var in the prepare/bind case as
$st1->prepare("select @ck_num:=`num` from `activity` where `id` = ?");
var_dump($rz) is NULL; otherwise it's int(7)
any ideas?
anirudh
--
]#
Anirudh Dutt
...pilot of the storm who leaves no trace
like thoughts inside a dream
--- End Message ---
--- Begin Message ---
Hi all,
ok, when using the CGI binary for PHP execution, is there a way to send
it environment variables to set the admin values like you can in mod_php ???
For instance, when using the apache module, you might do something like
this :
php_admin_value session.save_path /some/path
I know that you can have it loaded in a local php.ini file within the
directory of the executed script, but I don't want to have to put a
php.ini file if I am setting values on the fly...
I tried setting the environment variable, and it shows up in php_info as
an env variable, but how can I get it to actually be set ???
Anyone ???
Thanks,
Tim.
--- End Message ---
--- Begin Message ---
I have diagnosed a problem with sessions I am having. I'm don't believe
it's necessarily a PHP problem, but I thought someone must have seen
this before.
The first thing I do is a
session_start()
and then determine if (using session variables) whether the user has
logged in successfully using a password and their session has not timed
out (to some value I keep track of, not the php.ini variables). Anyway,
if I come in to my site using a fully qualified domain name such as
http://mysubsite.mycompany.com/index.php
and start a session and then have the user log in, I then pass them
along to:
http://mysubsite/index.php
internal to my organization (using the non-qualified domain name). But
this starts a different session than the one they came in as, so this
user now has two different sessions, the one that determined they needed
to log in on (using the fully qualified domain name) and the second
session that was started after they logged in (using the non-qualified
name).
I see this problem when you set your default browser 'home' page to be
http://mysubsite.mycompany.com/index.php
and attempt to use that. Every time you click on that (after you've
logged in initially and haven't timed out) you go immediately to a login
window since that session is still around and was never logged in.
If my default browser home page is:
http://mysubsite/index.php
you then get into the session that was started after you log in.
The reason I think this issue must have come up for someone before is
that almost all of my users should be able to use
http://mysubsite/index.php
BUT if you're coming in (from home for example), you need to come in as
http://mysubsite.mycompany.com/index.php for it to find my site.
Is there some way for a session to be registered to both?
mysubsite.mycompany.com (using the fully qualified domain name)
AND
mysubsite (using the non-fully qualified domain name)
Thanks,
Bruce
--- End Message ---
--- Begin Message ---
Hello everyone,
I just wanted to see if anyone knew if there was any difference in
performance between using curl in an exec() statement and when using the
libCurl functions within PHP.
Thanks,
Ray
--- End Message ---
--- Begin Message ---
Hello,
on 01/03/2006 06:52 PM Ray Hauge said the following:
I just wanted to see if anyone knew if there was any difference in
performance between using curl in an exec() statement and when using the
libCurl functions within PHP.
Executing a separate program should be a little slower as it adds some
overhead before executing a request. Actually, in some cases it can be a
little faster to use fsockopen instead of libcurl as it is one less
library to load.
You may also want to take a look at this HTTP client class that uses
fsockopen everytime it is possible and only uses libcurl functions in
certain cases. This class takes care of cookie handling, redirection,
form posting, file uploading, etc..
http://www.phpclasses.org/httpclient
--
Regards,
Manuel Lemos
Metastorage - Data object relational mapping layer generator
http://www.metastorage.net/
PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/
--- End Message ---
--- Begin Message ---
Thanks for the info!
Manuel Lemos wrote:
Hello,
on 01/03/2006 06:52 PM Ray Hauge said the following:
I just wanted to see if anyone knew if there was any difference in
performance between using curl in an exec() statement and when using
the libCurl functions within PHP.
Executing a separate program should be a little slower as it adds some
overhead before executing a request. Actually, in some cases it can be
a little faster to use fsockopen instead of libcurl as it is one less
library to load.
You may also want to take a look at this HTTP client class that uses
fsockopen everytime it is possible and only uses libcurl functions in
certain cases. This class takes care of cookie handling, redirection,
form posting, file uploading, etc..
http://www.phpclasses.org/httpclient
--- End Message ---
--- Begin Message ---
Hello -
I need to create a form that allows the user to select a Month, Day and
Year. I am also new to PHP and am wondering if there is a way for me to
display the contents of the Select list box (for the Day) based on the Month
that is selected (and Year), so that the valid number of days for the month
(& year?) displays. For all of our other forms, we use CGI to handle our
standard forms validation, and was hoping to handle more complex validation
within PHP prior to sending the entire contents of my form to our standard
CGI validation routine. I know that I could use the Checkdate function once
the entire date is selected, but thought there might be an easier/more
efficient way of handling this and also not sure how to reference Checkdate
prior to Submitting my form to the CGI routine. I also was not sure if this
was something that is handled easier using Javascript? Any help/examples,
etc. would be greatly appreciated!
Thanks!!
Sue
--- End Message ---
--- Begin Message ---
> I need to create a form that allows the user to select a
> Month, Day and
> Year. I am also new to PHP and am wondering if there is a
> way for me to
> display the contents of the Select list box (for the Day)
> based on the Month
> that is selected (and Year), so that the valid number of days
> for the month
> (& year?) displays.
Since PHP is server-side, a more elegant solution could be achieved using
javascript. In order to do this with PHP, your script would have to make
the trip back to the server after the month was entered to calculate the
valid day.
JM
--- End Message ---
--- Begin Message ---
Hello,
on 01/03/2006 06:41 PM Sue said the following:
I need to create a form that allows the user to select a Month, Day and
Year. I am also new to PHP and am wondering if there is a way for me to
display the contents of the Select list box (for the Day) based on the Month
that is selected (and Year), so that the valid number of days for the month
(& year?) displays. For all of our other forms, we use CGI to handle our
standard forms validation, and was hoping to handle more complex validation
within PHP prior to sending the entire contents of my form to our standard
CGI validation routine. I know that I could use the Checkdate function once
the entire date is selected, but thought there might be an easier/more
efficient way of handling this and also not sure how to reference Checkdate
prior to Submitting my form to the CGI routine. I also was not sure if this
was something that is handled easier using Javascript? Any help/examples,
etc. would be greatly appreciated!
You may want to try this forms generation and validation class. It comes
with a calendar date plug-in that does exactly what you want.
It lets you choose a date using several text or select fields and it can
validate the date that you choose using special Javascript code
generated by the plug-in. If you want, it can also restrict the range
of accepted dates, like since a given date or no later than another date.
The plug-in class validates either on the client side with Javascript or
server side with PHP. You do not need to know any Javascript to use this.
http://www.phpclasses.org/formgeneration
Here is a screen shot:
http://www.phpclasses.org/browse/file/8245.html
Here is an example page:
http://www.phpclasses.org/browse/view/html/file/6799/name/test_date_input_page.html
--
Regards,
Manuel Lemos
Metastorage - Data object relational mapping layer generator
http://www.metastorage.net/
PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/
--- End Message ---
--- Begin Message ---
Sue wrote:
Hello -
I need to create a form that allows the user to select a Month, Day and
Year. I am also new to PHP and am wondering if there is a way for me to
display the contents of the Select list box (for the Day) based on the Month
that is selected (and Year), so that the valid number of days for the month
(& year?) displays. For all of our other forms, we use CGI to handle our
standard forms validation, and was hoping to handle more complex validation
within PHP prior to sending the entire contents of my form to our standard
CGI validation routine. I know that I could use the Checkdate function once
the entire date is selected, but thought there might be an easier/more
efficient way of handling this and also not sure how to reference Checkdate
prior to Submitting my form to the CGI routine. I also was not sure if this
was something that is handled easier using Javascript? Any help/examples,
etc. would be greatly appreciated!
Thanks!!
Sue
For what it's worth I use JavaScript for validation prior to the form
being submitted. It's faster and doesn't use any network resources. If
you do validity checking at the browser using JavaScript ... then when
the form is submitted I'd let it go straight through to your standard
forms validation program ... I wouldn't even involve PHP.
--
Jerry Kita
http://www.salkehatchiehuntersville.com
email: [EMAIL PROTECTED]
--- End Message ---
--- Begin Message ---
Everyone is saying that imagecopyresampled() greatly improves resizing quality
due to resampling. However, I noticed that my thumbnails were very jagged and
pixelated, not smooth as thumbnails should be. Even the slightly smaller images
had a lot of jagged edges.
The $src image is a resource of an imagecreatefromjpeg() while $dst is a
resource of an imagecreatetruecolor(). Then I just imagecopyresampled() the
$src to $dst.
I don't think I'm doing anything wrong.
Your thoughts?
Thanks.
--
Christopher Mobarek
--- End Message ---
--- Begin Message ---
Here's one thought ..... ascii (97) is the letter "a" .... is it
possible that the ascii (65) "A" was interpreted as lowercase thus
creating a duplicate primary key? Or your DBMS doesn't make a
distinction between upper or lower case.
You are correct. I compiled mysql and php from source tar-ball. I dind'
tknow that the default character set and collate are case-insensitive.
It's fixed after I set the character set to
latin1" and collate to "latin1_bin" in /etc/my.cnf.
--
.~. Might, Courage, Vision. SINCERITY. http://www.linux-sxs.org
/ v \
/( _ )\ (Fedora Core 4) Linux 2.6.14-1.1653_FC4
^ ^ 10:03:01 up 16 days 1:00 load average: 0.00 0.00 0.00
--- End Message ---
--- Begin Message ---
I have been trying with AD to traverse a tree... such as:
A - Company distribution list
\
B - Business Operations distribution list
/ \
C D - IT Operations distribution list
\
E - Visual Studio's distribution list
If I am in distribution list E and B is granted some sort of rights within
my application ( To view a certain document or module ), how can I, using
LDAP_search, traverse that tree and realize that E is a member of B and
therefore I should be given the rights as well. Not only is E a member, but
so is C and D and they should have the same grants as well.
[EMAIL PROTECTED]
--- End Message ---
--- Begin Message ---
Happy New Year to all...
ChineseT: 新年快樂 ^.^
--
lch2003 ~ Lam Cheuk Hin
--- End Message ---