php-general Digest 30 Dec 2005 09:00:40 -0000 Issue 3878
Topics (messages 227975 through 227997):
Re: php / mysql / js search result question
227975 by: Greg Schnippel
PHPMailer inserting unwanted spaces
227976 by: René Fournier
Re: unable to load perl extension
227977 by: dev lamp
Re: mysqli class not found
227978 by: Erik Saline
227980 by: PHP Superman
227981 by: John Nichel
227984 by: John Nichel
Re: Earlier versions hurt PHP 5
227979 by: Rory Browne
Re: Variables and Strings
227982 by: PHP Superman
227988 by: Jay Blanchard
227990 by: Jim Moseby
php / JS / DOM question
227983 by: jonathan
227985 by: Dan Uyemura
227986 by: Al
227987 by: Kirk.Johnson.zootweb.com
227989 by: jonathan
227994 by: M. Sokolewicz
web app in my portflio
227991 by: Scott DeMers
227992 by: Philip Hallstrom
Strange Right-Shift Problem
227993 by: Michael Gross
Re: what is the problem with this query?
227995 by: Graham Cossey
227996 by: Michael Gross
Solaris 10 libnetsnmp build failure
227997 by: Dean
Administrivia:
To subscribe to the digest, e-mail:
[EMAIL PROTECTED]
To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]
To post to the list, e-mail:
[email protected]
----------------------------------------------------------------------
--- Begin Message ---
Hi -
It sounds like you're trying to implement something similar to "google
suggest" which uses ajax to allow a user to navigate through a large
list of entries. The "google suggest" method does use a lot of calls
to the database but its asynchronous which eliminates cumbersome page
loads.
http://www.google.com/webhp?complete=1&hl=en
I found this article which gives advice on how to implement "google
suggest" using php:
http://www.phpriot.com/d/articles/php/application-design/google-suggest-ajaxac/
A quick google search on +php +"google suggest" +ajax came up with
others as well.
If you're just interested in the javascript (i.e. you're not
navigating that large of a list) these articles should be able to help
with that as well.
- schnippy
On 12/27/05, Dave Carrera <[EMAIL PROTECTED]> wrote:
> Hi List,
>
> I have a very long list of customer names which i know is easy to get
> from a mysql result using php, no prob there.
>
> But what i would like to do is offer input box and when the user enters
> a letter, i think this will require client side onchange(), the full
> list, i think might be in an iframe, will move to the first instance of
> user input.
>
> Example:
>
> 1 Alpha Customer
> 2 Apple Customer
> 3 Beta Customer
> 4 Crazy customer
> 5 Doppy customer
>
> User input is "a" so the list moves to first instance of "a". User
> continues to input "ap" so the list moves to "2 Apple Customer" and so on.
>
> If the user had input "d" then the list would move to "5 Doppy customer"
> and i suppose this could become selected ready for the user to hit the
> return key to select this customer.
>
> I would prefer to not do multiple "POSTS" and return result, which i can
> do already, so i think some natty client side JS might do the trick but
> i have very little knowledge of this.
>
> Any urls or direct help / advise is gratefully received.
>
> Thank you in advance
>
> Dave c
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--- End Message ---
--- Begin Message ---
Has anyone encountered this? I am composing an HTML email with
PHPMailer, and for some reason PHPMailer is inserted spaces
periodically, which breaks the formatting. I've looked through the
docs, but can only find a setting for Word Wrap (which is set to 0).
...Rene
--- End Message ---
--- Begin Message ---
On 12/29/05, Jochem Maas <[EMAIL PROTECTED]> wrote:
> dev lamp wrote:
> > Hi
> >
> > I am unable to call perl code from PHP, since the extension does not
> > get loaded !
> >
> > Scenario 1:
> > use dl('perl.so'); in the php code and invoke the script from the command
> > line
> > The script works fine and the perl code gets executed as well.
>
> so the extension is not being loaded automatically right?
> but if you dl() it everything is fine, right?
> then double check the 'right' ini file is being used!
>
There is only one php.ini
I have checked the extensions path information using phpinfo().
Is there something else that I need to checkout ?
> >
>
> is the apache module using the php.ini that you think it is ?? -
> that kind of thing has caught me out more than once!
>
> >
How do I check that ?
I downloaded apache sources and compiled it.
Why do I need to specify the path of the php.ini file to the apache web server ?
Dev.
--- End Message ---
--- Begin Message ---
Thanks I deleted the new.
I was following an example in the book for that.
Now I get the error:
Call to undefined function mysqli_connect() in
/var/www/cgi-bin/db_connect.php on line 4,
I added extenstion=mysqli.so to my php.ini
Erik
----- Original Message -----
From: "PHP Superman" <[EMAIL PROTECTED]>
To: "Erik Saline" <[EMAIL PROTECTED]>
Cc: <[email protected]>
Sent: Wednesday, December 28, 2005 6:56 PM
Subject: Re: [PHP] mysqli class not found
you are not missing anything, you are actually adding to much. Using "new"
is for making objects, if you take away the "new" in the $result variable
declaration it should work fine.
On 12/28/05, Erik Saline <[EMAIL PROTECTED]> wrote:
----- Original Message -----
From: Erik Saline
To: [email protected]
Sent: Wednesday, December 28, 2005 1:08 PM
I installed Apache, PHP, and Mysql during the Fedora Core 4 installation.
PHP 5.0.4
MYSQL 4.1.14
I used php -i to show that mysql and mysqli were installed.
Configure Command => './configure' '--build=i386-redhat-linux'
'--with-mysql=shared,/usr' '--with-mysqli=shared,/usr/bin/mysql_config' '
Here is the code.
$result = new mysqli_connect('localhost', 'nobody', 'test', 'godisdead');
Here is the error.
PHP Fatal error: Class 'mysqli' not found in
/var/www/cgi-bin/db_connect.php on line 4,
What am I missing?
Erik
--
Hi Everyone, I am running PHP 5 on Windosws XP SP2 with MySQL5, Bye Now!
--- End Message ---
--- Begin Message ---
What OS are you using? I think that you entered the wrong filename. for
windows i use php_mysqli.dll . Somewhere in php.ini there is a list of
extensions you can use, uncomment the php_mysqli.dll , copy php_mysqli.dll
to the php install directory and change the php.ini extension setting to
your php install directory, that should fix the problem .
On 12/29/05, Erik Saline <[EMAIL PROTECTED]> wrote:
>
> Thanks I deleted the new.
> I was following an example in the book for that.
>
> Now I get the error:
>
> Call to undefined function mysqli_connect() in
> /var/www/cgi-bin/db_connect.php on line 4,
>
> I added extenstion=mysqli.so to my php.ini
>
> Erik
>
> ----- Original Message -----
> From: "PHP Superman" <[EMAIL PROTECTED]>
> To: "Erik Saline" <[EMAIL PROTECTED]>
> Cc: <[email protected]>
> Sent: Wednesday, December 28, 2005 6:56 PM
> Subject: Re: [PHP] mysqli class not found
>
>
> you are not missing anything, you are actually adding to much. Using "new"
> is for making objects, if you take away the "new" in the $result variable
> declaration it should work fine.
> On 12/28/05, Erik Saline <[EMAIL PROTECTED]> wrote:
> >
> >
> > ----- Original Message -----
> > From: Erik Saline
> > To: [email protected]
> > Sent: Wednesday, December 28, 2005 1:08 PM
> >
> >
> > I installed Apache, PHP, and Mysql during the Fedora Core 4
> installation.
> >
> > PHP 5.0.4
> > MYSQL 4.1.14
> >
> > I used php -i to show that mysql and mysqli were installed.
> > Configure Command => './configure' '--build=i386-redhat-linux'
> > '--with-mysql=shared,/usr' '--with-mysqli=shared,/usr/bin/mysql_config'
> '
> >
> > Here is the code.
> >
> > $result = new mysqli_connect('localhost', 'nobody', 'test',
> 'godisdead');
> >
> > Here is the error.
> >
> > PHP Fatal error: Class 'mysqli' not found in
> > /var/www/cgi-bin/db_connect.php on line 4,
> >
> >
> >
> > What am I missing?
> >
> >
> >
> > Erik
> >
> >
>
>
> --
> Hi Everyone, I am running PHP 5 on Windosws XP SP2 with MySQL5, Bye Now!
>
>
--
Hi Everyone, I am running PHP 5 on Windosws XP SP2 with MySQL5, Bye Now!
--- End Message ---
--- Begin Message ---
PHP Superman wrote:*
What OS are you using? I think that you entered the wrong filename. for
windows i use php_mysqli.dll . Somewhere in php.ini there is a list of
extensions you can use, uncomment the php_mysqli.dll , copy php_mysqli.dll
to the php install directory and change the php.ini extension setting to
your php install directory, that should fix the problem .
Follow the thread.
I installed Apache, PHP, and Mysql during the Fedora Core 4
<casting the first stone>
*Example of why top-posting is bad
</casting the first stone>
--
John C. Nichel IV
Programmer/System Admin (ÜberGeek)
Dot Com Holdings of Buffalo
716.856.9675
[EMAIL PROTECTED]
--- End Message ---
--- Begin Message ---
PHP Superman wrote:
Hold on, I heard that you can't run the mysql and mysqli php
extensions , try removing the mysql extension if my other advice
doesen't work
<snip>
Please reply to the list.
You can compile php with both.
From the manual :
http://us2.php.net/mysqli
If you would like to install the mysql extension along with the mysqli
extension you have to use the same client library to avoid any conflicts.
--
John C. Nichel IV
Programmer/System Admin (ÜberGeek)
Dot Com Holdings of Buffalo
716.856.9675
[EMAIL PROTECTED]
--- End Message ---
--- Begin Message ---
On 12/29/05, Rory Browne <[EMAIL PROTECTED]> wrote:
> > Please don't make comments like removing older versions of PHP from the
> > download page. We have delivered solutions to clients that run on PHP4.
> > Those clients need the ability to conveniently download PHP4 in order to run
> > our code.
>
> Why can't you make your code PHP5 compatable? It seems to be to be a
> fairly small price to make your code future proof, which will have to
> be done eventually anyway.
>
> Personally I think that anyone who still writes new code that is
> incompatable with php5 should be shot, - in the leg before being
> buried alive.
>
> > Happy New Year!!!
>
--- End Message ---
--- Begin Message ---
Thanks for the responses guys, but what i'm saying is i would like to return
all the variable names i have in a string,
$String="Blah Blah Blah $VarName Blah Blah Blah";
$Vars=myspecialfunction($Varname);
echo ($Vars);
that code would produce $Varname, if there were more variables it would also
return the Variable Names in an array
On 12/29/05, Jochem Maas <[EMAIL PROTECTED]> wrote:
>
> PHP Superman wrote:
> > Hey everyone, is there a way to return all the variables from a string
> into
> > an array, for example
> > $Var1="Yo";
> > $Var2="Man";
> > $SQL="SELECT * FROM tblname WHERE 4=$Var1 AND WHERE 3=$Var2";
> > $AllVars=MySpecialFunction($SQL);
>
> your function MySpecialFunction() will recieve the following string:
>
> "SELECT * FROM tblname WHERE 4=Yo AND WHERE 3=Man"
>
> which apart from being (probably) incorrect SQL, is just a string -
> how is your special function supposed to tell which chars are part of
> the previously injected variables' values - and even more impossible:
> how would the function find out what those variables we're called to
> begin with (it can't).
>
> what is it you would like to achieve?
>
> rgds,
> jochem
>
> PS - learn to walk before you fly ;-)
>
> > print_r($AllVars);
> >
> > would ideally print an array like:
> > {
> > array
> > $Var1="Yo"
> > $Var2="Man"
> >
> > }
> > i think i should use an ereg or preg replace but I don't know much about
> > them or how to use them, thanks in advance
> >
>
>
--
Hi Everyone, I am running PHP 5 on Windosws XP SP2 with MySQL5, Bye Now!
--- End Message ---
--- Begin Message ---
[snip]
Thanks for the responses guys, but what i'm saying is i would like to return
all the variable names i have in a string,
$String="Blah Blah Blah $VarName Blah Blah Blah";
$Vars=myspecialfunction($Varname);
echo ($Vars);
that code would produce $Varname, if there were more variables it would also
return the Variable Names in an array
[/snip]
And you call yourself Superman?!?
Keep in mind that the variable name in a double quoted string is
interpreted, you would have to use an outside process to read each line of
the file, locate the lines where the variables are, and then process to your
liking.
--- End Message ---
--- Begin Message ---
>
> Thanks for the responses guys, but what i'm saying is i would
> like to return
> all the variable names i have in a string,
> $String="Blah Blah Blah $VarName Blah Blah Blah";
> $Vars=myspecialfunction($Varname);
> echo ($Vars);
>
> that code would produce $Varname, if there were more
> variables it would also
> return the Variable Names in an array
I believe what Jochem is trying to tell you is that when you assign the
string variable, the variable names are expanded to their values, so the
names are no longer available.
Consider this:
$partname='widget';
$amount=100;
$string="This $partname costs $amount dollars";
/*
$string now equals "This widget costs 100 dollars", so when you pass it to
your function, it has no way to know for sure what the variables were, or
that there even were ANY variables involved in the generation of the string.
The variable NAMES are not passed because PHP expands them to their values
and sets $string accordingly.
*/
$string='This $partname costs $amount dollars';
$string now equals "This $partname costs $amount dollars". In this case, I
used single quotes. The values are not expanded and the variable NAMES are
passed. The VALUE of the variables are not. So you could then have a
function look for any word that starts with a $ and return an array of
names.
That all being said, what in the world are you trying to do with this? I
bet you $1.78 (the change in my desk drawer) there is a much better way to
solve whatever problem it is than the way you are trying here.
JM
Because it ruins the flow of the conversation.
>Why is top posting a bad thing?
--- End Message ---
--- Begin Message ---
I know that this is more of a Javascript / DOM question but I cannot
for the life of me figure this out:
I have this form:
<form name="query_form">
<input type="text" name="q"></input>
<input type="button" onclick="drawImg('A',document.forms
['query_form'].elements['q']);" value="Search"></input>
</form>
When the user clicks on the button, I want the text that is in input
elment 'q' to be sent to the Javascript function drawImg but when I
debug it via alerts, it appears to be NULL. Looking at the examples
online, I feel like this should work. Does anybody know why this
might not be working correctly?
-jonathan
--- End Message ---
--- Begin Message ---
Try:
<input type="text" name="q" id="q"></input>
<input type="button"
onclick="drawImg('A',document.getElementById('q').value);"
value="Search"></input>
I didn't test this, but I think it'll work...
-----Original Message-----
From: jonathan [mailto:[EMAIL PROTECTED]
Sent: Thursday, December 29, 2005 1:45 PM
To: [email protected]
Subject: [PHP] php / JS / DOM question
I know that this is more of a Javascript / DOM question but I cannot
for the life of me figure this out:
I have this form:
<form name="query_form">
<input type="text" name="q"></input>
<input type="button" onclick="drawImg('A',document.forms
['query_form'].elements['q']);" value="Search"></input>
</form>
When the user clicks on the button, I want the text that is in input
elment 'q' to be sent to the Javascript function drawImg but when I
debug it via alerts, it appears to be NULL. Looking at the examples
online, I feel like this should work. Does anybody know why this
might not be working correctly?
-jonathan
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
jonathan wrote:
I know that this is more of a Javascript / DOM question but I cannot
for the life of me figure this out:
I have this form:
<form name="query_form">
<input type="text" name="q"></input>
<input type="button" onclick="drawImg('A',document.forms
['query_form'].elements['q']);" value="Search"></input>
</form>
When the user clicks on the button, I want the text that is in input
elment 'q' to be sent to the Javascript function drawImg but when I
debug it via alerts, it appears to be NULL. Looking at the examples
online, I feel like this should work. Does anybody know why this might
not be working correctly?
-jonathan
You need to ask in the JAVASCRIPT newsgroup. This is not a php question.
--- End Message ---
--- Begin Message ---
Add the "value" property: document.forms['query_form'].elements['q']
.value.
Kirk
jonathan <[EMAIL PROTECTED]> wrote on 12/29/2005 02:45:23 PM:
> <form name="query_form">
> <input type="text" name="q"></input>
> <input type="button" onclick="drawImg('A',document.forms
> ['query_form'].elements['q']);" value="Search"></input>
> </form>
>
> When the user clicks on the button, I want the text that is in input
> elment 'q' to be sent to the Javascript function drawImg but when I
> debug it via alerts, it appears to be NULL.
--- End Message ---
--- Begin Message ---
thanks so much.
i didn't realize but I did strip out all the php. My bad.
-jonathan
On Dec 29, 2005, at 1:48 PM, Dan Uyemura wrote:
Try:
<input type="text" name="q" id="q"></input>
<input type="button"
onclick="drawImg('A',document.getElementById('q').value);"
value="Search"></input>
I didn't test this, but I think it'll work...
-----Original Message-----
From: jonathan [mailto:[EMAIL PROTECTED]
Sent: Thursday, December 29, 2005 1:45 PM
To: [email protected]
Subject: [PHP] php / JS / DOM question
I know that this is more of a Javascript / DOM question but I cannot
for the life of me figure this out:
I have this form:
<form name="query_form">
<input type="text" name="q"></input>
<input type="button" onclick="drawImg('A',document.forms
['query_form'].elements['q']);" value="Search"></input>
</form>
When the user clicks on the button, I want the text that is in input
elment 'q' to be sent to the Javascript function drawImg but when I
debug it via alerts, it appears to be NULL. Looking at the examples
online, I feel like this should work. Does anybody know why this
might not be working correctly?
-jonathan
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
which is not part of the standards. It's accepted by most browsers
because a lot of sites use it (due to the fact that IE is so popular),
but it's *NOT* standard. So, don't do it! Dan showed the correct way.
- tul
[EMAIL PROTECTED] wrote:
Add the "value" property: document.forms['query_form'].elements['q']
.value.
Kirk
jonathan <[EMAIL PROTECTED]> wrote on 12/29/2005 02:45:23 PM:
<form name="query_form">
<input type="text" name="q"></input>
<input type="button" onclick="drawImg('A',document.forms
['query_form'].elements['q']);" value="Search"></input>
</form>
When the user clicks on the button, I want the text that is in input
elment 'q' to be sent to the Javascript function drawImg but when I
debug it via alerts, it appears to be NULL.
--- End Message ---
--- Begin Message ---
Hey, Folks:
I have a web application I've just completed, and I want to present
it as part of my online portfolio, most of which hi-lights my work as
a front end developer. My question is this: How do I go about showing
off all of the hard-work I've done on the back-end? Do I simply
describe the structure of the program, or should I present the ERD,
code samples, screen-shots, etc? Is there such a thing as a "code
portfolio" ? Does anyone have examples of their own work to share?
Thanks.
Scott DeMers
Web Coordinator
International Studies and Programs
[EMAIL PROTECTED]
--- End Message ---
--- Begin Message ---
I have a web application I've just completed, and I want to present it as
part of my online portfolio, most of which hi-lights my work as a front end
developer. My question is this: How do I go about showing off all of the
hard-work I've done on the back-end? Do I simply describe the structure of
the program, or should I present the ERD, code samples, screen-shots, etc? Is
there such a thing as a "code portfolio" ? Does anyone have examples of their
own work to share? Thanks.
First... be careful if it's your employers application. They might not
want their database schema posted for the world to see. If that's not an
issue then...
I'd write up an overview document. Include some screenshots. Basically a
resume for your app. Make it long enough so it's clear that it's complex
and clear what you did, but short enough so that the person can understand
what it is the app does and what you did.
If you can, host a private copy of the application for demoing purposes
that you can show on a case by case basis.
And if you're releasing the code, by all means post it (tgz or zip) so
those curious can glance through it...
-philip
--- End Message ---
--- Begin Message ---
Hello
I have to migrate a PHP-application to a new Linux-Box. Both the old and
the new system are Linux and PHP 5.1.1. (the old one has a Pentium 4,
the new one two Xeon CPUs). I have a problem using the
Crypt_Xtea-Extension. I narrowed it down to the following right-shift
operation:
(-3281063054 >> 11) produces different results:
Old System: 495070
New System: -1048576
I understand that both results are "wrong", but everything worked with
the old behavior and I need that behavior back very urgent.
Maybe someone can explain me in which way the bits are shifted so that
the result is 495070? If I understand it, I implement my "own" shift
function.
thanks a lot
Michael Gross
--- End Message ---
--- Begin Message ---
On 12/29/05, Jay Blanchard <[EMAIL PROTECTED]> wrote:
> [snip]
> could you please tell me what is the problem with this query
> mysql_query("SELECT * FROM mailbox WHERE read=''");
>
> i always get this warning:
> Warning: mysql_num_rows(): supplied argument is not a valid MySQL
> result resource in index.php on line 24
> [/snip]
>
> THere is no apparent problem with the query, but there is a problem with
> mysql_num_rows(). Can you show us he code there?
>
I would hazard a guess that mysql_num_rows() is not being passed the
correct query result handle as a parameter.
ie: $result = mysql_query(...);
$rows = mysql_num_rows($result);
--
Graham
--- End Message ---
--- Begin Message ---
"read" is a reserved word in mysql
(http://dev.mysql.com/doc/refman/5.0/en/reserved-words.html). You have
to double-quote reserved words:
mysql_query("SELECT * FROM mailbox WHERE \"read\"=''");
Graham Cossey wrote:
On 12/29/05, Jay Blanchard <[EMAIL PROTECTED]> wrote:
[snip]
could you please tell me what is the problem with this query
mysql_query("SELECT * FROM mailbox WHERE read=''");
i always get this warning:
Warning: mysql_num_rows(): supplied argument is not a valid MySQL
result resource in index.php on line 24
[/snip]
THere is no apparent problem with the query, but there is a problem with
mysql_num_rows(). Can you show us he code there?
I would hazard a guess that mysql_num_rows() is not being passed the
correct query result handle as a parameter.
ie: $result = mysql_query(...);
$rows = mysql_num_rows($result);
--
Graham
--- End Message ---
--- Begin Message ---
Posted this to php-install with no response. See:
http://marc.theaimsgroup.com/?l=php-install&m=113579793423896&w=2
Hi folks,
I am trying to install php-4.4.1 on sparc-solaris 10, but make fails with:
/bin/sh /root/tmp/php-4.4.1/libtool <90-line snip> -o sapi/cgi/php
gcc: /usr/sfw/lib/sparcv9/.libs/libnetsnmp.so: No such file or directory
*** Error code 1
make: Fatal error: Command failed for target `sapi/cgi/php'
My configure line is:
./configure --with-mysql --with-snmp
This is almost the right place for libnetsnmp - /usr/sfw/lib, but there
is no .libs directory.
Can someone point me in the right direction?
0 urzatron /root # cat /etc/release
Solaris 10 3/05 s10_74L2a SPARC
Thanks,
--Dean
--- End Message ---