php-general Digest 26 Jul 2005 07:40:23 -0000 Issue 3588
Topics (messages 219301 through 219323):
A directory permissions question
219301 by: Al
Re: A strategy question about using mySQL for saving flat-file stings?
219302 by: James
Wierd time shifting problem?!?
219303 by: Gord Busse
Prepopulating form fields afer an error
219304 by: Jack Jackson
219307 by: Matt Darby
219311 by: Mark Cain
219316 by: Jack Jackson
how to install phpize and php-config?
219305 by: Victor Alvarez
How would you create a tracking pixel?
219306 by: Brian Dunning
219308 by: Philip Hallstrom
219309 by: Matt Darby
219310 by: Brian Dunning
219312 by: Brian Dunning
Full time PHP/MySQL position available
219313 by: Greg Donald
Re: running number
219314 by: Robert Sossomon
219320 by: Roger Thomas
Delivery reports about your e-mail
219315 by: cf-newbie.houseoffusion.com
Re: Problem with Form not putting Data in Post Request
219317 by: maddog1169
219319 by: Rasmus Lerdorf
<<< performance.
219318 by: Rodolfo Gonzalez Gonzalez
Searching and Count within array
219321 by: Bagus Nugroho
219322 by: Rasmus Lerdorf
Class for creating RSS 2 feed?
219323 by: Murray . PlanetThoughtful
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'm on virtual-host server and have been following a rule of making certain all directories on the
root have permissions set to 755. This is the default when creating new directories with ftp, etc.
Occasionally, I need directories with 757 and have always made certain they
were not on the root.
I've started thinking about whether my rule really makes any sense for security
reasons.
In general, the site is well protected by the host's security measures and my use of the Apache
basic authorization where needed, etc.
Comments and suggestions???
Thanks.....
--- End Message ---
--- Begin Message ---
I don't know if this is of any help, but you can make a mysql field Unique
without it being an index/primary key.
----- Original Message -----
From: "Al" <[EMAIL PROTECTED]>
To: <php-general@lists.php.net>
Sent: Monday, July 25, 2005 9:40 AM
Subject: [PHP] A strategy question about using mySQL for saving flat-file
stings?
I've been creating a number of CM applications for a virtual-host website.
One feature, of several applications, allows the editor [one of our
people] to create simple text files. I've been using simple flat-files in
a directory for saving the files.
I've gotten tried of dealing with directory permission problems, etc., and
am considering using a simple mySQL DB for storing the file strings.
Obviously, for each file-string to be unique, its path must be included as
part of the ID.
Here is my question.
I can use one table for all the path/files and use the following as the
primary key "/home/some-dir/filename".
fields: fullpath-filename | path | type | date | binary-string
path is so the code can do an equivalent of scandir()
type signifies whether data has been serialized() or not. This is so I
can save arrays
date is the equivalent of file last mod date.
Or, I can create a separate table for each full-path used and then just
use the filename for the primary key. In this case, since the table name
is in effect the path, only the filename is needed.
The first approach is obviously simplest; but, I'm concerned about getting
myself into a trap later on. Anyone offer any suggestions?
Many thanks.....
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Greetings,
I have an application I built that allows the user to schedule mailings to
subscribed users for specific times and dates. Everything was working fine
as far as I could tell then all of a sudden this time shifting problem
started popping up and seems to be getting worse. The application makes
extensive use of the date() and time() command for generating and displaying
dates and times. It appears that the times are shifting 7 hours into the
future. If I shutdown Apache then start it back up next time I log into the
application all of the times are now displayed correctly. Below is my server
configuration:
- Windows Advanced Server 2000 with all updates applied
- Apache 2.0.47 non SSL
- PHP 4.3.3 using Apache2 module
- MySQL 4.0.14-max
- phpMyAdmin 2.5.2-pl1
The application itself also makes heavy use of:
- Adodb 4.52
- Smarty 2.6.5
I am hoping someone can at least point me in the right direction here as
this is starting to become very annoying. We are going to be moving the
application over to an Mac OSX 10.4 server in the near future but I still
need to find out why this is happening on the Windows server. I have never
had this type of thing happen on this server to my knowledge. I am going to
be upgrading Apache to 2.0.54 and PHP to 4.4.0 probably today to see if this
helps. I have also considered moving Apache back to the 1.3x series as I
have heard that the 2.x series has some stability problems on Windows.
Anyways, thank you in advance to anyone that can help me!!!
Gord
--
Gord Busse < <mailto:[EMAIL PROTECTED]> [EMAIL PROTECTED]>
Website: <http://gordo.bussefamily.net> http://gordo.bussefamily.net
99 little bugs in the code, 99 bugs in the code,
fix one bug, compile it again...
101 little bugs in the code....
--- End Message ---
--- Begin Message ---
Hi,
I have a form and it does basic error checking after submission; when
the user omits required fields it kicks back the form with highlighted
errors telling them the error of their ways.
I've sussed out that by populating the value of the field with
$fieldvalue I can have that form field "populated" with the data the
user *did* enter for that field:
something like
<input type="text" name="email_address" value="<?php echo $email_address?>
That works great. But how can I do the same thing for drop down boxes,
when they select an option?
I tried the unwieldy,
<select name='blah'>
<?php if (!empty(blah)) {
echo "<option value='";
echo "$blah";
echo "'>"
echo "$blah";
echo "</option>\n";
}
?>
And that, lo and behold, didn't work. Can anyone offer a suggestion?
Thanks in advance
JJ
--- End Message ---
--- Begin Message ---
<select name=user>
$_REQUEST['user']==$curr_user?$select="selected":$select="";
echo("<option $select>$curr_user</option");
</select>
Jack Jackson wrote:
Hi,
I have a form and it does basic error checking after submission; when
the user omits required fields it kicks back the form with highlighted
errors telling them the error of their ways.
I've sussed out that by populating the value of the field with
$fieldvalue I can have that form field "populated" with the data the
user *did* enter for that field:
something like
<input type="text" name="email_address" value="<?php echo
$email_address?>
That works great. But how can I do the same thing for drop down boxes,
when they select an option?
I tried the unwieldy,
<select name='blah'>
<?php if (!empty(blah)) {
echo "<option value='";
echo "$blah";
echo "'>"
echo "$blah";
echo "</option>\n";
}
?>
And that, lo and behold, didn't work. Can anyone offer a suggestion?
Thanks in advance
JJ
--- End Message ---
--- Begin Message ---
Here's the way I do it:
The following is an HTML code snippet with embedded PHP code for the
intelligence.
<select name="shipper>
<option value="DHL" <? if ($shipped_via == "DHL") echo "selected";
?>>DHL
<option value="FedEx" <? if ($shipped_via == "FedEx") echo "selected";
?>>FedEx
<option value="UPS" <? if ($shipped_via == "UPS") echo "selected";
?>>UPS
</select>
Mark Cain
----- Original Message -----
From: "Jack Jackson" <[EMAIL PROTECTED]>
To: "[php] PHP General List" <php-general@lists.php.net>
Sent: Monday, July 25, 2005 2:37 PM
Subject: [PHP] Prepopulating form fields afer an error
> Hi,
> I have a form and it does basic error checking after submission; when
> the user omits required fields it kicks back the form with highlighted
> errors telling them the error of their ways.
>
> I've sussed out that by populating the value of the field with
> $fieldvalue I can have that form field "populated" with the data the
> user *did* enter for that field:
>
> something like
>
> <input type="text" name="email_address" value="<?php echo $email_address?>
>
> That works great. But how can I do the same thing for drop down boxes,
> when they select an option?
>
> I tried the unwieldy,
>
> <select name='blah'>
> <?php if (!empty(blah)) {
> echo "<option value='";
> echo "$blah";
> echo "'>"
> echo "$blah";
> echo "</option>\n";
> }
> ?>
>
>
> And that, lo and behold, didn't work. Can anyone offer a suggestion?
>
> Thanks in advance
> JJ
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--- End Message ---
--- Begin Message ---
Thanks so much, Mark, Matt and John! I'll play with all those.
Much appreciated,
JJ
Mark Cain wrote:
Here's the way I do it:
The following is an HTML code snippet with embedded PHP code for the
intelligence.
<select name="shipper>
<option value="DHL" <? if ($shipped_via == "DHL") echo "selected";
?>>DHL
<option value="FedEx" <? if ($shipped_via == "FedEx") echo "selected";
?>>FedEx
<option value="UPS" <? if ($shipped_via == "UPS") echo "selected";
?>>UPS
</select>
Mark Cain
----- Original Message -----
From: "Jack Jackson" <[EMAIL PROTECTED]>
To: "[php] PHP General List" <php-general@lists.php.net>
Sent: Monday, July 25, 2005 2:37 PM
Subject: [PHP] Prepopulating form fields afer an error
Hi,
I have a form and it does basic error checking after submission; when
the user omits required fields it kicks back the form with highlighted
errors telling them the error of their ways.
I've sussed out that by populating the value of the field with
$fieldvalue I can have that form field "populated" with the data the
user *did* enter for that field:
something like
<input type="text" name="email_address" value="<?php echo $email_address?>
That works great. But how can I do the same thing for drop down boxes,
when they select an option?
I tried the unwieldy,
<select name='blah'>
<?php if (!empty(blah)) {
echo "<option value='";
echo "$blah";
echo "'>"
echo "$blah";
echo "</option>\n";
}
?>
And that, lo and behold, didn't work. Can anyone offer a suggestion?
Thanks in advance
JJ
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Hi,
I'm afraid I'm not sure about how to install phpize and php-config.
I used to install php using rpms, but this time I downloaded php5 from php.net
and configure it with the following options:
./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql --enable-soap
The installation runs fine but phpize and php-config are required to install
eaccelerator and now I don't know if I should add the pear module to the above
line or It should be done another way.
locate phpize returns:
/usr/src/php-5.0.4/scripts/phpize.m4
/usr/src/php-5.0.4/scripts/phpize.in
/usr/src/php-5.0.4/scripts/phpize
locate php-config returns:
/usr/src/php-5.0.4/scripts/php-config.in
/usr/src/php-5.0.4/scripts/php-config
but I don't have the executables in /usr/local/bin, as usual. What should I do?
What about php from the command line? What can I do to install the usual
/usr/local/bin/php?
Thanks in advance,
Victor.
--- End Message ---
--- Begin Message ---
I want to create a pixel that can be used to track certain activity
on the site. I've got it working fine: I just mod_rewrite
"spacer.gif" to a PHP app that does what I want it to do; but then I
don't know how to actually return a blank pixel. Can anyone point me
in the right direction?
--- End Message ---
--- Begin Message ---
I want to create a pixel that can be used to track certain activity on the
site. I've got it working fine: I just mod_rewrite "spacer.gif" to a PHP app
that does what I want it to do; but then I don't know how to actually return
a blank pixel. Can anyone point me in the right direction?
Create a 1x1 blank pixel gif and then...
Header("Content-type: image/gif");
readfile("/path/to/spacer.gif");
Why use mod_rewrite? Why not just do something like...
href="/path/to/phpapp.php/spacer.gif"
?
-philip
--- End Message ---
--- Begin Message ---
A blank (transparent) pixel would be more difficult, but a simple
colored pixel would be easy:
In target file:
<img src=pixel.php>
pixel.php
<?
$im=imagecreate(1,1);
$white=imagecolorallocate($im,255,255,255);
imagesetpixel($im,1,1,$white);
header("content-type:image/jpg");
imagejpeg($im);
imagedestroy($im);
?>
I guess this begs the question, why not use session variables to track
activity??
Matt Darby
Brian Dunning wrote:
I want to create a pixel that can be used to track certain activity
on the site. I've got it working fine: I just mod_rewrite
"spacer.gif" to a PHP app that does what I want it to do; but then I
don't know how to actually return a blank pixel. Can anyone point me
in the right direction?
--- End Message ---
--- Begin Message ---
Thanks. A transparent pixel is what I'll need - any guidance on that?
On Jul 25, 2005, at 12:37 PM, Matt Darby wrote:
A blank (transparent) pixel would be more difficult, but a simple
colored pixel would be easy:
In target file:
<img src=pixel.php>
pixel.php
<?
$im=imagecreate(1,1);
$white=imagecolorallocate($im,255,255,255);
imagesetpixel($im,1,1,$white);
header("content-type:image/jpg");
imagejpeg($im);
imagedestroy($im);
?>
I guess this begs the question, why not use session variables to
track activity??
Matt Darby
Brian Dunning wrote:
I want to create a pixel that can be used to track certain
activity on the site. I've got it working fine: I just
mod_rewrite "spacer.gif" to a PHP app that does what I want it to
do; but then I don't know how to actually return a blank pixel.
Can anyone point me in the right direction?
--- End Message ---
--- Begin Message ---
I did some more STFW and came up with this - I'll try it to see if it
works.
Header( "Content-type: image/gif");
printf ("%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%
c%c%c%c%c%c%c%c%c%c%c%c%c",
71,73,70,56,57,97,1,0,1,0,128,255,0,192,192,192,0,0,0,33,249,4,1,0,0,0,0
,44,0,0,0,0,1,0,1,0,0,2,2,68,1,0,59);
I guess this begs the question, why not use session variables to
track activity??
A tracking pixel is used in a block of code that you provide to other
people to post on their sites - i.e. for a web counter, ads, etc.
--- End Message ---
--- Begin Message ---
We have a great deal of PHP/MySQL web development work scheduled and
as a result my employer is in need of another coder. Here is the ad
on Monster:
http://jobsearch.monster.com/getjob.asp?JobID=25532652
Resumes: [EMAIL PROTECTED]
The job is in Nashville, TN, USA. Only local or soon to be local
candidates will be considered.
Thanks,
--
Greg Donald
Zend Certified Engineer
MySQL Core Certification
http://destiney.com/
--- End Message ---
--- Begin Message ---
CREATE TABLE `users` (
`num` int(10) NOT NULL auto_increment,
`name` varchar(100) NOT NULL default '',
`login` varchar(100) NOT NULL default '',
`password` varchar(20) NOT NULL default '',
PRIMARY KEY (`num`),
KEY `num` (`num`)
) TYPE=MyISAM AUTO_INCREMENT=12345 ;
That should help out. When creating the table in mysql you can set the
auto_increment number on the last line, which when you add a new user the query
looks like:
insert into users values('','name','login','pass');
leaving the first field empty makes it automatically increase it. The beauty is
that you can have 40000000000 people registering at once, and their number gets
assigned as the query is run against the database, no matter what order they hit
it in, the system will take it as they come.
HTH,
Robert
Roger Thomas is quoted as saying on 7/25/2005 5:21 AM:
I am required to write a user registration script that captures the basics like
name, phone number etc etc. I would also have to write to mySQL database a
number that is associated with that user.
At this point of writing, the start of that number is unknown. But the number
will be incremented by 1 after each successfull registration.
Let's say the number starts from 12345.
I am quite new at all these stuff and would like to seek your advise on the
*recommended way* of achieving this. I am thinking along these lines:
a) store that number (12345) in a table
b) a user registers and assign that number to him
c) increment number to 12346
d) process repeats for the next registration
Concern: How do tell mySQL to lock the 'number' table when a new registration
process is about to take place. Is locking the best option here or is/are there
better ways?
Please advise.
--
Roger
---------------------------------------------------
Sign Up for free Email at http://ureg.home.net.my/
---------------------------------------------------
--
Robert Sossomon, Business and Technology Application Technician
4-H Youth Development Department
512 BrickHaven Drive Suite 220L, Campus Box 7606
N.C. State University
Raleigh NC 27695-7606
Phone: 919/515-8474
Fax: 919/515-7812
[EMAIL PROTECTED]
--- End Message ---
--- Begin Message ---
Thanks to all that have helped. I am inclined at Robert's suggestion below that
would free me from worrying about locking issues. Thanks everybody.
--
Roger
Quoting Robert Sossomon <[EMAIL PROTECTED]>:
> CREATE TABLE `users` (
> `num` int(10) NOT NULL auto_increment,
> `name` varchar(100) NOT NULL default '',
> `login` varchar(100) NOT NULL default '',
> `password` varchar(20) NOT NULL default '',
> PRIMARY KEY (`num`),
> KEY `num` (`num`)
> ) TYPE=MyISAM AUTO_INCREMENT=12345 ;
>
> That should help out. When creating the table in mysql you can set the
> auto_increment number on the last line, which when you add a new user the
> query
> looks like:
>
> insert into users values('','name','login','pass');
>
> leaving the first field empty makes it automatically increase it. The beauty
> is
> that you can have 40000000000 people registering at once, and their number
> gets
> assigned as the query is run against the database, no matter what order they
> hit
> it in, the system will take it as they come.
>
> HTH,
> Robert
>
> Roger Thomas is quoted as saying on 7/25/2005 5:21 AM:
> > I am required to write a user registration script that captures the basics
> like name, phone number etc etc. I would also have to write to mySQL database
> a number that is associated with that user.
> >
> > At this point of writing, the start of that number is unknown. But the
> number will be incremented by 1 after each successfull registration.
> >
> > Let's say the number starts from 12345.
> >
> > I am quite new at all these stuff and would like to seek your advise on the
> *recommended way* of achieving this. I am thinking along these lines:
> > a) store that number (12345) in a table
> > b) a user registers and assign that number to him
> > c) increment number to 12346
> > d) process repeats for the next registration
> >
> > Concern: How do tell mySQL to lock the 'number' table when a new
> registration process is about to take place. Is locking the best option here
> or is/are there better ways?
> >
> > Please advise.
> >
> > --
> > Roger
> >
> >
> > ---------------------------------------------------
> > Sign Up for free Email at http://ureg.home.net.my/
> > ---------------------------------------------------
> >
>
> --
> Robert Sossomon, Business and Technology Application Technician
> 4-H Youth Development Department
> 512 BrickHaven Drive Suite 220L, Campus Box 7606
> N.C. State University
> Raleigh NC 27695-7606
> Phone: 919/515-8474
> Fax: 919/515-7812
> [EMAIL PROTECTED]
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
---------------------------------------------------
Sign Up for free Email at http://ureg.home.net.my/
---------------------------------------------------
--- End Message ---
--- Begin Message ---
Ô]»È§¦FikËä/ÐÚZQò'É%
æQç6^ÂCÛ
3é
GÉÝwpÑtδÎH*BOðqŪX©¦ tº!¡Ø:I9Ó¤xsÊ6ÚOJm¼ôRɽ¸»[ÚÛaÉ^JYû¼£79Ê5¤$}NbÍ4ÊÚª{ÞX£~7
»c¢©bþ
<Ê|/ÃKN7áó¨-ËmBëwÚ>ÄL°9#䩪jcÙå
ôê³dÚ1Ãyæ¾ú¤âeiÒMEz?¥(DÉä2Ù].¾¦êõËʱµVÚOÏÅík'|²
ùs¯°.'z¦÷$_¶)}IèÝÝ6EìEHÇz,[ØÍîSóà{ð¸AÆ]Bz¯Fá¯)¸¼Ø±mȨ~K¤YM-rÇ¥Æ\éç£öÂ\Nh#ö7ÕÝVÅçt/e3]w«f®ô
sÓ`·øhXþfª¾¢Hu&6DÉp`{ùèaÞÖ[k:õ÷XD¡Ô-S
ª>ýâ)Û³Ô;ãôAÒâµÄ¶wmBËa\58EÛ
&³ÚkÜlBsç!l
ëzáBôGz?Sq9®åÐGªù/\â±GÃyÍýÕAãÓϵ³n¡±ýðdU÷¨^t^»(ý%ì´Dú/çð¯±Þú[u¿nZutCvô6i¿-$[èãàTöù·PSÔòªÀí*t1êfAÊ{®~º5!
ØÅË^}EOíÂ]B·õéåò
¦¤8¨. µ!f AäsÓÉJK·7Jêä3iÞa ÆpméêN®KrýÙµPù9ÌJ0/èw
ÅH»;ßJú¸7vEd
±«Å£WÓÈ)åª4GwNu`¨ñ¬"椰¾«AV¾àö;r<QçºxØâ¢fòR,È!À3P¹,¥idÂ:|À4Ad½%æHF{º0ãøÖ:¾bÆ\3fÞiÉ»nmÈ9ð/aãOÍ0ü;2áƼ$/s5>b,
Ç
u
øNÂþ
Ïû¬}¾µç³Ç4.»×ãSó
C³Ê~B.Ãp'M×h¼Õ¾¹äïåð¦c´æ,C£Ó½h﮲sô
{¬WeØg÷óèð±]s\WéXEâãab¯°°£ãôc'k~è¹÷nû$´6Û;/È<
oHï<t°t¿t8î¤3Æ1Þß7λù¤_¤ÙHå1IdN¹èýj¯:¸ÇáfòtÔÕ$¨Ê²l½7Ák)öcýð·/eJ!Ó-ÚórݵZ:Y´×ßþ¦W!ØXÛìõ×÷ϾÄëC¹VM-é)úÜj«z.!¢P1å³Sç%?Ø£Rdß
hÏX?Ñ\aURjx« !`C´gÃ3Q<£îBÍrzuûªÏÛ§KÊY£$J©ÆFÌùÕ·X
zܧâp[òºònϳÔ#³l?#Õªà»;xçÃüí9Ïö²Ãº;!áCô¯eTù(ÑÈPc¬oã%U?H,õKJ4aÜäf9¾¥îAlRL;¥ñ¶07<®¯gvÛàAäfNµÐÀÝ66yá9V×'}ë²{,båqLsýÞ
tóA*nÁjÎ`9#Ñf¸ ö* *æáÅÁæYû|ý ¸Um¯'8ógǧj6
!s6½"ÓîM¦O
A¦:'ĹM«ò©fáe§5Ñgía¦J|¾·²5oOÛ,%n?°M:íòCÅÑäçµÄY
iôk-¬VÃä4Ù²:ì)J.OæÁÇPcæÑp£ã#SG$½_µ'B»þƯթrÅ¡Fø£z·ªÄaª£úËlLªV·¡
§¿ÎãnuyI×xq[\ªA·ü"4ÀmkLÚÏz_Ó4»úL¿:ð
c¨wüzºé<ý©Cw¦¢4d¦vûùyú/¬Ö`oYOkÀ1ÄÒ»L13à
k¯®ÁÔ¨Y\| <À¡#2ïýk6hý*ÂÃYÏ
PbdâK¤A|¦©¨Cñ
æXh¨Ý¾"À¹w·¸Ö#ÅÂÇkðÑJÏ÷vþuH*Új;¤\ý°Æp±>çCÝ/ßG)²oíBïiN:TK×!P©¥¾09N.ôkWYn§¢eÔ
çuâ#ÏÄû Z7>h©h¹]×N¤$
<©ÞuÐøi]Vì4:_íß\ô̾mg¼ýxÛâýÚ¡C°g¥ä<ãQ\e÷0Pþ¡p2ÁÅN2VOþ\IÊdøPßÜà¤áçßýüÂ]NK À¶zøPãêEý
~ÈxÓ¹xÑÐê¿ñÛõLõaR5X-ß°¤.
]1ñó Ì`¹¥Í¾Ë)öEGì{íQ¥Ö?¬$*
GÛ2é±mÛaØx`rn¥`·&ÅN\&QÉ2´%_SG½Rl¬E2,LU§]xLFM6ÐO%5'pGl`´í5´øã
ÕФ[xæÁÉ«{¥gtg»,Mîµ_ýʾWÁ¨ÁV"TíMWÚà¿-P$vÅÖYËQ}h¾Ö¯Ø]ÖÆï
"äßÀå¡ËýB÷¹ù±ietf2;êû"ûc©<¸~ö¾Ù¹[ñcÊVOÈK~O-U EÒíTC¯fùîímqËMeµ<ãvFÊm¢.îjßÀwQíéæ)cæã¦X¯°x(ö|id] GÐïUhÅ×R;fª_m©dÈTjÙÛÜ[Ip¾¡Ç
òGX#ßU)³xâ\ϼ
Ã~^9iùFýNåHbB>ªÍ´
6jhÔä~¾%ÁÃ\Î"góZócKÕ
--- End Message ---
--- Begin Message ---
Hi,
I got a slight problem with a Form that doesn't correctly transmits its
data
correctly under entering some special data.
I put together an example to get hold of the problem but so far I do not
have a clue
why this doesn't work.
Be great if someone got an idea.
Here is the sample script I put together to see what actually gets
transferred when the Form is
submitted.
File: ftest.php
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Form Test Page</title>
<META http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">
</head>
<body>
<form action=ftest.php method='post' encoding='text/plain'>
Enter a text: <input name=TheText type=text size=10 maxlength=10><input
type=submit>
</form>
<?php
import_request_variables("gPC","FORM");
echo "Data from last request:<br>";
echo "POST:<br>";
print_r ($_POST);
echo "<br>GET:<br>";
print_r ($_GET);
echo "<br>Cookies:<br>";
print_r ($_COOKIE);
?>
</body>
</html>
Pretty simple and straightforward.
The statistics page I currently work on requires to enter a Groupname.
All but one groupname so far get accepted.
The one that does not get accepted is
<Group>
including the "<>"
If I enter this into the form and submit the data doesnt get forwarded
into the post data.
Even changing the encoding did not work.
I tried >< that did work strange enough
even <> alone works but as soon something is in between <> nothing gets
into the post-data.
Does anybody have an explanation?
Maybe I overlooke something.
--- End Message ---
--- Begin Message ---
maddog1169 wrote:
> The one that does not get accepted is
>
> <Group>
>
> including the "<>"
You have something like this?
<input type=text name="<Group>" />
It should work. Make sure you have quotes around it, of course, or
weird stuff will happen.
Try something like this:
<form action="f.php" method="POST">
<input type=text name="<Group>" />
</form>
<?php phpinfo() ?>
Type something in the form field and hit return and then scroll down and
look at the $_REQUEST and $_POST variables.
-Rasmus
--- End Message ---
--- Begin Message ---
Hi,
this could be a silly question. Is there some performance penalty when
using the <<< operator like this:
$var =<<<EOP
add a bunch of text here
and here
EOP;
Just curious.
Thanks,
Rodolfo.
--- End Message ---
--- Begin Message ---
Hi Master,
I have an array as :
$myArray =
array('four','four','four','four','one,,'three','three','three','two','two');
Then I want output like this,
//======
four is 4 times
three is 3 times
two is 2 times
one is 1 times //(it 's better if one is 1 time).
//=======
How can I search and count the array? Or better search and count directly using
MySQL API?
Note : array was generated from MySQL DB
//==========
<?php
$connection = mysql_connect("localhost","user","pass");
mysql_select_db("ecd");
$result = mysql_query("SELECT * FROM pre_main ORDER BY mDate DESC LIMIT
20",$connection);
while ($row = mysql_fetch_row($result)) {
$myArray[] = $row[0];
}
sort ($myArray);//sorting array
//result : $myArray =
array('two','two','three','three','three','four','four','four','four','one');
?>
//=========
Thanks in advance
--- End Message ---
--- Begin Message ---
array_count_values()
Bagus Nugroho wrote:
> Hi Master,
>
> I have an array as :
> $myArray =
> array('four','four','four','four','one,,'three','three','three','two','two');
>
> Then I want output like this,
> //======
> four is 4 times
> three is 3 times
> two is 2 times
> one is 1 times //(it 's better if one is 1 time).
> //=======
>
> How can I search and count the array? Or better search and count directly
> using MySQL API?
>
> Note : array was generated from MySQL DB
> //==========
> <?php
> $connection = mysql_connect("localhost","user","pass");
> mysql_select_db("ecd");
> $result = mysql_query("SELECT * FROM pre_main ORDER BY mDate DESC LIMIT
> 20",$connection);
> while ($row = mysql_fetch_row($result)) {
> $myArray[] = $row[0];
> }
> sort ($myArray);//sorting array
> //result : $myArray =
> array('two','two','three','three','three','four','four','four','four','one');
>
> ?>
> //=========
>
> Thanks in advance
>
>
--- End Message ---
--- Begin Message ---
Hi All,
Just curious if anyone knows of an existing class that will take MySQL
records containing HTML and create a valid RSS 2.0 newsfeed from them?
Much warmth,
Murray
---
http://www.planetthoughtful.org
"Building a thoughtful planet,
one quirky comment at a time."
--- End Message ---