php-general Digest 24 Nov 2003 15:45:01 -0000 Issue 2434
Topics (messages 170757 through 170796):
Re: Duplicate Images
170757 by: John Nichel
Re: when to use \n in forms
170758 by: John Nichel
170759 by: Nigel Jones
170760 by: John Nichel
170762 by: Nigel Jones
170763 by: John Nichel
170765 by: Nigel Jones
Setting counter in variable name within foreach loop
170761 by: Jake McHenry
170764 by: Nigel Jones
170769 by: Curt Zirzow
170779 by: pete M
Parse WebCT quiz
170766 by: John Taylor-Johnston
170768 by: John Taylor-Johnston
odbc_tables
170767 by: Nicolas Gomez
Re: PHP with Java extension
170770 by: Ray Hunter
HTML email enconding
170771 by: Binay
170772 by: Eugene Lee
170774 by: Binay
170775 by: Eugene Lee
170776 by: Nathan Taylor
170780 by: Manuel Lemos
Securing PHP code..
170773 by: Video Populares et Optimates
170786 by: Jay Blanchard
Re: xml parser und bestehende variablen - multilinguale app
170777 by: Lucian Cozma
PHP 4.3.4 memory usage
170778 by: Joshiko Burger
Re: basic auth question
170781 by: Jay Blanchard
whaw
170782 by: pete M
170783 by: Andrei Reinus
170785 by: Andrei Reinus
170788 by: Chris Hayes
PHP.net broken
170784 by: Hatem Ben
Re: PHP.net broken -> comma missing
170787 by: Chris Hayes
ERROR on PHP.net index page!!!
170789 by: Paul
mysql row num, offset?
170790 by: Jan Grafström
file delimited
170791 by: tony
170792 by: Lucian Cozma
170793 by: Jay Blanchard
170795 by: tony
Excel Table & download it
170794 by: leon
170796 by: Jay Blanchard
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 ---
Erin wrote:
Hi All,
Please give me a hand with this, ive been trying to do this for the best
part of today but i have got no where!
I have two arrays both have 161 elements, each has a list of filenames on my
server (images) now the idea here is to take the image name from array 1
copy it and re-name it to that of array 2.
for example
$array_A[$i] = 123097
$array_B[$i] = 684547
I need to keep the original image as well as duplicate it & rename.
Many thanks
Use the manual, Luke.
http://www.php.net/manual/en/function.copy.php
--
By-Tor.com
It's all about the Rush
http://www.by-tor.com
--- End Message ---
--- Begin Message ---
Joffrey Leevy wrote:
Hi:
Can someone shed some light on this please? To me
when doing a form in php using \n or not using \n
makes no difference. I still get the form in my
browser to work.
For instance,
<?php
echo"<form action='processform_2b.php'
method='post'>\n
<select name='animal'>\n
<OPTION value='cat'>cat\n
<OPTION value='dog'>dog\n
<OPTION value='rat'>rat\n
etc.............
and
<?php
echo"<form action='processform_2b.php'
method='post'>\n
<select name='animal'>
<OPTION value='cat'>cat
<OPTION value='dog'>dog
<OPTION value='rat'>rat
etc.............
produce the same select menu in my browser. So is
using "\n" really that critical for this case?
Thanks
HTML ignores whitespace (new lines included). You can create your
entire HTML document on one line, but debugging it would be a bitch.
Throwing new lines in there isn't for the browser...but it can help you
in the long run.
--
By-Tor.com
It's all about the Rush
http://www.by-tor.com
--- End Message ---
--- Begin Message ---
No Diff, Plus i think that HTML is wrong....
Use:
<OPTION value='cat'>cat</OPTION>
<OPTION value='dog'>dog</OPTION>
<OPTION value='rat'>rat</OPTION>
Just for that HTML standards sake :P
_________________
Nigel Jones
[EMAIL PROTECTED]
>> -----Original Message-----
>> From: Joffrey Leevy [mailto:[EMAIL PROTECTED]
>> Sent: Monday, November 24, 2003 4:41 PM
>> To: [EMAIL PROTECTED]
>> Subject: [PHP] when to use \n in forms
>>
>>
>> Hi:
>>
>> Can someone shed some light on this please? To me
>> when doing a form in php using \n or not using \n
>> makes no difference. I still get the form in my
>> browser to work.
>> For instance,
>>
>> <?php
>> echo"<form action='processform_2b.php'
>> method='post'>\n
>> <select name='animal'>\n
>> <OPTION value='cat'>cat\n
>> <OPTION value='dog'>dog\n
>> <OPTION value='rat'>rat\n
>> etc.............
>> and
>>
>> <?php
>> echo"<form action='processform_2b.php'
>> method='post'>\n
>> <select name='animal'>
>> <OPTION value='cat'>cat
>> <OPTION value='dog'>dog
>> <OPTION value='rat'>rat
>> etc.............
>>
>> produce the same select menu in my browser. So is
>> using "\n" really that critical for this case?
>>
>> Thanks
>>
>>
>> __________________________________
>> Do you Yahoo!?
>> Free Pop-Up Blocker - Get it now
>> http://companion.yahoo.com/
>>
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
--- End Message ---
--- Begin Message ---
Nigel Jones wrote:
No Diff, Plus i think that HTML is wrong....
Use:
<OPTION value='cat'>cat</OPTION>
<OPTION value='dog'>dog</OPTION>
<OPTION value='rat'>rat</OPTION>
Just for that HTML standards sake :P
Most (if not all) browsers of today with handle it fine without the
closing </option> tag, but you're right for the standards sake.
--
By-Tor.com
It's all about the Rush
http://www.by-tor.com
--- End Message ---
--- Begin Message ---
How I take it is the fact that most is not all, it's best if possible to do
for all hence why I try to keep away from DHTML and Javascript
_________________
Nigel Jones
[EMAIL PROTECTED]
>> -----Original Message-----
>> From: John Nichel [mailto:[EMAIL PROTECTED]
>> Sent: Monday, November 24, 2003 4:52 PM
>> Cc: [EMAIL PROTECTED]
>> Subject: Re: [PHP] when to use \n in forms
>>
>>
>> Nigel Jones wrote:
>>
>> > No Diff, Plus i think that HTML is wrong....
>> > Use:
>> > <OPTION value='cat'>cat</OPTION>
>> > <OPTION value='dog'>dog</OPTION>
>> > <OPTION value='rat'>rat</OPTION>
>> >
>> > Just for that HTML standards sake :P
>>
>> Most (if not all) browsers of today with handle it fine without the
>> closing </option> tag, but you're right for the standards sake.
>>
>> --
>> By-Tor.com
>> It's all about the Rush
>> http://www.by-tor.com
>>
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
--- End Message ---
--- Begin Message ---
Nigel Jones wrote:
How I take it is the fact that most is not all, it's best if possible to do
for all hence why I try to keep away from DHTML and Javascript
I agree totally. Besides, I leave all that DHTML and JS to the 'Web
Designers' ;)
--
By-Tor.com
It's all about the Rush
http://www.by-tor.com
--- End Message ---
--- Begin Message ---
Not to offend anyone BUT
What the **** is DHTML and JS (and VB for that matter) meant to do, we can
use PHP instead who needs onLoad="Gimmethedampopups()" - not me anyway i
Perfer not to have popups :)
_________________
Nigel Jones
[EMAIL PROTECTED]
>> -----Original Message-----
>> From: John Nichel [mailto:[EMAIL PROTECTED]
>> Sent: Monday, November 24, 2003 5:01 PM
>> Cc: [EMAIL PROTECTED]
>> Subject: Re: [PHP] when to use \n in forms
>>
>>
>> Nigel Jones wrote:
>> > How I take it is the fact that most is not all, it's best if
>> possible to do
>> > for all hence why I try to keep away from DHTML and Javascript
>> >
>>
>> I agree totally. Besides, I leave all that DHTML and JS to the 'Web
>> Designers' ;)
>>
>> --
>> By-Tor.com
>> It's all about the Rush
>> http://www.by-tor.com
>>
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
--- End Message ---
--- Begin Message ---
Is this possible? I've been messing with this for about an hour now,
searching on google for about half hour. Here is what I want to do:
foreach ($array as $key => $value)
{
$value = explode("|", $value);
$counter = 0;
if ($value[7] == "Yes")
{
$counter++;
$date_$counter = $value[1]; <-- this is line 33
$dest_$counter = $value[3];
$dep_$counter = $value[4];
}
}
Then later, I would like to do:
for ($i = 0; $i < $counter; $i++)
{
echo "$date_$i, $dest_$i, $dep_$i<br>\n";
}
But, I get an error:
Parse error: parse error, unexpected T_VARIABLE in
/var/www/secure/travelrequest/travel7.php on line 33
Is there a way I can do this?
Thanks,
Jake McHenry
Nittany Travel MIS Coordinator
http://www.nittanytravel.com
--- End Message ---
--- Begin Message ---
>> $date_$counter = $value[1]; <-- this is line 33
>> $dest_$counter = $value[3];
>> $dep_$counter = $value[4];
you can't do that
you'd have to do something like $mydate[$counter] = $value[1];
_________________
Nigel Jones
[EMAIL PROTECTED]
>> -----Original Message-----
>> From: Jake McHenry [mailto:[EMAIL PROTECTED]
>> Sent: Monday, November 24, 2003 4:55 PM
>> To: [EMAIL PROTECTED]
>> Subject: [PHP] Setting counter in variable name within foreach loop
>>
>>
>> Is this possible? I've been messing with this for about an hour now,
>> searching on google for about half hour. Here is what I want to do:
>>
>> foreach ($array as $key => $value)
>> {
>> $value = explode("|", $value);
>> $counter = 0;
>>
>> if ($value[7] == "Yes")
>> {
>> $counter++;
>> $date_$counter = $value[1]; <-- this is line 33
>> $dest_$counter = $value[3];
>> $dep_$counter = $value[4];
>> }
>> }
>>
>> Then later, I would like to do:
>>
>> for ($i = 0; $i < $counter; $i++)
>> {
>> echo "$date_$i, $dest_$i, $dep_$i<br>\n";
>> }
>>
>>
>> But, I get an error:
>> Parse error: parse error, unexpected T_VARIABLE in
>> /var/www/secure/travelrequest/travel7.php on line 33
>>
>> Is there a way I can do this?
>>
>> Thanks,
>>
>> Jake McHenry
>> Nittany Travel MIS Coordinator
>> http://www.nittanytravel.com
>>
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
--- End Message ---
--- Begin Message ---
* Thus wrote Jake McHenry ([EMAIL PROTECTED]):
> Is this possible? I've been messing with this for about an hour now,
> searching on google for about half hour. Here is what I want to do:
>
> foreach ($array as $key => $value)
> {
> $value = explode("|", $value);
> $counter = 0;
You're reseting the counter inside the loop so your counter below
is always going to be zero.
>
> if ($value[7] == "Yes")
> {
> $counter++;
> $date_$counter = $value[1]; <-- this is line 33
> $dest_$counter = $value[3];
> $dep_$counter = $value[4];
Its possible to do that with something like
${'date_' . $counter} = $value[1];
But that is ugly, I would use one array to hold all the data
$data[$counter]['date'] = $value[1];
$data[$counter]['dest'] = $value[3];
$data[$counter]['dep'] = $value[4];
Then in your loop later in the script:
foreach ($data as $array) {
echo $array['date'], $array['date'], $array['date'];
}
imo, that makes the code more readable at what you're trying to do.
Curt
--
"My PHP key is worn out"
PHP List stats since 1997:
http://zirzow.dyndns.org/html/mlists/
--- End Message ---
--- Begin Message ---
Jake McHenry wrote:
Is this possible? I've been messing with this for about an hour now,
searching on google for about half hour. Here is what I want to do:
foreach ($array as $key => $value)
{
$value = explode("|", $value);
$counter = 0;
if ($value[7] == "Yes")
{
$counter++;
$date_$counter = $value[1]; <-- this is line 33
$date[$counter] = $value[1];
$dest_$counter = $value[3];
$dest[$counter] = $value[3];
$dep_$counter = $value[4];
$dep[$counter] = $value[4];
}
}
Then later, I would like to do:
for ($i = 0; $i < $counter; $i++)
{
echo "$date_$i, $dest_$i, $dep_$i<br>\n";
echo "$date[$i], $dest[$i], $dep[$i]<br>\n";
}
But, I get an error:
Parse error: parse error, unexpected T_VARIABLE in
/var/www/secure/travelrequest/travel7.php on line 33
Is there a way I can do this?
Thanks,
Jake McHenry
Nittany Travel MIS Coordinator
http://www.nittanytravel.com
--- End Message ---
--- Begin Message ---
Can someone help me get started?
Anyone ever use WebCT? It uses quizzes, field types described here.
https://online.csus.edu/web-ct/help/en/designer/quiz/quiz_transfer.html#formats
Can someone help me parse them out please? I don't want to pay for WebCT. It was a GNU
project gone commercial. It is a good project, but I can do better. I have an offlire
quiz generator that will export to WebCT format. I want to use that export type to
import.
I've learned how to parse stuff using explode
http://www.php.net/manual/en/function.explode.php
But this is a little beyond that. Here are some fields I'm trying to find. See WebCT
code below. Can someone help me get started please? Here are my field types
$TYPE
$TITLE
$QUESTION which iwll give me H or T
The I need the question, itself, which is one the next line.
$ANSWERS
$CASE
$ANSWER1
$ANSWER2
but here could be up to $ANSWER1-10 $ANSWERS does not count them. $ANSWERS is
That is just one quiz :TYPE: Quiz.txt might contain another quiz question :TYPE:.
https://online.csus.edu/web-ct/help/en/designer/quiz/quiz_transfer.html#formats
explains 5 quiz types.
if $TYPE = MC, there are three fields to add:
:TYPE:MC:1:0:C
$possible_number_of_correct_answers
$no_negative_scores
$cumulative_score_will_be_used
-----quiz.txt----------
:TYPE:S
:TITLE:Sample Exercise JQuiz 2 (2)
:CAT:Sample Exercise 2
:QUESTION:H
I have come here <u>a lot</u>.
:ANSWERS:1
:CASE:0
:ANSWER1:How often have you come here?:100:0:0
:ANSWER2:How often have I come here?:100:0:0
:TYPE:MC:1:0:C
:TITLE:Sample JBC Exercise 1 (1)
:CAT:Sample Exercise 1
:QUESTION:H
Which if the following sentences is incorrect?
:ANSWER1:0:H
That's not a very funny joke.
:REASON1:H
:ANSWER2:0:H
The book I'm reading is quite long.
:REASON2:H
:ANSWER3:0:H
He's much taller than me.
:REASON3:H
:ANSWER4:100:H
Anna is more younger than Halley.
:REASON4:H
The corrct response is: "Anna is younger than Halley."
--- End Message ---
--- Begin Message ---
I have done this (below) already. I suppose. I will have to explode by \n.
One of my problems is that with ":QUESTION:{H|T}", the question is on the next line.
Exploding by \n puts my question text into the next line_field[]. "Note: Multiple
lines of text are permitted."
Getting that variabnle confuses me, for example.
https://online.csus.edu/web-ct/help/en/designer/quiz/quiz_transfer.html#formats
Tested: http://ccl.flsh.usherbrooke.ca/~johj2201/webct_import.php
$fileContents=fread($fh, filesize($_FILES['userfile']['tmp_name']));
fclose($fh);
$lines=explode("\n",$fileContents);
foreach($lines as $line)
{
echo $line."<hr>";
}
-----quiz.txt----------
:TYPE:S
:TITLE:Sample Exercise JQuiz 2 (2)
:CAT:Sample Exercise 2
:QUESTION:H
I have come here <u>a lot</u>.
:ANSWERS:1
:CASE:0
:ANSWER1:How often have you come here?:100:0:0
:ANSWER2:How often have I come here?:100:0:0
:TYPE:MC:1:0:C
:TITLE:Sample JBC Exercise 1 (1)
:CAT:Sample Exercise 1
:QUESTION:H
Which if the following sentences is incorrect?
:ANSWER1:0:H
That's not a very funny joke.
:REASON1:H
:ANSWER2:0:H
The book I'm reading is quite long.
:REASON2:H
:ANSWER3:0:H
He's much taller than me.
:REASON3:H
:ANSWER4:100:H
Anna is more younger than Halley.
:REASON4:H
The corrct response is: "Anna is younger than Halley."
--- End Message ---
--- Begin Message ---
This function doesn't work for me following the
API, but I solve partially my problem using this:
$tablelist=odbc_result_all(odbc_tables($conn));
instead of :
$tablelist=odbc_tables($conn);
$tablelist=odbc_result_all($tablelist);
but I need to put the table names in a <select>
field; so I need to get only the field
TABLE_NAME. can somebody tell me how can I
extract this field only?.
I tried with
$tablelist=odbc_result(odbc_tables($conn),"TABLE_NAME");
but it doesn't work because I get only the first
row and nothing else.
Thanks and best regards.
Sorry for my english, I hope you understand.
Nicolas Gomez
_________________________________________________________
Do You Yahoo!?
Información de Estados Unidos y América Latina, en Yahoo! Noticias.
Visítanos en http://noticias.espanol.yahoo.com
--- End Message ---
--- Begin Message ---
> Any ideas and recommendations are more than welcome.
Try going the other way....try utilizing PHP in your servlet or j2ee
server environment. I have had greater success with this then trying to
get java integrated into PHP.
HTH
--
Ray
--- End Message ---
--- Begin Message ---
Hi all,
Is it necessary to encode the message using base64 or quoted-printable format while
sending the HTML email. What if i don't encode the message i.e (no
Content-Transfer-Encoding specified)? Does it impose some security vulnerabilities?
Please helpe me out
Thanks in advance
Binay
--- End Message ---
--- Begin Message ---
On Mon, Nov 24, 2003 at 02:56:25PM +0530, Binay wrote:
:
: Is it necessary to encode the message using base64 or quoted-printable
: format while sending the HTML email.
Not always. Sometimes you can get away with only:
Content-Type: text/html; charset="ISO-8859-1"
Content-Transfer-Encoding: 7bit
: What if i don't encode the message i.e (no Content-Transfer-Encoding
: specified)? Does it impose some security vulnerabilities?
These headers just provide more information to the mail client so that
it can properly handle and display the message. Some mail clients may
be more error-tolerant than others. But really you don't want your
messages to be handled and displayed incorrectly. Just as your PHP code
should generate HTML-compliant web pages, your code should also generate
correctly format email messages.
--- End Message ---
--- Begin Message ---
Hi Eugene,
Thanks for quick reply
So does it mean that if i don't encode the message then no need of
specifying the Content-Transfer-Encoding??
And almost all mail client will interpret it correctly??
Binay
----- Original Message -----
From: "Eugene Lee" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, November 24, 2003 3:02 PM
Subject: Re: [PHP] HTML email enconding
> On Mon, Nov 24, 2003 at 02:56:25PM +0530, Binay wrote:
> :
> : Is it necessary to encode the message using base64 or quoted-printable
> : format while sending the HTML email.
>
> Not always. Sometimes you can get away with only:
>
> Content-Type: text/html; charset="ISO-8859-1"
> Content-Transfer-Encoding: 7bit
>
> : What if i don't encode the message i.e (no Content-Transfer-Encoding
> : specified)? Does it impose some security vulnerabilities?
>
> These headers just provide more information to the mail client so that
> it can properly handle and display the message. Some mail clients may
> be more error-tolerant than others. But really you don't want your
> messages to be handled and displayed incorrectly. Just as your PHP code
> should generate HTML-compliant web pages, your code should also generate
> correctly format email messages.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
On Mon, Nov 24, 2003 at 03:33:57PM +0530, Binay wrote:
:
: So does it mean that if i don't encode the message then no need of
: specifying the Content-Transfer-Encoding??
: And almost all mail client will interpret it correctly??
No. If your HTML message is guaranteed to be in the ISO-8859-1 range
(e.g. only Latin-based languages), then you could likely get away with
just these two headers. But you still need to specify both of them.
: > Content-Type: text/html; charset="ISO-8859-1"
: > Content-Transfer-Encoding: 7bit
You need to follow the various RFCs to generate correct messsages. If
you don't have time for that, I suggest you look at existing classes
like PEAR's Mail_Mime package that does much of the work for you:
http://pear.php.net/package/Mail_Mime
--- End Message ---
--- Begin Message ---
There is a nice function called sendmail available in the comments on php.net/mail. I
use that regularly as it inserts all the necessary headers and supports multiple
attachments. It's well worth considering...
Nathan
----- Original Message -----
From: Eugene Lee
To: [EMAIL PROTECTED]
Sent: Monday, November 24, 2003 5:19 AM
Subject: Re: [PHP] HTML email enconding
On Mon, Nov 24, 2003 at 03:33:57PM +0530, Binay wrote:
:
: So does it mean that if i don't encode the message then no need of
: specifying the Content-Transfer-Encoding??
: And almost all mail client will interpret it correctly??
No. If your HTML message is guaranteed to be in the ISO-8859-1 range
(e.g. only Latin-based languages), then you could likely get away with
just these two headers. But you still need to specify both of them.
: > Content-Type: text/html; charset="ISO-8859-1"
: > Content-Transfer-Encoding: 7bit
You need to follow the various RFCs to generate correct messsages. If
you don't have time for that, I suggest you look at existing classes
like PEAR's Mail_Mime package that does much of the work for you:
http://pear.php.net/package/Mail_Mime
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Hello,
On 11/24/2003 07:26 AM, Binay wrote:
Is it necessary to encode the message using base64 or
quoted-printable format while sending the HTML email. What if i don't
encode the message i.e (no Content-Transfer-Encoding specified)? Does
it impose some security vulnerabilities?
In general yes because you messages may pass through gateways that do
not support 8 bit formats.
Anyway, you should never send HTML only messages because many anti-spam
filters will discard your messages. You need to compose HTML messages
with at least a dumb plain text alternative part in the same body. That
is done by sending a message with and compound multipart/alternative
message.
You may want to try this class to make it easy to send
multipart/alternative messages, as well multipart/related if you want to
embed any images related to the HTML message.
http://www.phpclasses.org/mimemessage
--
Regards,
Manuel Lemos
Free ready to use OOP components written in PHP
http://www.phpclasses.org/
--- End Message ---
--- Begin Message ---
Hi!
I'm pondering on a problem here. Being a C/C++, Java and Visual Basic developer, the
aspect of reverse engineering code from (compiled) programs, hasn't occupied my mind
that much.
Now, developing PHP scripts on large scale I have started to think otherwise. How do
you all secure your code? I'd really appreciate if someone could give me the bare and
gritty specifics on how it is possible to protect server side scripts such as PHP..
Thanks in advance,
Video Populares et Optimates
--- End Message ---
--- Begin Message ---
[snip]
I'm pondering on a problem here. Being a C/C++, Java and Visual Basic
developer, the aspect of reverse engineering code from (compiled)
programs, hasn't occupied my mind that much.
Now, developing PHP scripts on large scale I have started to think
otherwise. How do you all secure your code? I'd really appreciate if
someone could give me the bare and gritty specifics on how it is
possible to protect server side scripts such as PHP..
[/snip]
It depends on what your definition of security is! :)
Actually this is very much a hot-button topic in PHP circles. Many use
code obsfuscators. There is at least one very young PHP compiler
(priadoblender). Several folks place copyright/left/center data in each
script.
I guess it comes down to asking, "what is it you wish to protect?". Many
PHP developers who compile (pun intended) large projects/products
release them as open-source, so they have no desire to hide code.
--- End Message ---
--- Begin Message ---
If you want that all the users will be able to help you, please post in
English.
Lucian
"Merlin" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hallo zusammen,
>
> ich möchte gerne meine bestehende app in mehreren Sprachen anbieten.
> Dazu habe ich mir ein xml parser package installiert welches in der Lage
> ist aus xml dateien inhalte einzufügen.
>
> Zum Bsp sieht das xml file so aus:
>
> <en>example</en>
> <de>beispiel</de>
>
> Das funktioniert so weit. Das PROBLEM allerdings is, wenn ich eine
> varible innerhalb dieses textes habe und nicht alles zerstückeln möchte,
> parst php diese inhalte nicht.
>
> Beispiel: $no = 10;
>
> <en>example '.$no.'</en>
> <de>beispiel '.$no.'</de>
>
> In diesem Fall bekommt man den Inhalt der Variable nicht angegeben,
> sondern einfahc den '.$no.' string.
>
> Was kann man da tun? Ich kann unmöglich alle texte aufsplitten. Das
> auslagern in eine xml datei ist ganz praktisch vor allem wenn es mehrere
> Sprachen werden.
>
> Hat hier jemand einen guten Tipp?
>
> vielen Dank im voraus,
>
> Andy
--- End Message ---
--- Begin Message ---
I'm concerned with very steep jump the PHP 4.3.4 made in memory usage
since 4.3.3. In 4.3.3 with configure options
'--disable-debug' '--enable-inline-optimization' '--with-gettext'
'--enable-track-vars' '--enable-mbstring' '--enable-mbregex'
'--enable-mbstr-enc-trans' '--with-gd' '--with-zlib' '--with-bz2'
'--enable-ftp' '--with-regex' '--enable-exif' '--with-iconv'
the memory usage for PHP process was 4372 kB after running a simple
phpinfo() script. This memory usage has been fairly consistent over many
versions.
However, the PHP 4.3.4 seem to have changed the trend big time. The same
configure options for PHP 4.3.4 results in memory usage of 5572 kB.
That's almost 30% more memory usage than 4.3.3.
I am holding back on putting PHP 4.3.4 in production because of this
issue. I've read that libraries for mbstring was rewritten for this
version, and I wonder if that is the cause.
--- End Message ---
--- Begin Message ---
[snip]
Please CC me, I am on digest
----------------------------------
If I have a directory like:
$HOME/www/ (document root)
It has a auth section in the .htaccess file
$HOME/www/.htaccess
another directory like:
$HOME/www/want_to_be_public/
How can I defeat the auth section in the
$HOME/www/.htaccess
file by commands in the:
$HOME/www/want_to_be_public/.htaccess
file?
[/snip]
Have you consulted the docs at http://www.apache.org ? That is where you
will find the answer to this question.
--- End Message ---
--- Begin Message ---
Even the pros systems crash sometimes
http://www.php.net/
--- End Message ---
--- Begin Message ---
pete M wrote:
Even the pros systems crash sometimes
http://www.php.net/
Dr. Evil-Parse-Error strikes again! :)
--- End Message ---
--- Begin Message ---
pete M wrote:
Even the pros systems crash sometimes
http://www.php.net/
// Highlight PHP code
function highlight_php($code, $return = FALSE)
{
// Using OB, as highlight_string() only supports
// returning the result from 4.2.0
ob_start();
highlight_string($code);
$highlighted = ob_get_contents();
ob_end_clean();
// Fix output to use CSS classes and wrap well
$highlighted = '<div class="phpcode">' . str_replace(
array(
' ' *<--- insert coma ?!?!?*
'<br />',
'<font color="',
'</font>',
"\n ",
' '
),
array(
' ',
"<br />\n",
'<span class="',
'</span>',
"\n ",
' '
),
$highlighted
) . '</div>';
if ($return) { return $highlighted; }
else { echo $highlighted; }
}
--- End Message ---
--- Begin Message ---
At 14:27 24-11-03, you wrote:
pete M wrote:
Even the pros systems crash sometimes
http://www.php.net/
webmaster says it is fixed now, just waiting for the mirrors to pick it up.
--- End Message ---
--- Begin Message ---
Greetings, it's from PHP.net :
Parse error: parse error, expecting `')'' in
/local/Web/sites/phpweb/include/layout.inc on line 29
Fatal error: Call to undefined function: make_image() in
/local/Web/sites/phpweb/index.php on line 117
Regards,
Hatem
--- End Message ---
--- Begin Message ---
At 14:21 24-11-03, you wrote:
Greetings, it's from PHP.net :
Parse error: parse error, expecting `')'' in
/local/Web/sites/phpweb/include/layout.inc on line 29
Fatal error: Call to undefined function: make_image() in
/local/Web/sites/phpweb/index.php on line 117
For in case the webmaster is monitoring:
you miss a comma at line 28:
$highlighted = '<div class="phpcode">' . str_replace(
array(
' ' ***HERE***
'<br />',
'<font color="',
'</font>',
"\n ",
' '
--- End Message ---
--- Begin Message ---
This is what I got on my browser:
Parse error: parse error, expecting `')'' in
/local/Web/sites/phpweb/include/layout.inc on line 29
Fatal error: Call to undefined function: make_image() in
/local/Web/sites/phpweb/index.php on line 117
And this is the problem:
$highlighted = '<div class="phpcode">' . str_replace(
array(
' '
'<br />',
'<font color="',
'</font>',
"\n ",
' '
),
array(
' ',
"<br />\n",
'<span class="',
'</span>',
"\n ",
' '
),
$highlighted
) . '</div>';
You missed a comma on the third line in this code (line 29 in layout.inc).
Paul
--- End Message ---
--- Begin Message ---
Hi,
can I get the rownumber (offset) from mysql?
After I have made a select I want to generate an update query wich works for
any table.
Thanks in advance for any help.
Jan
--- End Message ---
--- Begin Message ---
Hi,
I'm new to php I just come from perl, and I wanted to know like perl if we
can open a file and read delimited line just like the cvs function, but I
don't want comma separated, i want the vertical bar '|'.
also if we read that file can the 'column' go in an array like perl
i.e if we have a record
Name|Phone|address|age|email
can we put it into an array like
$record[]
and say
$record[0] is Name, $record[1] is Phone etc....
Any help is well appreciated.
--- End Message ---
--- Begin Message ---
array fgetcsv ( resource handle, int length [, string delimiter [, string
enclosure]])
PHP manual extract:
<?php
$row = 1;
$handle = fopen ("test.csv","r");
while ($data = fgetcsv ($handle, 1000, ",")) {
$num = count ($data);
print "<p> $num fields in line $row: <br>\n";
$row++;
for ($c=0; $c < $num; $c++) {
print $data[$c] . "<br>\n";
}
}
fclose ($handle);
?>Lucian"Tony" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi,
>
> I'm new to php I just come from perl, and I wanted to know like perl if we
> can open a file and read delimited line just like the cvs function, but I
> don't want comma separated, i want the vertical bar '|'.
> also if we read that file can the 'column' go in an array like perl
> i.e if we have a record
> Name|Phone|address|age|email
> can we put it into an array like
> $record[]
> and say
> $record[0] is Name, $record[1] is Phone etc....
>
> Any help is well appreciated.
--- End Message ---
--- Begin Message ---
[snip]
i want the vertical bar '|'.
[/snip]
http://www.php.net/explode
$theLine = fgets($theFile, 1024);
$arrayLine = explode("|", $theLine);
Now each item from the line is in $arrayLine[0] .... $arrayLine[n]
--- End Message ---
--- Begin Message ---
Hi,
I'm new to php I just come from perl, and I wanted to know like perl if we
can open a file and read delimited line just like the cvs function, but I
don't want comma separated, i want the vertical bar '|'.
also if we read that file can the 'column' go in an array like perl
i.e if we have a record
Name|Phone|address|age|email
can we put it into an array like
$record[]
and say
$record[0] is Name, $record[1] is Phone etc....
Any help is well appreciated.
--- End Message ---
--- Begin Message ---
hi~
I want generate an excel table & download it as a file (not view in IE), what HTML
mimetype should i use?
leon
[EMAIL PROTECTED]
2003-11-24
--- End Message ---
--- Begin Message ---
[snip]
I want generate an excel table & download it as a file (not view in IE),
what HTML mimetype should i use?
[/snip]
header("Content-Type: application/vnd.ms-excel");
header("Content-Disposition: inline; filename=\"excel.xls\"");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
--- End Message ---