php-general Digest 25 Jul 2006 07:43:51 -0000 Issue 4257
Topics (messages 239736 through 239754):
PHP Developer Needed in San Jose, CA w/ Occasional Travel to Palo Alto
239736 by: Franco Pawlisz
239753 by: Paul Scott
Re: database connections
239737 by: Kilbride, James P.
239738 by: Robert Cummings
239739 by: Ryan A
Stripping weird characters again...
239740 by: Paul Nowosielski
239741 by: Adam Zey
239742 by: Paul Nowosielski
239743 by: Paul Nowosielski
SQL Result Set -> HTML Table Fragment (but Simple)
239744 by: Michael B Allen
239745 by: Adam Zey
239746 by: Adam Zey
239747 by: Larry Garfield
239752 by: Michael B Allen
xml v php question
239748 by: tedd
239751 by: Larry Garfield
Re: select option and php
239749 by: weetat
239750 by: weetat
Re: Comparing Strings
239754 by: Nils Holland
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 ---
Hello Everyone,
Let me introduce myself, My name is Franco Pawlisz with ObjectWave Corporation
a Software Engineering Company Headquartered in Chicago, IL.
ObjectWave Corporation specializes in the use of object-oriented (OO)
technologies to design, develop and deploy software. ObjectWave's clients are
typically companies seeking custom enterprise-class solutions for
client-server, web-based and business-to-business e-commerce applications that
can only be successfully realized by using a disciplined approach to software
construction. Our approach delivers solutions that meet and exceed customer
requirements for software flexibility, maintainability, extensibility and
reusability.
ObjectWave is currently looking for a PHP Developer interested in a Minimum 6
month Contract with one of our premier clients.
Specifics:
My Client is specifically looking for a developer with strong front end PHP
experience knowledge of Java and or Ruby is a major plus.
The pay rate for this position is open for negotiation based on experience.
Please let me know as soon as possible how we can touch base on this
opportunity with a word copy of your resume and a good time to reach you.
Regards,
Franco Pawlisz
Senior Technical Recruiter
ObjectWave Corporation
333 W. Wacker Drive
Suite 1860
Chicago, IL 60606
HYPERLINK "mailto:[EMAIL PROTECTED]"[EMAIL PROTECTED]
Office: (312) 269-0111 x127
Cell: (312) 217-9669
HYPERLINK "http://www.objectwave.com"www.objectwave.com
--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.394 / Virus Database: 268.10.4/396 - Release Date: 7/24/2006
------------------------------------------------
This e-mail, and any attachments thereto, is confidential and is intended only
for the individual(s) named. If you are not the intended recipient, please let
us know by e-mail reply and delete it from your system; do not copy/save this
e-mail or disclose its contents to anyone. E-mail transmissions cannot be
guaranteed to be secure or error-free as the transmission could be interrupted,
corrupted, lost, destroyed, altered, arrive late or contain viruses.
ObjectWave does not accept liability for any errors or omissions in the
contents of this e-mail which arise as a result of e-mail transmission. The
views expressed in this e-mail do not necessarily reflect those of ObjectWave
or its affiliates.
------------------------------------------------
--- End Message ---
--- Begin Message ---
On Mon, 2006-07-24 at 14:17 -0500, Franco Pawlisz wrote:
> My Client is specifically looking for a developer with strong front end PHP
> experience knowledge of Java and or Ruby is a major plus.
>
What the heck is "front end PHP", or am I misinterpreting the bad
punctuation (or lack thereof)?
--Paul
All Email originating from UWC is covered by disclaimer
http://www.uwc.ac.za/portal/uwc2006/content/mail_disclaimer/index.htm
--- End Message ---
--- Begin Message ---
While that kind of query structure can be a huge issue the biggest
problem, and performance penalty, occurs if the programmer is opening
and closing actual real connections. A good structure would use a
singleton connection that is opened only the first time it is called and
the rest of the time returns the connection object already opened. Or,
use pooling or similar types of things. You will get orders of magnitude
increase in speed by not reopening the database multiple times per page
especially if you are seeing 15,20 or especially hundreds of
connections. Sometimes though you have no real choice but to build a
system that has to generate multiple queries, so don't judge the page
simply on the number of queries but on the completity of the reporting
and the number of database connections opened(you will occasionally need
more than one if you arn't pulling all the results at once, using
cursors or partial retrievals instead and have to have multiple result
sets open at any given time).
James Kilbride
> -----Original Message-----
> From: Ryan A [mailto:[EMAIL PROTECTED]
> Sent: Monday, July 24, 2006 2:34 PM
> To: Robert Cummings
> Cc: php php
> Subject: Re: [PHP] database connections
>
> Hey Rob,
> Thanks for replying.
>
>
> > It's usually a sign of poor programming and/or purist OOP
> programming.
> >
> > When I say purist OOP programming...
> > I saw
> > one really retarded
> > implementation of this kind of system where an excess of
> 20000 queries
> > were issued to the database -- on a homepage nonetheless :/
>
>
> That IS retarded, I wonder why someone would want to do that.
>
>
> > I think it
> > was a testament to MySQLs speed that it performed within a
> reasonable
> > timeframe (under 3 seconds).
>
> MySql is a workhorse... def one of my top 3 DBs (I came into
> LAMP from Java/Oracle)
>
> I see you have seen some of the apps I was talking about,
> even though I have not mentioned any names to offend anyone.
>
> I was curious about this because I am working on a project
> (with other team players) and we have a way of building
> something with either lots more (complicated) code and fewer
> database calls or less code and multiple tables.
>
> If we take the second option (multiple tables) I am talking
> about maybe 15 database calls per page, and the site will get
> around (i guess) 300-750 requests for a page a minute at is peak.
>
> The good thing is it will be running on a dedicated server,
> sharing with around 5 of our other sites... no exceptionally
> great traffic other than mentioned above on the other sites
> either, plus most of the other sites are plain html sites.
>
>
> > > Or am I blowing smoke and MySql can handle that without a
> sweat on a
> > > shared hosting environment?
> > (with
> > > say....100 page requests per minute?)
> >
> > MySQL can probably handle it. But try not to do programming
> like that
> > yourself. Stuff like that
> gives PHP a bad name.
>
>
> I wouldnt be going to those extremes, was thinking of around
> 5-15 queries per page.
>
>
>
> Think we'll have a problem?
>
> Thanks!
> Ryan
>
> ------
> - The faulty interface lies between the chair and the keyboard.
> - Creativity is great, but plagiarism is faster!
> - Smile, everyone loves a moron. :-)
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam? Yahoo! Mail has the best spam protection
> around http://mail.yahoo.com
>
> --
> PHP General Mailing List (http://www.php.net/) To
> unsubscribe, visit: http://www.php.net/unsub.php
>
>
--- End Message ---
--- Begin Message ---
On Mon, 2006-07-24 at 15:15, Kilbride, James P. wrote:
> While that kind of query structure can be a huge issue the biggest
> problem, and performance penalty, occurs if the programmer is opening
> and closing actual real connections. A good structure would use a
> singleton connection that is opened only the first time it is called and
> the rest of the time returns the connection object already opened. Or,
> use pooling or similar types of things. You will get orders of magnitude
> increase in speed by not reopening the database multiple times per page
> especially if you are seeing 15,20 or especially hundreds of
> connections. Sometimes though you have no real choice but to build a
> system that has to generate multiple queries, so don't judge the page
> simply on the number of queries but on the completity of the reporting
> and the number of database connections opened(you will occasionally need
> more than one if you arn't pulling all the results at once, using
> cursors or partial retrievals instead and have to have multiple result
> sets open at any given time).
Well the system was using one of those not so insightful global database
connections so opening up the connection was not the problem. I'm well
aware of where bottlenecks occur, but I assure you such a system is not
very scalable over a LAN even if you only open one connection. But I
guess it doesn't matter if scalability isn't your concern... until
further down the road anyways... YOUCH. Either way, using a factory to
produce the objects from the row data is much more efficient since you
can use a single query to get all children in one shot. This is still
not perfect due to recursive nature (there are ways to do it without as
some forum discussion have pointed to but I forget the links) but
depending on the branchiness of the tree structure will provide a much
better response time.
As for judging, I guess I was the only one there to see something as
simple as retrieval of product categories and products get really out of
hand. I reduced the queries to under 200... and since we were still only
opening one connection I know the time cost was reduced to about 1/5.
The queries could have been reduced more but it was more work than the
customer felt was worth the additional savings.
Knowing what choices are available is part of competence. If all you see
is one choice, there may in fact only be one choice, or you may be too
inexperienced to see the others that exist.
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 ---
--- "Kilbride, James P." <[EMAIL PROTECTED]>
wrote:
> While that kind of query structure can be a huge
> issue the biggest
> problem, and performance penalty, occurs if the
> programmer is opening
> and closing actual real connections. A good
> structure would use a
> singleton connection that is opened only the first
> time it is called and
> the rest of the time returns the connection object
> already opened. Or,
> use pooling or similar types of things. You will get
> orders of magnitude
> increase in speed by not reopening the database
> multiple times per page
> especially if you are seeing 15,20 or especially
> hundreds of
> connections. Sometimes though you have no real
> choice but to build a
> system that has to generate multiple queries, so
> don't judge the page
> simply on the number of queries but on the
> completity of the reporting
> and the number of database connections opened(you
> will occasionally need
> more than one if you arn't pulling all the results
> at once, using
> cursors or partial retrievals instead and have to
> have multiple result
> sets open at any given time).
>
> James Kilbride
Hey James,
Thanks for replying.
Sorry, I guess i was not clear on that.
Its just one connection, I meant 15-20 queries not
connections.
Thanks!
Ryan
------
- The faulty interface lies between the chair and the keyboard.
- Creativity is great, but plagiarism is faster!
- Smile, everyone loves a moron. :-)
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
--- End Message ---
--- Begin Message ---
Dear All,
I'm having a problem replacing these bad characters from a feed.
Example:
<description>The United Kingdom<92>s National Arena Association has elected
Geoff Huckstep, the current CEO of the National Ice Centre and Nottingham
Arena, as chairman.</description>
The <92>is actually a single quote. I have these from some of the data dumps.
I can't figure out what exactly to strip.
When I view the file in vi they appear like <92> <93> <94> (highlighted in
blue like controll characters.
Can someone point me in the right direction to purge this from my feed?
Thank you,
Paul Nowosielski
Webmaster
--- End Message ---
--- Begin Message ---
Paul Nowosielski wrote:
Dear All,
I'm having a problem replacing these bad characters from a feed.
Example:
<description>The United Kingdom<92>s National Arena Association has elected
Geoff Huckstep, the current CEO of the National Ice Centre and Nottingham
Arena, as chairman.</description>
The <92>is actually a single quote. I have these from some of the data dumps.
I can't figure out what exactly to strip.
When I view the file in vi they appear like <92> <93> <94> (highlighted in
blue like controll characters.
Can someone point me in the right direction to purge this from my feed?
Thank you,
Paul Nowosielski
Webmaster
You want str_replace with arrays as parameters.
Regards, Adam Zey.
--- End Message ---
--- Begin Message ---
I understand I need to do a string replace.
Should I do it like so?
$search = array(chr(145),chr(146),chr(147),chr(148),chr(150),chr(151));
$replace = array("'","'",'"','"','-','-');
Is this what you mean?
Thank you,
--
Paul Nowosielski
Webmaster
On Monday 24 July 2006 16:12, Adam Zey wrote:
> Paul Nowosielski wrote:
> > Dear All,
> >
> > I'm having a problem replacing these bad characters from a feed.
> >
> > Example:
> > <description>The United Kingdom<92>s National Arena Association has
> > elected Geoff Huckstep, the current CEO of the National Ice Centre and
> > Nottingham Arena, as chairman.</description>
> >
> > The <92>is actually a single quote. I have these from some of the data
> > dumps. I can't figure out what exactly to strip.
> >
> > When I view the file in vi they appear like <92> <93> <94> (highlighted
> > in blue like controll characters.
> >
> > Can someone point me in the right direction to purge this from my feed?
> >
> >
> > Thank you,
> >
> > Paul Nowosielski
> > Webmaster
>
> You want str_replace with arrays as parameters.
>
> Regards, Adam Zey.
--- End Message ---
--- Begin Message ---
It works, thank you!
On Monday 24 July 2006 16:21, Paul Nowosielski wrote:
> I understand I need to do a string replace.
>
> Should I do it like so?
>
> $search = array(chr(145),chr(146),chr(147),chr(148),chr(150),chr(151));
> $replace = array("'","'",'"','"','-','-');
>
> Is this what you mean?
>
>
> Thank you,
> --
> Paul Nowosielski
> Webmaster
>
> On Monday 24 July 2006 16:12, Adam Zey wrote:
> > Paul Nowosielski wrote:
> > > Dear All,
> > >
> > > I'm having a problem replacing these bad characters from a feed.
> > >
> > > Example:
> > > <description>The United Kingdom<92>s National Arena Association has
> > > elected Geoff Huckstep, the current CEO of the National Ice Centre and
> > > Nottingham Arena, as chairman.</description>
> > >
> > > The <92>is actually a single quote. I have these from some of the data
> > > dumps. I can't figure out what exactly to strip.
> > >
> > > When I view the file in vi they appear like <92> <93> <94> (highlighted
> > > in blue like controll characters.
> > >
> > > Can someone point me in the right direction to purge this from my feed?
> > >
> > >
> > > Thank you,
> > >
> > > Paul Nowosielski
> > > Webmaster
> >
> > You want str_replace with arrays as parameters.
> >
> > Regards, Adam Zey.
--
Paul Nowosielski
Webmaster
--- End Message ---
--- Begin Message ---
Anyone have a PHP fragment that just prints a very simple html table
from the contents of a db result set? I don't want phpmyadmin or anything
remotely that complex. I want something that simply extracts the header
info and prints a basic HTML table. It should be about 10 lines of code
I suspect. If so, can you post it?
Mike
--
Michael B Allen
PHP Extension for SSO w/ Windows Group Authorization
http://www.ioplex.com/
--- End Message ---
--- Begin Message ---
Michael B Allen wrote:
Anyone have a PHP fragment that just prints a very simple html table
from the contents of a db result set? I don't want phpmyadmin or anything
remotely that complex. I want something that simply extracts the header
info and prints a basic HTML table. It should be about 10 lines of code
I suspect. If so, can you post it?
Mike
Writing code in a mail window, so forgive any errors or ugly code. This
will print a table with the first row as headers of the field names, and
each row after that is a database row. I hope.
$firstrow = true;
echo "<table>";
while ( $row = mysql_fetch_assoc($result) ) {
if ( $firstrow ) {
echo "<tr>" . implode("</tr><tr>", array_keys($row)) . "</tr>";
$firstrow = false;
}
echo "<tr>";
foreach ( $row as $value ) {
echo "<td>$value</td>";
}
echo "</tr>";
}
echo "</table>";
Essentially what it does is, loop over each row, and if we're the first
row, write out the headers, and for all rows, write out each field. I
haven't tested this, just typed it up from memory now, so I'm not sure
if it'll compile.
Regards, Adam Zey.
--- End Message ---
--- Begin Message ---
Adam Zey wrote:
Michael B Allen wrote:
Anyone have a PHP fragment that just prints a very simple html table
from the contents of a db result set? I don't want phpmyadmin or anything
remotely that complex. I want something that simply extracts the header
info and prints a basic HTML table. It should be about 10 lines of code
I suspect. If so, can you post it?
Mike
Writing code in a mail window, so forgive any errors or ugly code. This
will print a table with the first row as headers of the field names, and
each row after that is a database row. I hope.
$firstrow = true;
echo "<table>";
while ( $row = mysql_fetch_assoc($result) ) {
if ( $firstrow ) {
echo "<tr>" . implode("</tr><tr>", array_keys($row)) . "</tr>";
$firstrow = false;
}
echo "<tr>";
foreach ( $row as $value ) {
echo "<td>$value</td>";
}
echo "</tr>";
}
echo "</table>";
Essentially what it does is, loop over each row, and if we're the first
row, write out the headers, and for all rows, write out each field. I
haven't tested this, just typed it up from memory now, so I'm not sure
if it'll compile.
Regards, Adam Zey.
On second thought, I'm not sure why I didn't use implode for the second
one too, it makes things simpler (and possibly faster):
$firstrow = true;
echo "<table>";
while ( $row = mysql_fetch_assoc($result) ) {
if ( $firstrow ) {
echo "<tr>" . implode("</tr><tr>", array_keys($row)) . "</tr>";
$firstrow = false;
}
echo "<tr>" . implode("</tr><tr>", $row) . "</tr>";
}
echo "</table>";
And BTW, this code assumes that you've done your MySQL query and have
$result as the return value of a mysql_query() call or something.
Regards, Adam Zey.
--- End Message ---
--- Begin Message ---
On Monday 24 July 2006 18:50, Adam Zey wrote:
> Writing code in a mail window, so forgive any errors or ugly code. This
> will print a table with the first row as headers of the field names, and
> each row after that is a database row. I hope.
>
> $firstrow = true;
> echo "<table>";
> while ( $row = mysql_fetch_assoc($result) ) {
> if ( $firstrow ) {
> echo "<tr>" . implode("</tr><tr>", array_keys($row)) . "</tr>";
> $firstrow = false;
> }
>
> echo "<tr>";
> foreach ( $row as $value ) {
> echo "<td>$value</td>";
> }
> echo "</tr>";
> }
> echo "</table>";
You don't need to pull the headers from the data, actually. You can access
the fields in the result object directly.
$result = mysql_query($sql);
echo "<table>";
echo "<tr>";
$num_fields = mysql_num_fields($result);
for($i=0; $i < $num_fields; $i++) {
echo "<th>", mysql_field_name($result, $i), "</th>";
}
echo "</tr>";
while ( $row = mysql_fetch_row($result) ) {
echo "<tr><td>" . implode("</td><td>", $row) . "</td></tr>";
}
echo "</table>";
The above should work, I think. :-)
--
Larry Garfield AIM: LOLG42
[EMAIL PROTECTED] ICQ: 6817012
"If nature has made any one thing less susceptible than all others of
exclusive property, it is the action of the thinking power called an idea,
which an individual may exclusively possess as long as he keeps it to
himself; but the moment it is divulged, it forces itself into the possession
of every one, and the receiver cannot dispossess himself of it." -- Thomas
Jefferson
--- End Message ---
--- Begin Message ---
Ok, I've been tinkering a little. This isn't "simple" but it's not a
lot of code either.
Basically the user supplies an array of "cell renderers" associated
with column names. Each renderer is a function name that will be called
to modify an array() representing an HTML TD element. The result is
printed to yield an HTML table. I think this is pretty extensible. You
can render columns or individual cells differently depending on the text
or position of the coloumn or cell. You can format numbers and dates,
render buttons, ... whatever you want.
The first column renderer below renders every odd column a light shade
of grey. The second renderer demonstrates formmating a timestamp. The
third renderer colors the background of an individual cell green if the
numeric value is greater than 1000.
I'm a C person myself. Can someone clean this up / improve on it (e.g. how
can I pass parameters to renderers?).
Mike
function db_cr_shade_odd($td, $i) {
if (($i % 2) == 0) {
$td['style'] = "background-color: #c0c0c0;";
}
return $td;
}
function db_cr_unix_ts_mdty($td, $i) {
if (isset($td['#text'])) {
$td['#text'] = date("M j, Y g:i a", $td['#text']);
}
return $td;
}
function db_result_print($result, $names, $renderers, $default_renderer) {
echo "<tr>\n";
$i = 0;
while ($i < mysql_num_fields($result)) {
$meta = mysql_fetch_field($result, $i);
$name = $meta->name;
if (isset($renderers[$name])) {
$renderers[$i] = $renderers[$name];
}
if (isset($names[$name])) {
$name = $names[$name];
}
echo "<th>$name</td>\n";
$i++;
}
echo "</tr>\n";
while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
echo "<tr>";
$i = 0;
foreach ($row as $str) {
$td = array('#text' => $str);
if ($default_renderer) {
$td = call_user_func($default_renderer, $td, $i);
}
if (isset($renderers[$i])) {
$td = call_user_func($renderers[$i], $td, $i);
}
echo "<td";
foreach ($td as $attr => $value) {
if (substr($attr, 0, 1) != '#') {
echo " $attr=\"$value\"";
}
}
echo ">" . $td['#text'] . "</td>";
$i++;
}
echo "</tr>\n";
}
}
// EXAMPLE USAGE
// custom renderer specific to invoice report
function db_cr_gt_1000($td, $i) {
$amount = $td['#text'];
if ($amount > 1000.00) {
$td['style'] = "background-color: #00ff00;";
}
return $td;
}
// pretty column names
$names = array(
"invoice_id" => "ID",
"invoice_date" => "Date",
"invoice_amount" => "Amount",
"invoice_transaction_id" => "Txn. ID",
"invoice_approval_code" => "App. Code",
"invoice_name" => "Name",
"invoice_email" => "Email",
"invoice_company" => "Company");
// renderers
$renderers = array(
"invoice_date" => "db_cr_mysql_ts_mdyt",
"invoice_amount" => "db_cr_gt_1000");
echo "<table class=\"d\" border='0' cellpadding=\"3\">\n";
db_result_print($result, $names, $renderers, "db_cr_shade_odd");
echo "</table>\n";
--
Michael B Allen
PHP Extension for SSO w/ Windows Group Authorization
http://www.ioplex.com/
--- End Message ---
--- Begin Message ---
Hi gang:
Why does starting my php script with --
<?xml version="1.0" encoding="utf-8"?>
-- stop it from running?
I would like to use php in a page, but the page has to begin with a
xml declaration to generate a quirksmode for IE6 and under while
permitting IE7 to be left in standards mode.
We've tried it in both Wordpress and Textpattern and both are php and
neither are able to parse a document with an xml declaration above
the header.
Is this problem solvable? I've been told that better minds have
already tried and failed to resolve this issue.
So, what say you group?
Thanks in advance for any replies, comments, explanations, or solutions.
tedd
--
-------
http://sperling.com http://ancientstones.com http://earthstones.com
--- End Message ---
--- Begin Message ---
Disable short tags.
If short tags are enabled, the PHP parser sees the <? and switches into PHP
mode. It then starts parsing the "xml" and sees that it's not proper PHP,
and freaks out.
You can:
a) Use PHP to print out the XML declaration as a string:
<?php print '<?xml version="1.0" encoding="utf-8"?>'; ?>
b) Disable short tags so that the PHP parser ignores <? and only recognizes
<?php.
The correct answer is (b). (PHP 6 won't even have short tags, so get used to
not having them.)
On Monday 24 July 2006 20:42, tedd wrote:
> Hi gang:
>
> Why does starting my php script with --
>
> <?xml version="1.0" encoding="utf-8"?>
>
> -- stop it from running?
>
> I would like to use php in a page, but the page has to begin with a
> xml declaration to generate a quirksmode for IE6 and under while
> permitting IE7 to be left in standards mode.
>
> We've tried it in both Wordpress and Textpattern and both are php and
> neither are able to parse a document with an xml declaration above
> the header.
>
> Is this problem solvable? I've been told that better minds have
> already tried and failed to resolve this issue.
>
> So, what say you group?
>
> Thanks in advance for any replies, comments, explanations, or solutions.
>
> tedd
> --
> -------
> http://sperling.com http://ancientstones.com http://earthstones.com
--
Larry Garfield AIM: LOLG42
[EMAIL PROTECTED] ICQ: 6817012
"If nature has made any one thing less susceptible than all others of
exclusive property, it is the action of the thinking power called an idea,
which an individual may exclusively possess as long as he keeps it to
himself; but the moment it is divulged, it forces itself into the possession
of every one, and the receiver cannot dispossess himself of it." -- Thomas
Jefferson
--- End Message ---
--- Begin Message ---
Hi Jay ,
I am not in the javascript group.
Btw , i have added document.forms['listfrm'].pageid.value in the
page , but the form is not submitted ?
var pageid = document.forms['listfrm'].pageid.value;
var urlpath = "../listflag.php?start=&pageID="+pageid;
document.forms['listfrm'].method = 'post'; --> did not submit form
at all
document.forms['listfrm'].action = urlpath;
document.forms['listfrm'].submit;
Any ideas why ? How to submit form when user change value in the select
tag ?
Thanks
Jay Blanchard wrote:
[snip]
It will produce the html tag as shown below:
<script language="JavaScript">
function gotoPage(){
var urlpath = "../listflag.php?start=&pageID="+3;
document.forms['listfrm'].method = 'post';
document.forms['listfrm'].action = urlpath;
document.forms['listfrm'].submit;
}
</script>
<form name="listfrm">
Go to Page:<select name="pageid" class="inputfield"
onchange="javascript:gotoPage()">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
</select>
</form>
I tried using onchange in the select tag,but it did not work. It go to
the javascript but the form is not submitted .
Anyideas why?
[/snip]
In gotoPage() you're not referencing the value of pageid
(document.forms['listfrm'].pageid.value). More of a JavaScript question,
are you a member of a JavaScript list?
--- End Message ---
--- Begin Message ---
Hi Jay ,
I am not in the javascript group.
Btw , i have added document.forms['listfrm'].pageid.value in the
page , but the form is not submitted ?
var pageid = document.forms['listfrm'].pageid.value;
var urlpath = "../listflag.php?start=&pageID="+pageid;
document.forms['listfrm'].method = 'post'; --> did not submit form
at all
document.forms['listfrm'].action = urlpath;
document.forms['listfrm'].submit;
Any ideas why ? How to submit form when user change value in the select
tag ?
Thanks
Jay Blanchard wrote:
[snip]
It will produce the html tag as shown below:
<script language="JavaScript">
function gotoPage(){
var urlpath = "../listflag.php?start=&pageID="+3;
document.forms['listfrm'].method = 'post';
document.forms['listfrm'].action = urlpath;
document.forms['listfrm'].submit;
}
</script>
<form name="listfrm">
Go to Page:<select name="pageid" class="inputfield"
onchange="javascript:gotoPage()">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
</select>
</form>
I tried using onchange in the select tag,but it did not work. It go to
the javascript but the form is not submitted .
Anyideas why?
[/snip]
In gotoPage() you're not referencing the value of pageid
(document.forms['listfrm'].pageid.value). More of a JavaScript question,
are you a member of a JavaScript list?
--- End Message ---
--- Begin Message ---
Nils Holland wrote:
My guess is that PHP only sees / compares the strings up to a
certain position. Is this possible? And if so, is there any way
around this, so that my whole string is seen?
Greetings and thanks in advance,
Nils
Maybe it's interpreting something as a number somewhere. Did you
try using === instead of == for your comparisons?
Ah, thanks, that made it work! :-)
PS: Why is your license key so insanely long, and why doesn't it
use alphanumeric characters to reduce the length?
Very good question, I should probably ask the person that came up
with the way this license key works. Even if it has to be this long
"internally", I've been thinking about using some encoding / hashing
technique to make it smaller at least when it's being passed to the
PHP script. For the sake of testing, however, I didn't really care.
Greetings and thanks again!
Nils
--- End Message ---