php-general Digest 21 Feb 2006 01:31:09 -0000 Issue 3975
Topics (messages 230735 through 230777):
Re: HN CAPTCHA at http://www.phpclasses.org
230735 by: Andrew Brampton
Re: Looping from A to Z
230736 by: Jason Motes
need a php multiple/mysql choice quiz
230737 by: Ross
230739 by: Barry
230740 by: Jochem Maas
230741 by: Barry
230742 by: Dan Parry
230743 by: Kim Christensen
230744 by: Austin Denyer
230745 by: Leif Gregory
PHP5.1.2/Apache2/WindowsXP
230738 by: Robert Hicks
ajax was HN CAPTCHA...
230746 by: tedd
Invalid Credentials
230747 by: Delamatrix
PHP documentation solutions? (PHPDoc, Doxygen, ???)
230748 by: tg-php.gryffyndevelopment.com
230751 by: Jay Blanchard
230753 by: Robert Cummings
230760 by: Jay Blanchard
230762 by: Robert Cummings
230763 by: Jay Blanchard
230764 by: John Nichel
newbie problem
230749 by: Robert Voogdgeert
230750 by: Jay Blanchard
230752 by: John Nichel
230770 by: Robert Voogdgeert
230771 by: Ray Hauge
230777 by: julian haffegee
Page validation: Un-wanted PHP session ID added to links????
230754 by: Michael Hulse
230755 by: John Nichel
230756 by: David Dorward
230757 by: Michael Hulse
230758 by: Michael Hulse
230759 by: John Nichel
Re: [SOLVED] [PHP] Page validation: Un-wanted PHP session ID added to links????
230761 by: Michael Hulse
php+ ajax
230765 by: blackwater dev
230766 by: Kim Christensen
230769 by: David Dorward
Request for views on ASP/PHP/ASP.NET - please!
230767 by: Simon O'Beirne
Working with a config file
230768 by: Benjamin Adams
230772 by: Michael Hulse
230773 by: Jens Kleikamp
Proper OOP Syntax
230774 by: Albert Padley
230775 by: Chris
230776 by: Albert Padley
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 ---
A bot could find it if it parses (and executes) javascript.
Andrew
----- Original Message -----
From: "Gerry Danen" <[EMAIL PROTECTED]>
To: "comex" <[EMAIL PROTECTED]>
Cc: <[email protected]>
Sent: Monday, February 20, 2006 3:58 AM
Subject: Re: [PHP] HN CAPTCHA at http://www.phpclasses.org
How would a bot find it though?
On 2/19/06, comex <[EMAIL PROTECTED]> wrote:
> You got me. Where are you hiding it?
In test.js:
http://www.xn--ovg.com/no_bot/rpc.php?action=one
Unless you hide it in a different place each time, how useful is that?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Richard K Miller wrote:
Good afternoon. I'm having trouble getting PHP to loop from A through
Z. Here is what I tried, coming from a C background:
for ($l = "A"; $l <= "Z"; $l++)
echo $l;
I use this:
for($i='a'; $i != 'aa'; $i++){
print $i;
|
--- End Message ---
--- Begin Message ---
I am looking for a php/mysql multiple choice quiz. One that saves the
answers to a database. A basic example I can expand on is all that is
required.
Ross
--- End Message ---
--- Begin Message ---
Ross wrote:
I am looking for a php/mysql multiple choice quiz. One that saves the
answers to a database. A basic example I can expand on is all that is
required.
Ross
O_o
- You want us to give you code examples?
- You want us to give you hints?
- link to scripts?
- mushrooms?
What do you want?
A basic example. what is that?
Basic example: Use php and mysql for example.
Be a bit more precise please.
Or this will end up like multiple choice here.
Thank you
barry
--
Smileys rule (cX.x)C --o(^_^o)
Dance for me! ^(^_^)o (o^_^)o o(^_^)^ o(^_^o)
--- End Message ---
--- Begin Message ---
Barry wrote:
Ross wrote:
I am looking for a php/mysql multiple choice quiz. One that saves the
answers to a database. A basic example I can expand on is all that is
required.
Ross
O_o
- You want us to give you code examples?
- You want us to give you hints?
- link to scripts?
- mushrooms?
what kind of mushrooms?
and to the OP: google for your supper:
http://www.google.com/search?num=100&q=php+questionnaire
http://www.google.com/search?num=100&q=php+questionnaire+tool
--- End Message ---
--- Begin Message ---
Jochem Maas wrote:
Barry wrote:
Ross wrote:
I am looking for a php/mysql multiple choice quiz. One that saves the
answers to a database. A basic example I can expand on is all that is
required.
Ross
O_o
- You want us to give you code examples?
- You want us to give you hints?
- link to scripts?
- mushrooms?
what kind of mushrooms?
rainbow colored ones =)
--
Smileys rule (cX.x)C --o(^_^o)
Dance for me! ^(^_^)o (o^_^)o o(^_^)^ o(^_^o)
--- End Message ---
--- Begin Message ---
>> what kind of mushrooms?
>>
>rainbow colored ones =)
Think they're illegal in the UK...
--- End Message ---
--- Begin Message ---
On 2/20/06, Dan Parry <[EMAIL PROTECTED]> wrote:
> >> what kind of mushrooms?
> >>
> >rainbow colored ones =)
>
> Think they're illegal in the UK...
Then move out of there quicker than fast, they're too tasty to miss!
--
Kim Christensen
[EMAIL PROTECTED]
--- End Message ---
--- Begin Message ---
On Mon, 20 Feb 2006 16:24:32 -0000
"Dan Parry" <[EMAIL PROTECTED]> wrote:
>
> >> what kind of mushrooms?
> >>
> >rainbow colored ones =)
>
> Think they're illegal in the UK...
I think just about EVERYTHING is illegal in the UK.
Well, except for vacation time - that's just illegal in the US.
#;-D
Regards,
Ozz.
pgpwEs1K9ZYNP.pgp
Description: PGP signature
--- End Message ---
--- Begin Message ---
Hello Ross,
Monday, February 20, 2006, 8:49:55 AM, you wrote:
> I am looking for a php/mysql multiple choice quiz. One that saves
> the answers to a database. A basic example I can expand on is all
> that is required.
http://www.hotscripts.com/PHP/Scripts_and_Programs/Tests_and_Quizzes/index.html
--
TBUDL/BETA/DEV/TECH Lists Moderator / PGP 0x6C0AB16B
__ ____ ____ ____ Geocaching: http://gps.PCWize.com
( ) ( ___)(_ _)( ___) TBUDP Wiki Site: http://www.PCWize.com/thebat/tbudp
)(__ )__) _)(_ )__) Roguemoticons & Smileys: http://PCWize.com/thebat
(____)(____)(____)(__) PHP Tutorials and snippets: http://www.DevTek.org
Moderating is like trying to herd cats.
--- End Message ---
--- Begin Message ---
I am trying to use the DB PEAR extension. Every time it tries to
connect, I get a "memory cannot be read error".
I have just setup all this to try out PHP5 so help to a newbie would be
appreciated.
Robert
--- End Message ---
--- Begin Message ---
Hi gang:
The http://xn--ovg.com/no_bot was my first dive into ajax.
What I found interesting was that the presentation on the screen
wasn't also found in the code. That I'm sure is known to others, but
it was a surprise to me. Immediately, I thought of CAPTCHA and other
situations where you would want bots to see one thing while you
presented what you wanted to your visitor.
For example, it's easy to hide stuff from visually unimpaired
visitors by using a far-left css technique -- in other words, moving
text far left and out of the screen. However, this causes problems
for the visually impaired because they still "read" it AND if a
search engine concern (i.e., Google) catches you trying to deceive,
then your site may be banned. I only present this because you could
do it.
Another example is presenting your email address on your site to a
visitor while keeping it away from bots. That certainly works -- or
at least I think it works -- I'm awaiting proof otherwise.
As for bots detecting, parsing and executing the javascript to arrive
at answer -- I'm sure they could, but I wonder how likely that would
be? In any event, this is another CAPTCHA solution that works pretty
good.
My first impression of ajax is that this is very cool for creating
"non-auto-refreshing" web pages. Now I'm off to experiment with it
further.
Thanks for the review guys.
tedd
--
--------------------------------------------------------------------------------
http://sperling.com php code: http://www.weberdev.com/
--- End Message ---
--- Begin Message ---
Hi,
I have a simple php script that binds to an openldap server but I keep
getting this error message;
Warning: ldap_bind(): Unable to bind to server: Invalid credentials in
/srv/www/site.com/check-user2.php on line 15
LDAP bind failed...
The password is correct so I'm not quite sure why getting this error.
Is there something wrong with my code?
Here's the PHP script:
##############################################################
<?php
$ldapdn=$_POST['users'];
$basedn=$_POST['dn'];
$ldappass=$_POST['pw'];
ldap_set_option($ds,LDAP_OPT_PROTOCOL_VERSION,3);
$ldapconn = ldap_connect("192.168.15.130")
or die("Could not connect to LDAP server.");
if ($ldapconn) {
// binding to ldap server
$ldapbind = ldap_bind($ldapconn, "$ldapdn" . "$basedn", $ldappass);
// verify binding
if ($ldapbind) {
echo "LDAP bind successful...";
} else {
echo "LDAP bind failed...";
}
}
?>
################################################################
Here's the HTML form:
################################################################
<html>
<head>
<title>LDAP Authentication</title>
</head>
<body>
<form name="Login" method="post" action="check-user2.php">
<table>
<tr>
<td>User Name</td>
<td>
<select name="users">
<option value="uid=bobby">Bobby</option>
<option value="uid=felicia">Felicia</option>
</select>
<INPUT TYPE="hidden" NAME="dn" value="ou=people,dc=site,dc=com"></td>
</tr>
<tr>
<td>Password</td>
<td><input type="password" name="pw">
</td>
</tr>
</table>
<input type=image src="images/login.gif" alt="Login"
name="image">
</form>
</body>
</html>
#################################################################
- Delamatrix
--- End Message ---
--- Begin Message ---
Ok, so we're starting to get a little more serious about this product we're
working on and may in the near future try to standardize and flesh out our
coding and product documentation (always a nice thing). I'm semi-familiar
with PHPDoc (http://www.phpdoc.org) but my boss just pointed me toward Doxygen
(http://www.stack.nl/~dimitri/doxygen/) as a possible solution. Just wondering
if anyone has had any practical experience with either/both or have an
alternative that they enjoy using?
I like the idea of being able to specify internal (developers) documentation as
well as end user product documentation but maybe there's other features people
have found useful as well that we havn't thought of yet.
Thanks.
-TG
___________________________________________________________
Sent by ePrompter, the premier email notification software.
Free download at http://www.ePrompter.com.
--- End Message ---
--- Begin Message ---
[snip]
Ok, so we're starting to get a little more serious about this product we're
working on and may in the near future try to standardize and flesh out our
coding and product documentation (always a nice thing). I'm semi-familiar
with PHPDoc (http://www.phpdoc.org) but my boss just pointed me toward
Doxygen (http://www.stack.nl/~dimitri/doxygen/) as a possible solution.
Just wondering if anyone has had any practical experience with either/both
or have an alternative that they enjoy using?
I like the idea of being able to specify internal (developers) documentation
as well as end user product documentation but maybe there's other features
people have found useful as well that we havn't thought of yet.
[/snip]
I have tried PHPdoc, but I have not tried Doxygen. After reading the
features of Doxygen I would be tempted to give it a try, because I found
that PHPdoc doesn't do everything that I want in an auto-doc application. I
know that this is not much help.
--- End Message ---
--- Begin Message ---
On Mon, 2006-02-20 at 13:51, [EMAIL PROTECTED] wrote:
> Ok, so we're starting to get a little more serious about this product we're
> working on and may in the near future try to standardize and flesh out our
> coding and product documentation (always a nice thing). I'm semi-familiar
> with PHPDoc (http://www.phpdoc.org) but my boss just pointed me toward
> Doxygen (http://www.stack.nl/~dimitri/doxygen/) as a possible solution. Just
> wondering if anyone has had any practical experience with either/both or have
> an alternative that they enjoy using?
>
> I like the idea of being able to specify internal (developers) documentation
> as well as end user product documentation but maybe there's other features
> people have found useful as well that we havn't thought of yet.
In the spirit of re-inventing the wheel... I rolled my own JinnDoc.
I now use it to maintain my PHP and JavaScript source code
documentation.
Example output can be found from here:
http://www.interjinn.com/jinnDoc/index.phtml
Example markup can be found here (view the source):
http://www.interjinn.com/javaScript/interJinn/Core/httpRequest.js
Cheers,
Rob.
--
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting |
| a powerful, scalable system for accessing system services |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for |
| creating re-usable components quickly and easily. |
`------------------------------------------------------------'
--- End Message ---
--- Begin Message ---
[snip]
In the spirit of re-inventing the wheel... I rolled my own JinnDoc.
[/snip]
My single largest arguement against these kinds of tools were the additional
mark-up required. Code commentary, done properly, can yield the same
results without additional mark-up. I'd rather be able to insert a code
comment or html comment with a simple 'type' to tell me what the commentary
is. It makes it much more universal where auto-doc harvesters are concerned
and removes the requirement for page level elements to be stated first, etc.
example(s)
/* type=description
*
* describe whatever is being described here
*/
or
<!-- type="description"
whatever is being described
-->
or
$myBigVar = 'large' //type=variable
--- End Message ---
--- Begin Message ---
On Mon, 2006-02-20 at 15:38, Jay Blanchard wrote:
> [snip]
> In the spirit of re-inventing the wheel... I rolled my own JinnDoc.
> [/snip]
>
> My single largest arguement against these kinds of tools were the additional
> mark-up required. Code commentary, done properly, can yield the same
> results without additional mark-up. I'd rather be able to insert a code
> comment or html comment with a simple 'type' to tell me what the commentary
> is. It makes it much more universal where auto-doc harvesters are concerned
> and removes the requirement for page level elements to be stated first, etc.
>
> example(s)
>
> /* type=description
> *
> * describe whatever is being described here
> */
>
> or
>
> <!-- type="description"
> whatever is being described
> -->
>
> or
>
> $myBigVar = 'large' //type=variable
I see your point and considered it before I rolled my own, but rolling
my own using the existing TemplateJinn system allowed me the flexibility
of custom tags and all the goodies that already come with the
TemplateJinn system making it that much easier to incorporate JinnDocs
into any existing page layout scheme or whatnot and to make use of the
already existing site compilation system. Also with the system you
describe precision formatting becomes necessary since the parser needs
to pull out implied details based on blank lines, spacing, indentation,
etc... but as you also show it can make for a cleaner inline document :)
Cheers,
Rob.
--
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting |
| a powerful, scalable system for accessing system services |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for |
| creating re-usable components quickly and easily. |
`------------------------------------------------------------'
--- End Message ---
--- Begin Message ---
[snip]
I see your point and considered it before I rolled my own, but rolling
my own using the existing TemplateJinn system allowed me the flexibility
of custom tags and all the goodies that already come with the
TemplateJinn system making it that much easier to incorporate JinnDocs
into any existing page layout scheme or whatnot and to make use of the
already existing site compilation system. Also with the system you
describe precision formatting becomes necessary since the parser needs
to pull out implied details based on blank lines, spacing, indentation,
etc... but as you also show it can make for a cleaner inline document :)
[/snip]
I can see where yours dovetails neatly with your InterJinn framework and
agree with your take on it in this context. Where general documentability is
concerned I would rather give a well defined list of comment types to my
development team and roll the documentor from there. If the comment had no
'type' you could still harvest it and use it appropriately.
--- End Message ---
--- Begin Message ---
Jay Blanchard wrote:
[snip]
In the spirit of re-inventing the wheel... I rolled my own JinnDoc.
[/snip]
My single largest arguement against these kinds of tools were the additional
mark-up required. Code commentary, done properly, can yield the same
results without additional mark-up. I'd rather be able to insert a code
comment or html comment with a simple 'type' to tell me what the commentary
is. It makes it much more universal where auto-doc harvesters are concerned
and removes the requirement for page level elements to be stated first, etc.
example(s)
/* type=description
*
* describe whatever is being described here
*/
or
<!-- type="description"
whatever is being described
-->
or
$myBigVar = 'large' //type=variable
Before each function I create, I have this:
/*
// Function : getCategoryEmail
// Description : Retrieves a list of email addresses based on
// past orders per category
// Requires : $catids (Array) - Array of category ids
// $id (Integer) - The DCHOB site id
// Optional : None
// Returns : Array with email addresses and stats; false on
// failure
// Author : John Nichel
// Email : [EMAIL PROTECTED]
// Created : 20 Mar 05
// Modified :
// Modified By :
// Mod Email :
// Mod Date :
*/
Major block of code...
/*
// Description : Checks if customer has come in thru BorderFree;
// sets appropriate flags if true
// Expected : If a BorderFree id is set either in the POST or
// GET request, assign id to users session so it
// so that it will be available should customer
// attempt to purchase. If id does not match known
// BF syntax, email admin with name/value pair; set
// flag for normal checkout with logging
// Author : John Nichel
// Email : [EMAIL PROTECTED]
// Created : 20 Mar 05
// Modified :
// Modified By :
// Mod Email :
// Mod Date :
*/
Variables...
$foo = "bar" // This is what this variable is for
So on, and so forth. I am the IT department here, so I'm not worried
about documenting it yet. ;)
--
John C. Nichel IV
Programmer/System Admin (ÜberGeek)
Dot Com Holdings of Buffalo
716.856.9675
[EMAIL PROTECTED]
--- End Message ---
--- Begin Message ---
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Dear php-users,
When working with an HTML file with a form with
<form action="somename.php" method="post">
the somename.php file is served (completely) to my browser as plain text
after the 'submit' button is clicked on my machine (MacOS X). On the
external webhost though everything is processed correctly...
Is this related to some setting that I should change on my localhost?
Thanks,
Robert.
-----BEGIN PGP SIGNATURE-----
Version: PGP SDK 3.0.3
iQA/AwUBQ/oVBLSl/DgWyrAzEQL52wCdGqw+d3sTJo5pEVwLy28KTn+/eYAAn188
5DD5Y4UbSBXHjC1japDLp3yK
=uUgZ
-----END PGP SIGNATURE-----
--- End Message ---
--- Begin Message ---
[snip]
When working with an HTML file with a form with
<form action="somename.php" method="post">
the somename.php file is served (completely) to my browser as plain text
after the 'submit' button is clicked on my machine (MacOS X). On the
external webhost though everything is processed correctly...
Is this related to some setting that I should change on my localhost?
[/snip]
Are you working on localhost or the remote server? Have you uploaded the
form to the remote server?
--- End Message ---
--- Begin Message ---
Robert Voogdgeert wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Dear php-users,
When working with an HTML file with a form with
<form action="somename.php" method="post">
the somename.php file is served (completely) to my browser as plain text
after the 'submit' button is clicked on my machine (MacOS X). On the
external webhost though everything is processed correctly...
Is this related to some setting that I should change on my localhost?
<snip>
Is your localhost parsing php documents? If you're using Apache, do you
have a line like this in you httpd.conf....
AddType application/x-httpd-php .php
--
John C. Nichel IV
Programmer/System Admin (ÜberGeek)
Dot Com Holdings of Buffalo
716.856.9675
[EMAIL PROTECTED]
--- End Message ---
--- Begin Message ---
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
> Robert Voogdgeert wrote:
> > -----BEGIN PGP SIGNED MESSAGE-----
> > Hash: SHA1
> >
> > Dear php-users,
> >
> >
> > When working with an HTML file with a form with
> >
> > <form action="somename.php" method="post">
> >
> > the somename.php file is served (completely) to my browser as plain
> text
> > after the 'submit' button is clicked on my machine (MacOS X). On the
> > external webhost though everything is processed correctly...
> >
> > Is this related to some setting that I should change on my
localhost?
> <snip>
>
> Is your localhost parsing php documents? If you're using Apache, do
you
> have a line like this in you httpd.conf....
>
> AddType application/x-httpd-php .php
>
> --
> John C. Nichel IV
> Programmer/System Admin (ÜberGeek)
> Dot Com Holdings of Buffalo
> 716.856.9675
> [EMAIL PROTECTED]
>
John,
My httpd.conf has the following:
<IfModule mod_php4.c>
# If php is turned on, we repsect .php and .phps files.
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
Robert
-----BEGIN PGP SIGNATURE-----
Version: PGP SDK 3.0.3
iQA/AwUBQ/pDjrSl/DgWyrAzEQJLyQCgvVwSVICv4tRgp6r5GQMdMXfR78cAoO9Y
CROHvZImh4LFXGxWV0UoUgld
=qSjr
-----END PGP SIGNATURE-----
--- End Message ---
--- Begin Message ---
On Monday 20 February 2006 15:32, Robert Voogdgeert wrote:
> > Robert Voogdgeert wrote:
> > > -----BEGIN PGP SIGNED MESSAGE-----
> > > Hash: SHA1
> > >
> > > Dear php-users,
> > >
> > >
> > > When working with an HTML file with a form with
> > >
> > > <form action="somename.php" method="post">
> > >
> > > the somename.php file is served (completely) to my browser as plain
> >
> > text
> >
> > > after the 'submit' button is clicked on my machine (MacOS X). On the
> > > external webhost though everything is processed correctly...
> > >
> > > Is this related to some setting that I should change on my
>
> localhost?
>
> > <snip>
> >
> > Is your localhost parsing php documents? If you're using Apache, do
>
> you
>
> > have a line like this in you httpd.conf....
> >
> > AddType application/x-httpd-php .php
> >
> > --
> > John C. Nichel IV
> > Programmer/System Admin (ÜberGeek)
> > Dot Com Holdings of Buffalo
> > 716.856.9675
> > [EMAIL PROTECTED]
>
> John,
>
>
> My httpd.conf has the following:
>
> <IfModule mod_php4.c>
> # If php is turned on, we repsect .php and .phps files.
> AddType application/x-httpd-php .php
> AddType application/x-httpd-php-source .phps
>
> Robert
Is the file in one of your home folders, or in a folder that Apache is
configured to check? (I've seen that happen from time to time)
eg. file in /home/myhome/projects/file.php
or
file in /var/www/htdocs/file.php
Also, was apache restarted after allowing PHP (if applicable)
--
Ray Hauge
Programmer/Systems Administrator
American Student Loan Services
http://www.americanstudentloan.com
1.800.575.1099
--- End Message ---
--- Begin Message ---
Hi all,
I have a page that lets people upload images - they are then resized for use
throughout my site.
It all works fine, but I need to reduce the jpg size (without reducing image
size)
Is there a php function that lets you compress the jpg?
Thanks
Jules
--- End Message ---
--- Begin Message ---
Hi,
I just finished a website for client - I just uploaded the site to
their server space - when I went to go validate my pages using the W3C
XHTML validator I get several errors due to an un-encoded ampersand in
the link URL... For some reason, a session ID is getting added to the
end of all my menu links:
/start.php?page=home&PHPSESSID=45142bb20b8b2e800be5359b667237
Ummm, can I turn this off? I tested/built the site on my server and
never got this problem.
I am sure it is an easy fix. Suggestions? Links?
Many thanks in advance.
Micky
--- End Message ---
--- Begin Message ---
Michael Hulse wrote:
Hi,
I just finished a website for client - I just uploaded the site to their
server space - when I went to go validate my pages using the W3C XHTML
validator I get several errors due to an un-encoded ampersand in the
link URL... For some reason, a session ID is getting added to the end of
all my menu links:
/start.php?page=home&PHPSESSID=45142bb20b8b2e800be5359b667237
Ummm, can I turn this off? I tested/built the site on my server and
never got this problem.
I am sure it is an easy fix. Suggestions? Links?
It's all in the manual
http://us3.php.net/session
--
John C. Nichel IV
Programmer/System Admin (ÜberGeek)
Dot Com Holdings of Buffalo
716.856.9675
[EMAIL PROTECTED]
--- End Message ---
--- Begin Message ---
Michael Hulse wrote:
> I just finished a website for client - I just uploaded the site to
> their server space - when I went to go validate my pages using the W3C
> XHTML validator I get several errors due to an un-encoded ampersand in
> the link URL... For some reason, a session ID is getting added to the
> end of all my menu links:
>
> /start.php?page=home&PHPSESSID=45142bb20b8b2e800be5359b667237
http://www.w3.org/QA/2005/04/php-session details how to fix the problem
(without breaking the session tracking for users without cookies supported
and enabled).
--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
--- End Message ---
--- Begin Message ---
On Feb 20, 2006, at 12:10 PM, John Nichel wrote:
It's all in the manual
Hi, thanks for pointing that out. I guess I should have RTFM first,
then ask q's second... noob mistake, wont happen again. :D
I guess I just do not understand why a session is even being created, I
never started one... I guess I need to read the manual in more detail
(doing now).
Thanks for the quick response. :)
Micky
--- End Message ---
--- Begin Message ---
On Feb 20, 2006, at 12:11 PM, David Dorward wrote:
http://www.w3.org/QA/2005/04/php-session details how to fix the problem
(without breaking the session tracking for users without cookies
supported
and enabled).
Ah, great link. Thanks! :)
I don't know why sessions are being stored in the first place, but at
least I can fix the validation prob.
Cheers!
Micky
--- End Message ---
--- Begin Message ---
Michael Hulse wrote:
On Feb 20, 2006, at 12:10 PM, John Nichel wrote:
It's all in the manual
Hi, thanks for pointing that out. I guess I should have RTFM first, then
ask q's second... noob mistake, wont happen again. :D
I guess I just do not understand why a session is even being created, I
never started one... I guess I need to read the manual in more detail
(doing now).
Thanks for the quick response. :)
Micky
The server you're running the script on may have session.auto_start enabled
--
John C. Nichel IV
Programmer/System Admin (ÜberGeek)
Dot Com Holdings of Buffalo
716.856.9675
[EMAIL PROTECTED]
--- End Message ---
--- Begin Message ---
This did the trick:
<?php ini_set('arg_separator.output','&'); ?>
On Feb 20, 2006, at 12:37 PM, John Nichel wrote:
The server you're running the script on may have session.auto_start
enabled
Ah, got it. :)
Thanks all!
--- End Message ---
--- Begin Message ---
Hello,
I am trying to do a pre-search to let the users know how many rows
will be returned before they actually hit submit. I think this is
more of a js question but :
I have this js function:
function preSearch() {
//Put the form data into a variable
var min_price= document.getElementById('min_price').value ;
var max_price= document.getElementById('max_price').value ;
document.getElementById('prop_num').innerHTML = "Searching...";
var url = 'ajax.php?min_price=' + min_price +'&max_price=' + max_price;
xmlhttp.open('GET', url, true);
xmlhttp.onreadystatechange = function() {
if(xmlhttp.readyState == 4 && xmlhttp.status == 200) {
document.getElementById('prop_num').innerHTML ='TotalRecords:
' + xmlhttp.responseText + ' ';
} else {
//If the PHP script fails to send a
response, or sends back an error, display a simple user-friendly
notification
document.getElementById('prop_num').innerHTML = '';
}
};
xmlhttp.send(null);
// }
}
And have this for inputs:
<input name="min_price" id="min_price"> etc.
I would really like to have all of my inputs has part of an arry so:
<input name="search[min_price]" id="search[min_price]"> etc
The problem is js seems to get confused trying to look this up by id
and I don't think I can use an array like this with a GET, how can I
use arrays for all this??
Thanks!
--- End Message ---
--- Begin Message ---
On 2/20/06, blackwater dev <[EMAIL PROTECTED]> wrote:
> The problem is js seems to get confused trying to look this up by id
> and I don't think I can use an array like this with a GET, how can I
> use arrays for all this??
You have to escape the brackets with backslashes, so that the JS
really interprets it as an element ID - not an array. Something like
this might work:
[snip]
(HTML)
<input name="search[min_price]" id="search[min_price]">
(JS)
var min_price= document.getElementById('search\[min_price\]').value ;
[/snip]
--
Kim Christensen
[EMAIL PROTECTED]
--- End Message ---
--- Begin Message ---
Kim Christensen wrote:
> On 2/20/06, blackwater dev <[EMAIL PROTECTED]> wrote:
>> The problem is js seems to get confused trying to look this up by id
>> and I don't think I can use an array like this with a GET, how can I
>> use arrays for all this??
>
> You have to escape the brackets with backslashes, so that the JS
> really interprets it as an element ID
Element ids may not contain square brackets in HTML documents.
--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
--- End Message ---
--- Begin Message ---
Hi guys,
A bit of an odd request. I'm in my third and final year at university, and
part of an assignment requires obtaining developers' perspective on web
languages.
If anyone has done at least one of the languages in the subject title
(ASP/ASP.NET/PHP), I would be eternally grateful if you could pop to (and
also send any other web developers you know to)
http://www.coralsystemsolutions.co.uk/uni
Theres a maximum of 14 short questions (depending on answers to the other
questions), all optional, just fill out as much as you can be bothered with,
then click submit a few times until its saved.
Thank you very much in advance!
Simon
--- End Message ---
--- Begin Message ---
I'm trying to parse a config file, example of the config is:
[fred]
id=8782
section=s1
years=4
download1=mirror1
[frank]
id=8372
section=s3
years=4
download1=mirror12
download2=mirror2
.
.
.
I want to parse this so I can only call frank or freds data and move
id, section, years, etc to varaibles.
Can someone give me some help
Thanks
Ben
--- End Message ---
--- Begin Message ---
On Feb 20, 2006, at 2:21 PM, Benjamin Adams wrote:
I want to parse this so I can only call frank or freds data and move
id, section, years, etc to varaibles.
Can someone give me some help
Here is a function I wrote, I bet it will help you (sorry, not the most
readable because I pulled from bigger application I wrote, hopefully
you can translate to suit your needs):
#### $ini = File to parse. e.g.[ 'rand_01.ini' ]
#### You might want to change extension of your config to ".ini", not
sure if that will matter.
$images = get_ini_file($ini); // Call $get_ini_file() function, put in
$images array.
///////////////////////////////////////// function get_ini_file():
///////////////////////////////////////// Reads ini file for other
functions:
function get_ini_file($ini) {
global $PATH_TO_INI, $DEFAULT_INI_FILE;
# if no custom ini file has been specified, use the default:
$ini_file = $ini ? $PATH_TO_INI.$ini : $PATH_TO_INI.$DEFAULT_INI_FILE;
# read the config file into an array or die trying:
$parsed_ini = @parse_ini_file($ini_file, true);
if(!$parsed_ini) {
die('[ Unable to read ini file! ]');
} else { return $parsed_ini; }
}
--- End Message ---
--- Begin Message ---
Benjamin Adams wrote:
I'm trying to parse a config file, example of the config is:
[fred]
id=8782
section=s1
years=4
download1=mirror1
[frank]
id=8372
section=s3
years=4
download1=mirror12
download2=mirror2
.
.
.
I want to parse this so I can only call frank or freds data and move id,
section, years, etc to varaibles.
Can someone give me some help
Thanks
Ben
--PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
If you´ve a php 5 environment I would recommend the Configuration
Package of the newly releases ezComponents.
Components overview: http://ez.no/doc/components/overview
Fast, feature-rich and easy to use, hava a look at the tutorial:
http://ez.no/doc/components/view/(file)/1.0/introduction_Configuration.html
-Jens
--- End Message ---
--- Begin Message ---
Given the following code:
$password = (strlen($this->user_pw) < 32) ? md5($this->user_pw) :
$this->user_pw;
$sql = sprintf("SELECT COUNT(*) AS test, TeamID FROM %s WHERE
BINARY login = '%s' AND pw = '%s' AND active = 'y'", $this-
>table_name, $this->user, $password);
}
$result = mysql_query($sql) or die(mysql_error());
if (mysql_result($result, 0, "test") == 1) {
return true;
} else {
return false;
}
How would I set a session variable for the value of TeamID?
Thanks.
Albert Padley
--- End Message ---
--- Begin Message ---
Albert Padley wrote:
Given the following code:
$password = (strlen($this->user_pw) < 32) ? md5($this->user_pw) :
$this->user_pw;
$sql = sprintf("SELECT COUNT(*) AS test, TeamID FROM %s
WHERE BINARY login = '%s' AND pw = '%s' AND active = 'y'", $this-
>table_name, $this->user, $password);
}
$result = mysql_query($sql) or die(mysql_error());
if (mysql_result($result, 0, "test") == 1) {
return true;
} else {
return false;
}
How would I set a session variable for the value of TeamID?
You'll need to change it so you actually fetch the teamid:
$result = mysql_query($sql) or die(mysql_error());
$row = mysql_fetch_assoc($result);
if (empty($row)) {
return false;
}
$_SESSION['TeamID'] = (int)$row['TeamID'];
return true;
--- End Message ---
--- Begin Message ---
Thank you Chris.
Albert
On Feb 20, 2006, at 5:00 PM, Chris wrote:
Albert Padley wrote:
Given the following code:
$password = (strlen($this->user_pw) < 32) ? md5($this->user_pw) :
$this->user_pw;
$sql = sprintf("SELECT COUNT(*) AS test, TeamID FROM %
s WHERE BINARY login = '%s' AND pw = '%s' AND active = 'y'",
$this- >table_name, $this->user, $password);
}
$result = mysql_query($sql) or die(mysql_error());
if (mysql_result($result, 0, "test") == 1) {
return true;
} else {
return false;
}
How would I set a session variable for the value of TeamID?
You'll need to change it so you actually fetch the teamid:
$result = mysql_query($sql) or die(mysql_error());
$row = mysql_fetch_assoc($result);
if (empty($row)) {
return false;
}
$_SESSION['TeamID'] = (int)$row['TeamID'];
return true;
--- End Message ---