|
Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com |
php-general Digest 29 Mar 2005 17:59:18 -0000 Issue 3366
php-general-digest-help
lists.php.net
Date: Tue Mar 29 2005 - 11:59:18 CST
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
php-general Digest 29 Mar 2005 17:59:18 -0000 Issue 3366
Topics (messages 211757 through 211795):
Re: Converting hexadecimal string
211757 by: Richard Lynch
Re: create multiple jpg thumbnails and use in a page
211758 by: Richard Lynch
Re: html image
211759 by: Richard Lynch
Re: Memory use
211760 by: Richard Lynch
Re: convert date format
211761 by: Burhan Khalid
Re: More about problems reading COM ports
211762 by: Kim Madsen
report_zend_debug ini setting
211763 by: Zac Barton
Re: Create MDB File
211764 by: gustav.varupiraten.se
Re: collapse SELECT from multiple tables
211765 by: Rolf Østvik
How to sort that array?
211766 by: Merlin
211768 by: Colin Ross
211789 by: Merlin
Re: NEWBIE: Can't Get My Loop Going. . .
211767 by: Jochem Maas
211776 by: Jackson Linux
php + mysql: binary arrays
211769 by: Robert S
211771 by: YaronKh.clalit.org.il
211773 by: Colin Ross
211775 by: Robert S
Re: Session data disappearing?
211770 by: Colin Ross
211774 by: Jochem Maas
Re: PHP CODE TO DISPLAY ISP
211772 by: Colin Ross
Re: rawurldecode
211777 by: Aaron Todd
211779 by: Marek Kilimajer
211780 by: Aaron Todd
211781 by: Aaron Todd
ISO encoding of subject in mail?
211778 by: Kim Madsen
211782 by: l0t3k
211786 by: M. Sokolewicz
Re: Reading all headers sent
211783 by: martin
Re: phpDocumentor usage (specifically changelog capability?)
211784 by: Elizabeth Smith
Limitation in preg_match ?
211785 by: Cedric Fontaine
Re: Best Server OS
211787 by: Gerald Artman
Any personal experience with MySQL/Calendar application
211788 by: Todd Cary
211794 by: Peter G. Brown
211795 by: Joe Harman
Re: filesize() Returns a file size. What will return a directorysize()???
211790 by: Lupita
calling stored procedures from php
211791 by: Cima
Re: Storing data structires in DB
211792 by: GamblerZG
filtering uploaded files
211793 by: Cima
Administrivia:
To subscribe to the digest, e-mail:
php-general-digest-subscribe
lists.php.net
To unsubscribe from the digest, e-mail:
php-general-digest-unsubscribe
lists.php.net
To post to the list, e-mail:
php-general
lists.php.net
----------------------------------------------------------------------
attached mail follows:
On Sun, March 27, 2005 9:09 pm, Ashley M. Kirchner said:
>
> Short (possibly simple) question:
> How do I convert a hexadecimal string back into it's ascii
> representation?
http://php.net/hex2dec
--
Like Music?
http://l-i-e.com/artists.htm
attached mail follows:
On Fri, March 25, 2005 6:32 pm, Kevin Coyner said:
>
> Is there a way to create multiple jpg thumbnails from a series of larger
> originals and use all of the on-the-fly generated thumbnails in a page
> (without saving any of the thumbnails to the filesystem)?
>
> For example, I've got 5 full size jpg's in a directory, and I'd like to
> list them on a page in table form as follows
If you are already forcing the user to download the fullsize image in that
same page, you might as well just use HEIGHT and WIDTH attributes on your
other <IMG /> tags and let the browser do the scaling.
You'd be MUCH better off making and saving the thumbnails in advance, mind
you, but you're ruled that out.
--
Like Music?
http://l-i-e.com/artists.htm
attached mail follows:
On Thu, March 24, 2005 10:48 am, delos said:
> i would like to produce a script that can make an image ("screenshot")
> based only on the site url. so that i enter an URL and php makes the
> picture.
>
> can such a thing be done by php? if not, maybe by some other language?
I don't THINK anybody mentioned the GD folks' program that does this
called, errrr, "webthumb"???
You'd have to http://php.net/exec it
And your server would have to have X and a browser installed, which is not
super common on web servers.
Or you might be able to hack something up on a home machine to screenshot
the sites you want in a cron job and upload the images...
--
Like Music?
http://l-i-e.com/artists.htm
attached mail follows:
http://php.net/manual/en/function.memory-get-usage.php
Do it before and after, and subtract.
YMMV.
On Wed, March 23, 2005 10:31 pm, Joe Wollard said:
> Greetings,
>
> I'm trying to help a C programmer understand and use PHP for web
> development. So far all the similarities between C++ and PHP are making
> the process rather speedy. He asked what seemed like a very simple
> question, but I couldn't find the answer. The questions is how can you
> determine how much memory a variable/object/struct/etc are using?
>
> For instance:
> $myObject = new myClass();
> $myObject->performAction_and_holdResult();
>
> At this point, how can you tell how much memory $myObject is using?
>
> Thanks!
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--
Like Music?
http://l-i-e.com/artists.htm
attached mail follows:
Angelo Zanetti wrote:
> hi guys,
>
> I need to convert a date from this format: 2005-03-25 to 25 mar 2005.
> I have tried the mktime, strftime and the date functions but they all
> take a time stamp but I only have the dates in the format of 2005-03-25.
echo strtolower(date("j M Y", strtotime("2005-03-25")));
attached mail follows:
> -----Original Message-----
> From: John McCaskey [mailto:mccaskey
stanford.edu]
> Sent: Sunday, March 27, 2005 5:13 AM
> Others have reported problems reading COM ports using fopen and fgets or
> fread. They open the port and start reading but nothing ever arrives.
I had the "problem" and solved it, I believe I posted the answer here too? What kinda device are You listening to? I was listening to a switch and got nothing using the example from the fgetc manual until I restarted the switch, then all the boot info became visual... It reads each byte from the port, so use that as a "listen_wrapper", send try some [enter] commands, have a terminal ready to check if something goes wrong, try output the buffer, when $char is a "\n" and basically know exactly what the device shows and expects. Here´s a hint to get You started:
if($fp = fopen('com1', 'wb')) // b for windows
// send [enter]
fwrite($fp, "\r\n");
// listen to device
while (false !== ($char = fgetc($fp))) {
echo "$char\n";
$buffer .= $char;
if($char == "\n" || $char = "\r") {
echo "\nBUFFER: $buffer\n\n";
sleep(3);
$buffer = "";
}
}
}
else {
echo 'can´t connect to com1, got a terminal open?';
}
Play some more with the sleep and [enter]
> I have the same problem and discovered the following. There is an 8K
> input buffer. Only after 8K bytes have arrived does fgets or fread see the
> first.
Won´t be a problem with fgetc() since You read char by char.
> How does one get around this feature (or bug)?
>
> This is with php 5.0.2.2 on Windows XP.
I´m using 4.3.10
--
Med venlig hilsen / best regards
ComX Networks A/S
Kim Madsen
Systemudvikler/systemdeveloper
attached mail follows:
Hi,
Does anyone know what the "report_zend_debug" ini entry does. I have searched the php wesite (http://docs.php.net/en/ini.html) and cant find any info on it.
Thanks
Zac
attached mail follows:
What's the reason reason converting from MySQL to Access? *curious*
/G
varupiraten.se
> Thanks for your reply,
>
> but this only works on Windows. I need a program that will create an MDB
> file on the fly from a query on the MySQL database...
>
>
> "Johannes Findeisen" <mailman
hanez.org> wrote in message
> news:200503282255.26459.mailman
hanez.org...
>> Sorry,
>>
>> i forgot that link:
>>
>> http://www.convert-in.com/sql2acc.htm
>>
>>
>> On Monday 28 March 2005 22:46, Johannes Findeisen wrote:
>>> Hello,
>>>
>>> i had the same problem some years ago. At this time i have set up all
>>> tables in Access and wrote a script which reads from MySQL and inserts
>>> into
>>> the MDB file via the ODBC connector. This works but is much work when
>>> your
>>> database is very big.
>>>
>>> 2 Years ago i had the same problem but it must go as fast as possible
>>> so
>>> i
>>> decided to buy a converteer since i didn't find anything free. They are
>>> working very good. I don't know where i have buyed them but i think
>>> there
>>> is only one company which delivers this software.
>>>
>>> Regards
>>> Johannes
>>>
>>> On Monday 28 March 2005 22:08, Shaun wrote:
>>> > Hi,
>>> >
>>> > Does anyone know if its possible to create an MDB file from a Mysql
>>> > database using a PHP script, I have only managed to find Access to
>>> > Mysql
>>> > conversion programs so far...
>>> >
>>> > Thanks for your help
>>>
>>> --
>>> # Johannes Findeisen
>>
>> --
>> # Johannes Findeisen
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
attached mail follows:
davidc
connect4less.com (David Christensen) wrote in
news:1111687408.7718.85.camel
pluto.connect4less.com:
> I'm trying to figure out the best way to handle a SELECT from multiple
> tables where a single ID in tableA relates to multiple ID's in tableB:
>
> "SELECT tableA.ID, tableB.data FROM tableA, tableB WHERE tableA.ID=3
> AND tableA.ID=tableB.tableAID"
>
> What I'm trying to product is an array output similar to:
>
>| ID | data |
>| 3 | data1, data2, data3 |
>
> if the table data is represented by this:
>
> tableA
>| ID | something |
>| 1 | something1 |
>| 2 | something2 |
>| 3 | something3 |
>
> tableB
>| ID | tableAID | data |
>| 1 | 3 | data1 |
>| 2 | 3 | data2 |
>| 3 | 3 | data2 |
Suggestion 1 and 2 may depend of which database you use.
Suggestion 3 have been touched in other answers.
Suggestion 1:
Create a custom function which takes the tableA.ID as parameter and run
a query on tableB and creates an string as answer. I do this in an
application i use PostgreSQL.
Suggestion 2:
Create an aggregate. I havent yet tried this in PostgreSQL.
Suggestion 3:
Order your sql result and loop over the data.
--
Rolf Østvik
attached mail follows:
Hi there,
I would like to save some db power by putting values into a file which are often
used. They basicly populate a select field.
So I placed those values into associative arrays:
$code[language] = array("1"=> "php", "2"=> "asp");
Now I would like to sort those for displaying after my preference, not by lets
say alphabet. The easiest thing I could think of, is just to move the entry:
$code[language] = array("2"=> "asp", "1"=> "php");
But this of course does not work. I would like to be able to place values later
on inbetween. So if somebody comes up with a language called ".net" :-) I would
like to place it in the middle, but I cant get it to work like that :-(
To build the select box I use following code:
<select name="education">
<option value ="0" selected>---</option>
';
################################################
# build the select field
for ($i=1; $i <= count($code[education]); $i++){
if ($education)
$isselected = ($i == $education) ? " selected" : ""; // select the
active row
else
$isselected = FALSE;
printf ("<option value =\"%s\"%s>%s</option>\n", $i, $isselected,
$code[education][$i]);
};
################################################
echo'
</select>
Has anybody an idea which could help me on that? Thank you for any help.
Merlin
attached mail follows:
What I did in a situation like this (much more complicated though,
with nested select boxes in a form) was use a database, and then
created a php-created javascript file.
The javascript file was buffered, and then cached (saved to a file)
with a timestamp...
So, I can limit the amount of times the WHOLE SCRIPT is run , say once
every 24 hours at most. Also, If i just updated it, I can delete the
cached version, and a new one is made.
Sure, the script is slow... but page loads are fast becuase (unless
its NEEDED) all thats to be processed is a file-read call and such...
not (potentially) hundreds of DB queries.
If you want I can post an example... let me know.
Colin
On Tue, 29 Mar 2005 11:59:23 +0200, Merlin <news.groups
web.de> wrote:
> Hi there,
>
> I would like to save some db power by putting values into a file which are often
> used. They basicly populate a select field.
> So I placed those values into associative arrays:
> $code[language] = array("1"=> "php", "2"=> "asp");
>
> Now I would like to sort those for displaying after my preference, not by lets
> say alphabet. The easiest thing I could think of, is just to move the entry:
> $code[language] = array("2"=> "asp", "1"=> "php");
>
> But this of course does not work. I would like to be able to place values later
> on inbetween. So if somebody comes up with a language called ".net" :-) I would
> like to place it in the middle, but I cant get it to work like that :-(
>
> To build the select box I use following code:
>
> <select name="education">
> <option value ="0" selected>---</option>
> ';
> ################################################
> # build the select field
> for ($i=1; $i <= count($code[education]); $i++){
> if ($education)
> $isselected = ($i == $education) ? " selected" : ""; // select the
> active row
> else
> $isselected = FALSE;
> printf ("<option value =\"%s\"%s>%s</option>\n", $i, $isselected,
> $code[education][$i]);
> };
> ################################################
> echo'
> </select>
>
> Has anybody an idea which could help me on that? Thank you for any help.
>
> Merlin
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
attached mail follows:
hmm.. I am not sure if JS is the best sollution for that. I am pretty sure that
there is a way with php for that.
The basic problem comes down to not be able to sort an array customized.
Lets take this array as an example:
$code[language] = array("1"=> "php", "2"=> "asp");
There must for sure be a way to pull the values out of that array by "first in
first out".
I am stuck with this, but it seems logical that there is a way around it.
Thank you for any help on that problem,
Merlin
Colin Ross wrote:
> What I did in a situation like this (much more complicated though,
> with nested select boxes in a form) was use a database, and then
> created a php-created javascript file.
> The javascript file was buffered, and then cached (saved to a file)
> with a timestamp...
> So, I can limit the amount of times the WHOLE SCRIPT is run , say once
> every 24 hours at most. Also, If i just updated it, I can delete the
> cached version, and a new one is made.
>
> Sure, the script is slow... but page loads are fast becuase (unless
> its NEEDED) all thats to be processed is a file-read call and such...
> not (potentially) hundreds of DB queries.
>
> If you want I can post an example... let me know.
>
> Colin
>
> On Tue, 29 Mar 2005 11:59:23 +0200, Merlin <news.groups
web.de> wrote:
>
>>Hi there,
>>
>>I would like to save some db power by putting values into a file which are often
>>used. They basicly populate a select field.
>>So I placed those values into associative arrays:
>>$code[language] = array("1"=> "php", "2"=> "asp");
>>
>>Now I would like to sort those for displaying after my preference, not by lets
>>say alphabet. The easiest thing I could think of, is just to move the entry:
>>$code[language] = array("2"=> "asp", "1"=> "php");
>>
>>But this of course does not work. I would like to be able to place values later
>>on inbetween. So if somebody comes up with a language called ".net" :-) I would
>>like to place it in the middle, but I cant get it to work like that :-(
>>
>>To build the select box I use following code:
>>
>><select name="education">
>> <option value ="0" selected>---</option>
>>';
>>################################################
>># build the select field
>>for ($i=1; $i <= count($code[education]); $i++){
>> if ($education)
>> $isselected = ($i == $education) ? " selected" : ""; // select the
>>active row
>> else
>> $isselected = FALSE;
>> printf ("<option value =\"%s\"%s>%s</option>\n", $i, $isselected,
>>$code[education][$i]);
>>};
>>################################################
>>echo'
>></select>
>>
>>Has anybody an idea which could help me on that? Thank you for any help.
>>
>>Merlin
>>
>>--
>>PHP General Mailing List (http://www.php.net/)
>>To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
attached mail follows:
Jackson Linux wrote:
> Hello all,
> I am a newbie trying to build a set of links to content in a db. I am
> connecting with the db and seeing the proper number of rows. if I echo
> out the values of $id and $sidebar I see that they take on the id# and
> text of the last entry in the database. I'm trying to make the script
> get each of the rows, until there are no more, and echo out the info I
> need for each row. Please can someone tell me where I'm going wrong?
> (the variables spelling out the db connection information are in a
> prepend file, and work.)
I read that you already figured it out... thought I add a couple of
general tips:
>
> Thanks in advance,
> Jack
>
> <?php
>
> $conn = mysql_connect($dbserver, $dbusername, $dbpassword);
> if (!$conn) {
if you don't intend to use the $conn var why initialize it?:
mysql_connect($dbserver, $dbusername, $dbpassword) or die("Unable to connect to DB: " . mysql_error());
> echo "Unable to connect to DB: " . mysql_error();
> exit;
> }
>
> if (!mysql_select_db("$dbname")) {
> echo "Unable to select mydbname: " . mysql_error();
> exit;
> }
>
> $sql = "
> SELECT *
> FROM sidebar
> ";
>
> $sidebar = array();
> $result = mysql_query($sql);
>
> if (!empty($result)) {
>
again if you are using $sql only in one place then there
is no reason to not to do the following instead (given that
the query itself is very short - i.e. legibility is not a problem):
if ($result = mysql_query("SELECT * FROM sidebar")) {
> while ($sidebar = mysql_fetch_assoc($result)) {
>
> $id = $sidebar['sidebar_id'];
> $linktext = $sidebar['headline'];
sometimes it handy to initialize vars like the 2 above for readability...
in this case you may consider that the expressions are very short and therefore
you might want to skip creating the vars:
$left_sidebar[] = "<li class='menu-item'>- <a class='sidebar-link'
href='{$_SERVER['PHP_SELF']}?s={$sidebar['sidebar_id']}'
title=\"{$sidebar['headline']}\">{$sidebar['headline']}</a></li>";
>
>
> /* Build sidebar.*/
>
>
> $left_sidebar[] = "<li class='menu-item'>- <a class='sidebar-link'
> href='{$_SERVER['PHP_SELF']}?s={$id}'
> title=\"{$linktext}\">{$linktext}</a></li>";
>
> }
> }
> else {}
the preceding empty else statement if not required you can leave out
the 'else {}' completely.
have fun. :-)
>
> mysql_free_result($result);
>
> ?>
>
> <html><body>
>
> <ul><?php join("\n\n", $left_sidebar); ?></ul>
>
> </body></html>
>
attached mail follows:
As usual, Jochem, thanks for all those useful tips. They are much
appreciated.
Jack
On 29 Mar 2005, at 05:15, Jochem Maas wrote:
> Jackson Linux wrote:
>> Hello all,
>> I am a newbie trying to build a set of links to content in a db. I am
>> connecting with the db and seeing the proper number of rows. if I
>> echo out the values of $id and $sidebar I see that they take on the
>> id# and text of the last entry in the database. I'm trying to make
>> the script get each of the rows, until there are no more, and echo
>> out the info I need for each row. Please can someone tell me where
>> I'm going wrong?
>> (the variables spelling out the db connection information are in a
>> prepend file, and work.)
>
> I read that you already figured it out... thought I add a couple of
> general tips:
>
>> Thanks in advance,
>> Jack
>> <?php
>> $conn = mysql_connect($dbserver, $dbusername, $dbpassword);
>> if (!$conn) {
>
> if you don't intend to use the $conn var why initialize it?:
>
> mysql_connect($dbserver, $dbusername, $dbpassword) or die("Unable to
> connect to DB: " . mysql_error());
>
>> echo "Unable to connect to DB: " . mysql_error();
>> exit;
>> }
>> if (!mysql_select_db("$dbname")) {
>> echo "Unable to select mydbname: " . mysql_error();
>> exit;
>> }
>> $sql = "
>> SELECT *
>> FROM sidebar
>> ";
>> $sidebar = array();
>> $result = mysql_query($sql);
>> if (!empty($result)) {
>
> again if you are using $sql only in one place then there
> is no reason to not to do the following instead (given that
> the query itself is very short - i.e. legibility is not a problem):
>
> if ($result = mysql_query("SELECT * FROM sidebar")) {
>
>
>> while ($sidebar = mysql_fetch_assoc($result)) {
>> $id = $sidebar['sidebar_id'];
>> $linktext = $sidebar['headline'];
>
> sometimes it handy to initialize vars like the 2 above for
> readability...
> in this case you may consider that the expressions are very short and
> therefore
> you might want to skip creating the vars:
>
> $left_sidebar[] = "<li class='menu-item'>- <a class='sidebar-link'
> href='{$_SERVER['PHP_SELF']}?s={$sidebar['sidebar_id']}'
> title=\"{$sidebar['headline']}\">{$sidebar['headline']}</a></li>";
> >
>> /* Build sidebar.*/
>> $left_sidebar[] = "<li class='menu-item'>- <a
>> class='sidebar-link' href='{$_SERVER['PHP_SELF']}?s={$id}'
>> title=\"{$linktext}\">{$linktext}</a></li>";
>> }
>> }
>> else {}
>
> the preceding empty else statement if not required you can leave out
> the 'else {}' completely.
>
> have fun. :-)
>
>> mysql_free_result($result);
>> ?>
>> <html><body>
>> <ul><?php join("\n\n", $left_sidebar); ?></ul>
>> </body></html>
>
>
attached mail follows:
I am writing a contact manager in php/mysql. I'd like to use a binary array
as an efficient way to store information for groups that each contact
belongs to eg:
Field: 'group': 001010 means that the contact belongs to the second and
fourth group.
If the array is of type Byte, it should be able to store information about
255 groups.
Is php/mysql able to handle this? My specific questions are:
What functions set/clear a bit in an array in php?
How do you query whether a bit is set in mysql?
I hope I've made this clear enough to be followed - I'm not a pro!
attached mail follows:
Hi
First of all you can use the Bitwise Operators to set/clear a bit
Let say $a is '00100' meaning group 2 is set and you want to set group 4 then write: $a = $a | (pow(2 ,4)); //using OR Operator
Now $a is '10100'
Let say that you want to unset group 2:
$a = $a ^ (pow(2,2)); //using XOR Operator
In Mysql:
Let say you want to select groups 2,4,5
In your select string you should write something like :
$mygroups = (pow(2,2) + pow (2,4) + pow(2,5));
$sql = 'select * from sometable where groups = ' || $mygroups
Hope I was helpful
Yaron Khazai
-----Original Message-----
From: news [mailto:news
sea.gmane.org] On Behalf Of Robert S
Sent: Tuesday, March 29, 2005 12:35 PM
To: php-general
lists.php.net
Subject: [PHP] php + mysql: binary arrays
I am writing a contact manager in php/mysql. I'd like to use a binary array
as an efficient way to store information for groups that each contact
belongs to eg:
Field: 'group': 001010 means that the contact belongs to the second and
fourth group.
If the array is of type Byte, it should be able to store information about
255 groups.
Is php/mysql able to handle this? My specific questions are:
What functions set/clear a bit in an array in php?
How do you query whether a bit is set in mysql?
I hope I've made this clear enough to be followed - I'm not a pro!
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
oops.. how bout if i send it to the group too...
> http://us4.php.net/manual/en/function.preg-split.php
>
> example for you:
>
> $groups = '0101000100101010001110010100111';
> $groups_array = preg_split('//', $str, -1, PREG_SPLIT_NO_EMPTY);
> print_r($groups_array);
> $groups_as_string = implode($groups_as_string);
> echo $groups_as_string;
>
> Note: As of PHP 4.3.0, the glue parameter of implode() is optional
> and defaults to the empty string(''). This is not the preferred usage
> of implode(). We recommend to always use two parameters for
> compatibility with older versions.
>
> I know implode is binary-safe, not sure about preg_split()
>
> you COULD also use spliti() instead of preg_split()
> http://us4.php.net/manual/en/function.spliti.php
>
> Colin
>
> On Tue, 29 Mar 2005 20:35:02 +1000, Robert S <robert_s
emailme.net.au> wrote:
> > I am writing a contact manager in php/mysql. I'd like to use a binary array
> > as an efficient way to store information for groups that each contact
> > belongs to eg:
> >
> > Field: 'group': 001010 means that the contact belongs to the second and
> > fourth group.
> >
> > If the array is of type Byte, it should be able to store information about
> > 255 groups.
> >
> > Is php/mysql able to handle this? My specific questions are:
> >
> > What functions set/clear a bit in an array in php?
> > How do you query whether a bit is set in mysql?
> >
> > I hope I've made this clear enough to be followed - I'm not a pro!
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
>
attached mail follows:
Hope I was helpful
Yaron Khazai
Thanks - will try that out soon.
attached mail follows:
In edit_schedule.phps:
if (isset($_POST['add_available'])){
$year = $_POST['year'];
$year = $year['NULL'];
$month = $_POST['month'];
$month = $month['NULL'];
$day = $_POST['day'];
$day = $day['NULL'];
$time = $_POST['time'];
$time = $time['NULL'];
...
}
after this is done..
$year, $month, $day, and $time should all be arrays with a single
'null' (not the keyword null though) item with no value. ie.
array(NULL=>);
what ARE you trying to do, you are making the POST vars global:
$day = $_POST['day'];
OK. (why do you even need to do this? whatever, matter of taste i guess..)
But then you over write their values, making them arrays with that
single element 'NULL'
$day = $day['NULL'];
Not seeing the logic here...
Overall, and not to mean offence, but your code is kinda sloppy and
has syntax and logic errors.
<?="$slot", ($taken ? ' <FONT COLOR="RED">TAKEN</FONT>' : '')?>
SHOULD be erroring up (if you have errors turned on, please say you do
for development)
try:
<?php echo $slot; if ($taken) echo '<FONT COLOR="RED">TAKEN</FONT>'; ?>
and btw, the short conditional syntax is:
(condition) ? true : false;
// ie. (note the empty string... you gotta have SOMETHING there
[right?i think so]
echo ($taken) ? '<FONT COLOR="RED">TAKEN</FONT>' : '' ;
Colin
On Mon, 28 Mar 2005 20:27:00 -0800 (PST), Richard Lynch <ceo
l-i-e.com> wrote:
> Can anybody 'splain under what conditions $_SESSION values would turn into
> &NULL for no reason I can figure out?
>
> It happens consistently on this one FORM submission, but works fine on
> others.
>
> PHP 5.0.3
> FreeBSD 5.3-RELEASE
>
> Tried with Cookies and with trans_sid
>
> No difference.
>
> Tried altering the session.name and no difference.
>
> Naturally, I can't pare it down to a smaller example yet. :-(
>
> I'm calling session_start(), for sure.
>
> I'm dumping out session_id() and it has the same 32-character value as
> before.
>
> But one page has $_SESSION data, and the next, "poof" all the
> &string(#)="#####" values turn into &NULL
>
> Actually only two out of three values was disappearing for awhile.
>
> This worked fine under Windows XP on my laptop, so I'm reasonably certain
> it's not my code at fault, at least not totally. Working versions:
> PHP 4.3.9
> Windows XP Home Edition
>
> I've searched bugs.php.net, and found nothing that matched up in any
> obvious way to what I'm experiencing, though maybe I just missed it.
>
> Hmmmm. Maybe I can blame the CSS somehow. That always seems to screw me
> up. :-v
>
> Anybody willing to poke at it can email me off list for a
> username/password and I'll set it up for you to see it in action.
>
> Source code (kinda long, sorry):
> http://acousticdemo.com/edit_schedule.phps
> http://acousticdemo.com/globals.phps
> http://acousticdemo.com/client_id.phps
> http://acousticdemo.com/global.phps (CSS)
>
> --
> Like Music?
> http://l-i-e.com/artists.htm
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
attached mail follows:
Colin Ross wrote:
> In edit_schedule.phps:
>
> if (isset($_POST['add_available'])){
> $year = $_POST['year'];
> $year = $year['NULL'];
> $month = $_POST['month'];
> $month = $month['NULL'];
> $day = $_POST['day'];
> $day = $day['NULL'];
> $time = $_POST['time'];
> $time = $time['NULL'];
> ...
> }
> after this is done..
> $year, $month, $day, and $time should all be arrays with a single
> 'null' (not the keyword null though) item with no value. ie.
> array(NULL=>);
>
> what ARE you trying to do, you are making the POST vars global:
> $day = $_POST['day'];
> OK. (why do you even need to do this? whatever, matter of taste i guess..)
> But then you over write their values, making them arrays with that
> single element 'NULL'
> $day = $day['NULL'];
> Not seeing the logic here...
didn't spot this yet. will take another look - maybe this is the prob? hmm.
>
> Overall, and not to mean offence, but your code is kinda sloppy and
> has syntax and logic errors.
Richards style is just different to yours, me thinks.
>
> <?="$slot", ($taken ? ' <FONT COLOR="RED">TAKEN</FONT>' : '')?>
> SHOULD be erroring up (if you have errors turned on, please say you do
> for development)
Richard aint no noob :-)
...the syntax you point out as being bad is completely legal.
> try:
> <?php echo $slot; if ($taken) echo '<FONT COLOR="RED">TAKEN</FONT>'; ?>
>
> and btw, the short conditional syntax is:
> (condition) ? true : false;
> // ie. (note the empty string... you gotta have SOMETHING there
> [right?i think so]
> echo ($taken) ? '<FONT COLOR="RED">TAKEN</FONT>' : '' ;
>
> Colin
>
> On Mon, 28 Mar 2005 20:27:00 -0800 (PST), Richard Lynch <ceo
l-i-e.com> wrote:
>
>>Can anybody 'splain under what conditions $_SESSION values would turn into
>>&NULL for no reason I can figure out?
>>
>>It happens consistently on this one FORM submission, but works fine on
>>others.
>>
>>PHP 5.0.3
>>FreeBSD 5.3-RELEASE
>>
>>Tried with Cookies and with trans_sid
>>
>>No difference.
>>
>>Tried altering the session.name and no difference.
>>
>>Naturally, I can't pare it down to a smaller example yet. :-(
>>
>>I'm calling session_start(), for sure.
>>
>>I'm dumping out session_id() and it has the same 32-character value as
>>before.
>>
>>But one page has $_SESSION data, and the next, "poof" all the
>>&string(#)="#####" values turn into &NULL
>>
>>Actually only two out of three values was disappearing for awhile.
>>
>>This worked fine under Windows XP on my laptop, so I'm reasonably certain
>>it's not my code at fault, at least not totally. Working versions:
>>PHP 4.3.9
>>Windows XP Home Edition
>>
>>I've searched bugs.php.net, and found nothing that matched up in any
>>obvious way to what I'm experiencing, though maybe I just missed it.
>>
>>Hmmmm. Maybe I can blame the CSS somehow. That always seems to screw me
>>up. :-v
>>
>>Anybody willing to poke at it can email me off list for a
>>username/password and I'll set it up for you to see it in action.
>>
>>Source code (kinda long, sorry):
>>http://acousticdemo.com/edit_schedule.phps
>>http://acousticdemo.com/globals.phps
>>http://acousticdemo.com/client_id.phps
>>http://acousticdemo.com/global.phps (CSS)
>>
>>--
>>Like Music?
>>http://l-i-e.com/artists.htm
>>
>>--
>>PHP General Mailing List (http://www.php.net/)
>>To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
>
>
attached mail follows:
and least we forgot about all the users coming from behind a proxy
farm with a different ip for each request.. <cough> AOL </cough>
C
On Mon, 28 Mar 2005 12:28:32 -0700, Leif Gregory <Leifg
doh.state.nm.us> wrote:
> Hello jenny,
>
> Monday, March 28, 2005, 9:36:07 AM, you wrote:
> j> i am making a website in php and i will appreciate if anybody can
> j> tell me the php code to :
> j> - (1)display isp name,
>
> One problem you're going to run into is that by using
> $_SERVER['REMOTE_ADDR'] oftentimes, you'll end up with just the IP.
>
> I wrote the below to give me the hostname, which generally gives you
> the ISP information too, to fix a problem on a project I was doing.
>
> If it won't resolve to a name (which does happen sometimes for
> machines behind corporate firewalls), I just displayed "No Reverse DNS"
>
> <?php
> $pingResults = shell_exec('ping -a ' . $_SERVER['REMOTE_ADDR']);
> $temp = explode("\r\n",$pingResults);
> preg_match("/^Pinging\s([a-zA-Z0-9.]+)/", $temp[1], $hostname);
> if ($temp[4] == "Request timed out.")
> $latency = "Unknown";
> else
> $latency = $temp[4];
> ?>
>
> Hostname: <?php if (!$_SERVER['REMOTE_ADDR'] == preg_match("/^[a-z.]+/i",$hostname[1])) echo "No Reverse DNS"; else echo $hostname[1]; ?>
> Latency: <? echo $latency; ?>
>
> Geez, it's amazing when you dig back through old code you realize how
> much your coding skills sucked back then! <grin>
>
> --
> Leif (TB lists moderator and fellow end user).
>
> Using The Bat! 3.0.9.9 Return (pre-beta) under Windows XP 5.1
> Build 2600 Service Pack 2 on a Pentium 4 2GHz with 512MB
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
attached mail follows:
All I am doing is adding a file name as a variable in the
URL.....http://www.mysite.com/mypage.php?variable=this is my image.jpg
When I do a echo $_GET['variable']; it only writes the first word. Is
there some setting that might be turned off in the php.ini file that would
disable this functionality?
Thanks
"Marek Kilimajer" <lists
kilimajer.net> wrote in message
news:42487D36.2030802
kilimajer.net...
> Aaron Todd wrote:
>> I am trying to use the rawurldecode() function to decode a variable that
>> is begin passed from a different page through the url. The PHP manual
>> doesnt say much for this function, but it does have quite a bit on the
>> urldecode() function which says using urldecode on a $_GET variable wont
>> produce the desired results. Is there another way to decode a url
>> variable? Or maybe a better way to get a variable from one page to
>> another so I can use it. The variable may contain all types of
>> characters, but mainly a space(%20) is the biggest problem.
>>
>> If anyone has some kind of workaround for this please let me know.
>
> You should not need it, %20 is decoded to space and as such is already in
> $_GET variable. If it's still encoded then you encoded it where it was not
> necessary.
attached mail follows:
Aaron Todd wrote:
> All I am doing is adding a file name as a variable in the
> URL.....http://www.mysite.com/mypage.php?variable=this is my image.jpg
You should write:
echo '<a href="http://www.mysite.com/mypage.php?variable=' .
rawurlencode('this is my image.jpg') . '">here</a>';
Then $_GET['variable'] will be equal to 'this is my image.jpg'.
>
> When I do a echo $_GET['variable']; it only writes the first word. Is
> there some setting that might be turned off in the php.ini file that would
> disable this functionality?
>
> Thanks
>
> "Marek Kilimajer" <lists
kilimajer.net> wrote in message
> news:42487D36.2030802
kilimajer.net...
>
>>Aaron Todd wrote:
>>
>>>I am trying to use the rawurldecode() function to decode a variable that
>>>is begin passed from a different page through the url. The PHP manual
>>>doesnt say much for this function, but it does have quite a bit on the
>>>urldecode() function which says using urldecode on a $_GET variable wont
>>>produce the desired results. Is there another way to decode a url
>>>variable? Or maybe a better way to get a variable from one page to
>>>another so I can use it. The variable may contain all types of
>>>characters, but mainly a space(%20) is the biggest problem.
>>>
>>>If anyone has some kind of workaround for this please let me know.
>>
>>You should not need it, %20 is decoded to space and as such is already in
>>$_GET variable. If it's still encoded then you encoded it where it was not
>>necessary.
>
>
attached mail follows:
I have been playing around with the varialbe that I am sending here and I
have found that this function is actually working correctly. Spaces an
punctuation decode properly, but an amperstand seems to be where my ploblem
is. I know its a very weird character to be using, but it is a valid
character in a filename so I must acount for it. Has anyone previously
dealt with this and might be able to give me a quick work around?
Thanks
"Aaron Todd" <aaloki88
hotmail.com> wrote in message
news:20050328213332.61613.qmail
lists.php.net...
>I am trying to use the rawurldecode() function to decode a variable that is
>begin passed from a different page through the url. The PHP manual doesnt
>say much for this function, but it does have quite a bit on the urldecode()
>function which says using urldecode on a $_GET variable wont produce the
>desired results. Is there another way to decode a url variable? Or maybe
>a better way to get a variable from one page to another so I can use it.
>The variable may contain all types of characters, but mainly a space(%20)
>is the biggest problem.
>
> If anyone has some kind of workaround for this please let me know.
>
> Thanks
attached mail follows:
I got it. After you said I shouldn't need it I started playing around and
found that you were right...I didnt need it for spaces and other
punctuation. But I was then having a problem with amperstands. It was
dropping everything after an amperstand off. I ended up doing a
rawurldecode of $_SERVER["QUERY_STRING"] and then a strrchr() on it to
return everything past the "=" sign. Then I had to do a substr() to get rid
of the "=". Its probably a long way of doing this and I know it probably
wont work if I add a second variable to the url, but I have already taken
precautions against that. This should work unless anyone see's amore major
security issue with it.
$end = strlen(strrchr(rawurldecode($_SERVER["QUERY_STRING"]),"="));
echo substr(strrchr(rawurldecode($_SERVER["QUERY_STRING"]),"="), 1,
$end);
Thanks
attached mail follows:
Hi
I´d like to encode the subject in mails generated and sent by PHP, so Danish letters like æ,ø and å can be used too... like this:
Subject: Problemer med =?ISO-8859-1?Q?f=E6llesdrev_m=2Em=2E?=
I can´t seem to find a proper function for this? I´ve tried with encode(), htmlentities() and htmlspecialchars():
$subject = htmlentities($subject, ENT_QUOTES, "ISO-8859-1");
which gives:
Subject: ADVARSEL: Få IP adresser tilbage
And it´s not converted by the mailclients.
I´d like to solve this since the mailserver at work complaints if the subject is not encoded:
X-Amavis-Alert: BAD HEADER Non-encoded 8-bit data (char E5 hex) in message header 'Subject': Subject: ADVARSEL: F\345 IP adresser ti...
Any tips/ideas?
--
Med venlig hilsen / best regards
ComX Networks A/S
Kim Madsen
Systemudvikler/systemdeveloper
attached mail follows:
Kim,
i vaguely recall some new (aka 5.04) functions added to the mbstring
extension to handle this.
BTW, are you _the_ Kim Madsen of TKBMMemtable fame ?
"Kim Madsen" <km
comx.dk> wrote in message
news:15653CE98281AD4FBD7F70BCEE3666E521F071
comxexch01.comx.local...
Hi
I´d like to encode the subject in mails generated and sent by PHP, so Danish
letters like æ,ø and å can be used too... like this:
Subject: Problemer med =?ISO-8859-1?Q?f=E6llesdrev_m=2Em=2E?=
I can´t seem to find a proper function for this? I´ve tried with encode(),
htmlentities() and htmlspecialchars():
$subject = htmlentities($subject, ENT_QUOTES, "ISO-8859-1");
which gives:
Subject: ADVARSEL: Få IP adresser tilbage
And it´s not converted by the mailclients.
I´d like to solve this since the mailserver at work complaints if the
subject is not encoded:
X-Amavis-Alert: BAD HEADER Non-encoded 8-bit data (char E5 hex) in message
header 'Subject': Subject: ADVARSEL: F\345 IP adresser ti...
Any tips/ideas?
--
Med venlig hilsen / best regards
ComX Networks A/S
Kim Madsen
Systemudvikler/systemdeveloper
attached mail follows:
convert it to quoted-printable using eg. imap_8bit()
L0t3k wrote:
> Kim,
> i vaguely recall some new (aka 5.04) functions added to the mbstring
> extension to handle this.
>
> BTW, are you _the_ Kim Madsen of TKBMMemtable fame ?
>
> "Kim Madsen" <km
comx.dk> wrote in message
> news:15653CE98281AD4FBD7F70BCEE3666E521F071
comxexch01.comx.local...
> Hi
>
> I´d like to encode the subject in mails generated and sent by PHP, so Danish
> letters like æ,ø and å can be used too... like this:
>
> Subject: Problemer med =?ISO-8859-1?Q?f=E6llesdrev_m=2Em=2E?=
>
> I can´t seem to find a proper function for this? I´ve tried with encode(),
> htmlentities() and htmlspecialchars():
>
> $subject = htmlentities($subject, ENT_QUOTES, "ISO-8859-1");
>
> which gives:
>
> Subject: ADVARSEL: Få IP adresser tilbage
>
> And it´s not converted by the mailclients.
>
> I´d like to solve this since the mailserver at work complaints if the
> subject is not encoded:
>
> X-Amavis-Alert: BAD HEADER Non-encoded 8-bit data (char E5 hex) in message
> header 'Subject': Subject: ADVARSEL: F\345 IP adresser ti...
>
> Any tips/ideas?
>
> --
> Med venlig hilsen / best regards
> ComX Networks A/S
> Kim Madsen
> Systemudvikler/systemdeveloper
attached mail follows:
Solved,
Just in case someone finds it usefull.
I could get the raw post with :
$send = $GLOBALS['HTTP_RAW_POST_DATA'];
And then the headers I need in the $_SERVER globals.
$header[] = "MessageType:$_SERVER[HTTP_MESSAGETYPE]"; // CALL
$header[] = "Content-Type:$_SERVER[CONTENT_TYPE]"; // text/xml
MARTIN
www.movil.be
Richard Lynch wrote:
> Search php.net for "RAW HTTP"
>
> Maybe.
>
>
> On Fri, March 18, 2005 3:28 am, martin said:
>
>>Thanks for the answer,
>>what I'm trying to achieve is a php proxy that receives any GET/POST
>>request with correspoding headers and brings back the results to the
>>caller.
>>
>>Let's say I do a google search request with curl:
>>// I would like all this to be sent by another page --- (header + xml)
>> $data ="soapreq.xml";
>> $handle = fopen ($data, "r");
>> $send = fread ($handle, filesize($data) );
>> fclose($handle);
>>$header[] ="MessageType:CALL";
>>$header[] ="Content-Type:text/xml";
>>// -------------------------------------- I don't know if what I want
>>can be achieved this way, but maybe this explains better the idea.
>>
>>$ch = curl_init();
>>curl_setopt($ch, CURLOPT_URL,
>>"http://api.google.com/search/beta2");
>>curl_setopt($ch, CURLOPT_POST, 1);
>>curl_setopt($ch, CURLOPT_POSTFIELDS, $send);
>>curl_setopt ($ch, CURLOPT_HTTPHEADER, $header);
>>
>>$data = curl_exec($ch);
>>
>>
>>
>>
>>Best regards,
>>MARTIN
>>
>>Jesper Goos wrote:
>>
>>
>>>The $SERVER variable is an array, so try this:
>>>
>>><?
>>>echo "<pre>";
>>>print_r($_SERVER);
>>>echo "</pre>";
>>>?>
>>>
>>>regards Jesper
>>>
>>>martin wrote:
>>>
>>>
>>>>Hi,
>>>>I wanted to know if there is some way to expose the full headers sent
>>>>to a php page.
>>>>I found in google that for windows there is $_SERVER['ALL_HTTP'] to
>>>>read all the headers sent but I'm using php on linux/apache.
>>>>
>>>>There is any way to get in a variable the full headers sent to a page ?
>>>>
>>>>
>>>>Best regards,
>>>>MARTIN
>>>>
>>>
>>--
>>PHP General Mailing List (http://www.php.net/)
>>To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
>
>
>
attached mail follows:
tg-php
gryffyndevelopment.com wrote:
> I didn't see a specific mailing list for phpDocumentor and wanted to get a general feel for people's experiances with it. I see that Zend Studio 4 supports it internally and I'd really like to get our group over to a standardized documentation scheme (and in the process, make use of what looks like a great auto-documentor).
>
> Our documentation needs aren't extensive, so I think I got enough of a feel for phpDocumentor to do what we want to do, but one thing I don't see that would be really nice is the ability to do some kind of changelog type thing on at least pages if not individual functions and such.
>
> Our current documentation is structured like this:
>
> /********************************************************
> ** File Name: FileName.php
> ** Description: Some Desc
> **
> ** Written By: Trevor Gryffyn
> **
> ** Modification Log:
> ** --------------------------------------------------
> ** Created: Trevor Gryffyn - 11/06/2004
> ** Modified: Trevor Gryffyn - 11/07/2004 - Added new function
> ********************************************************/
>
>
> Under phpDocutmentor, that might become something like:
>
> /**
> * Some short description
> *
> * Some longer description that spans
> * a couple of lines
> *
> *
author Trevor Gryffyn <tg-php
gryffyndevelopment.com>
> *
> *
category Miscellaneous Functions
> *
> *
example SomeFunction($somevar)
> *
> * Modification Log:
> * --------------------------------------------------
> * Created: Trevor Gryffyn - 11/06/2004
> * Modified: Trevor Gryffyn - 11/07/2004 - Added new function
> *
> */
>
>
> In this case, I'm not sure what phpDocumentor would do with the Modification Log or if there's a way to do something like this with phpDocumentor.
>
> Any thoughts on how I can do this the 'right' way and possibly do some kind of changelog for pages and/or individual functions would be greatly appreciated.
>
> Thanks in advance!
>
> -TG
>
> ___________________________________________________________
> Sent by ePrompter, the premier email notification software.
> Free download at http://www.ePrompter.com.
phpDocumentor is a seperate project from php and has serveral mailing
lists http://sourceforge.net/mail/?group_id=11194 and even forums
http://sourceforge.net/forum/?group_id=11194 where you can get answers
to your questions - check out http://phpdoc.org for more information.
php.general is not the place for questions about specific scripts
attached mail follows:
Hello,
I'm using a script to parse mail and extract attachments on-fly. But I
think that this preg_match
(preg_match("#([-]+|)$bound(.+?)([-]+?)$bound#is", $data, $strip))
doesn't work at all if content is too big (for ex 7Mo).
Is there any known limitation on it ?
I'm using php 4.3.10 and this script runs from command line, so no
timeout...
attached mail follows:
I would recommend OSX
Top ratings on security compared to Linux or Windows
Fast processors in many configurations, most include 1000T
Starting at $500 to $3500 for up to +15MIPS performance
Excellent GUI interface
Supported by Apache, PHP, MySQL and comes pre-installed
Jerry Artman
attached mail follows:
I am looking for an open source calendar program that uses MySQL to
store the data and has an online Admin feature. Rather than trying the
many that are listed, I am hoping that someone may have some personal
experience with a application of this type and make a recommendation.
Todd
attached mail follows:
I have used egroupware in a company setting and found it to be largely
satisfactory. It might be overkill in your case but you can restrict
module access.
www.egroupware.org
HTH
Peter Brown
Todd Cary wrote:
> I am looking for an open source calendar program that uses MySQL to
> store the data and has an online Admin feature. Rather than trying the
> many that are listed, I am hoping that someone may have some personal
> experience with a application of this type and make a recommendation.
>
> Todd
>
attached mail follows:
Hey Todd... I have one that I created and posted at Zend.com ... it
can be easily adapted to store data n MySQL...
Joe
On Tue, 29 Mar 2005 12:33:12 -0500, Peter G. Brown
<pbrown
beasleyfoodservice.com> wrote:
> I have used egroupware in a company setting and found it to be largely
> satisfactory. It might be overkill in your case but you can restrict
> module access.
>
> www.egroupware.org
>
> HTH
> Peter Brown
>
> Todd Cary wrote:
> > I am looking for an open source calendar program that uses MySQL to
> > store the data and has an online Admin feature. Rather than trying the
> > many that are listed, I am hoping that someone may have some personal
> > experience with a application of this type and make a recommendation.
> >
> > Todd
> >
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
attached mail follows:
Yes it is on a Linux system.
I have done a little research and I am having a hard time finding info about
executing shell commands with php.
This seems like a very interesting possibility being able to use shell
commands. Any info you could point me to would be very appreciated.
I did find this piece of code that doesn't work for me. Maybe it is missing
something?
<?php
$mstrng = shell_exec('du -sc home/joeuser/www/testdir/');
print "$mstrng";
?>
It produces "0 total" and I know there is more then 11 kb of file in the
directory.
I tried it pointed directly at the file in the directory and I also tried
the "du -h".
Thank you so much for your response.
"Jay Blanchard" <jay.blanchard
niicommunications.com> wrote in message
news:C8F323573C030A448F3E5A2B6FE2070B08EB9051
nemesis...
[snip]
I have been looking for a solution to get the disk size of a directory.
I would like to be able to get the size of a directory with sub
directories
under it.
Will I need to loop through file sizes to get the total directory size?
[/snip]
If you are on a *nix system of some sort you could exec du -h
attached mail follows:
hi ,
i have a stored procedure in postgresql and id like to call it or execute it from php. how do call this stored procedure with its variables or parameters?
thanx
attached mail follows:
> You are looking for serialize here. I bet you'd be better off with an
> existing XML format for something like this though.
WDDX is an unusual extension for most of the hosting providers. And
writing my own XML serialization mechanism is an overkill. Moreover, XML
is not-compact, harder to edit and probably slower to parse.
Compare this:
<wddxPacket version='1.0'><header comment='PHP'/><data><struct>
<var name='pi'><number>3.1415926</number></var><var name='cities'>
<array length='3'><string>Austin</string><string>Novato</string>
<string>Seattle</string></array></var></struct></data></wddxPacket>
(taken from php manual)
to this
a:2:{i:0;d:3.14159260000000006840537025709636509418487548828125;i:1;a:3:{i:0;s:6:"Austin";i:1;s:6:"Novato";i:2;s:6:"Seattle";}}
(Number is given exactly as it was output by serialize. What a happy
coincidence.)
and to this
array(3.1415926,array('Austin','Novato','Seattle'))
(which could be reduced even more by elliminating the outer array()
statement)
I'm surprised that there is no way to safely serialize and unserialize
things using the same syntax as PHP itself uses. I can, of course, write
PHP data structure parser in PHP, but that's twisted way of doing it,
and it will be *slow*.
attached mail follows:
hi,
id like to know if there is a way to filter or specify what type of files id like uploaded to my server. for example, if i make a form to upload image files, when i click browse there are 2 fields one that'll store the file name(of the file selected) and the other filetype (usually say all types) what id like is to specify in file type : *.jpg,*gif etc. is this possible?
thanx.
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]