php-general Digest 20 Oct 2005 08:15:47 -0000 Issue 3747
Topics (messages 224334 through 224356):
Function that convert national characters into ASCII
224334 by: Wiktor
Re: Imap, reading the email-body
224335 by: Leif Gregory
224336 by: Nahalingam N. Kanakavel
Classes or functions
224337 by: Khorosh Irani
224338 by: Khorosh Irani
224349 by: Brent Baisley
Re: Java editor
224339 by: John Taylor-Johnston
224340 by: Sascha Braun
224341 by: Robert Cummings
Re: some problems with php form
224342 by: Bruce Gilbert
224343 by: Jay Blanchard
224346 by: Bruce Gilbert
224347 by: Jay Blanchard
How can I get the url in the IE?
224344 by: Tomás Rodriguez Orta
224345 by: Jay Blanchard
Modular Authoring System
224348 by: Sascha Braun
concerning open_basedir and safe_mode on fileupload
224350 by: twistednetadmin
Re: How can I connect a remote server from phpmyadmin?
224351 by: twistednetadmin
win32service extension source code
224352 by: Evil Worm
224353 by: Jasper Bryant-Greene
Re: No redirect with header()
224354 by: Dotan Cohen
224355 by: Jasper Bryant-Greene
Putting Form Variables / URL Parameters in to an associative array?
224356 by: Jacques
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 ---
Hi,
Is there a function that will convert any european special characters
into standard ASCII letters eg. polish "ogonki" into a,e,o or german umlauts
into
ue,oe...?
something better than this...
//only PL chars
function Utf2Ascii($string)
{
$utf2ascii = array(
"\xC4\x84"=>"A",
"\xC4\x85"=>"a",
"\xC4\x86"=>"C",
"\xC4\x87"=>"c",
"\xC4\x98"=>"E",
"\xC4\x99"=>"e",
"\xC5\x81"=>"L",
"\xC5\x82"=>"l",
"\xC5\x83"=>"N",
"\xC5\x84"=>"n",
"\xC3\x93"=>"O",
"\xC3\xB3"=>"o",
"\xC5\x9A"=>"S",
"\xC5\x9B"=>"s",
"\xC5\xB9"=>"Z",
"\xC5\xBA"=>"z",
"\xC5\xBB"=>"Z",
"\xC5\xBC"=>"z",
);
return strtr($string, $utf2ascii);
}
--
Excuse my english ;)
Pozdrowienia,
Wiktor
--- End Message ---
--- Begin Message ---
Hello Bruno,
Wednesday, October 19, 2005, 10:08:24 AM, you wrote:
> Look the main page and try to read any message... I dont know what
> can i do to fix it...
nl2br()
(see php manual)
--
TBUDL/BETA/DEV/TECH Lists Moderator / PGP 0x6C0AB16B
__ ____ ____ ____ Geocaching: http://gps.PCWize.com
( ) ( ___)(_ _)( ___) TBUDP Wiki Site: http://www.PCWize.com/thebat/tbudp
)(__ )__) _)(_ )__) Roguemoticons & Smileys: http://PCWize.com/thebat
(____)(____)(____)(__) PHP Tutorials and snippets: http://www.DevTek.org
Speak softly and carry a big aardvark.
--- End Message ---
--- Begin Message ---
hi,
I think that I understood you problem some what,
if you are having newline character (\n) in you string ,
then you can use Regular expression to replace the \n character
with <br /> tag.
why can't you try something like the following
---------code------------
<?php
/* this is the convert newline character(s) into <br/> tag */
$string = "this is to first_line\nthis is second line.\nthird line";
$search = '@[\n]+@';
$replace = '<br />';
$result = preg_replace($search, $replace, $string);
print $result;
?>
------------------------------
if your input is like the value of "$string" then this will help you.
On 10/19/05, Bruno Gola <[EMAIL PROTECTED]> wrote:
>
> Hi guys,
>
> I need some help with the imap_body function and how to work with the
> string that this function returns...
>
> Im working on a mailing list archive website and i'm using the imap_*
> functions to handle this, the header works fine (and other things too)
> but the Body of the message dont work as expected. It came as one-line
> string, the "\n" character (or <br> in html) is simple ignored. I dont
> know how to make the function translate the "\n" to <br>.
>
>
> You can understand better what i'm saying looking:
>
> http://www.brunogola.com.br/testeimap.php
>
> Look the main page and try to read any message... I dont know what can i
> do to fix it...
>
> Thanks for any help and sorry any mistakes about my english...
>
> Bruno Gola
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--
with regds,
Nahalingam.
--- End Message ---
--- Begin Message ---
What this methods are better for php4? classes or functions
Does it better to use classes when I can write the codes with
functions?
Excuseme for my bad english
--- End Message ---
--- Begin Message ---
What this methods are better for php4? classes or functions
Does it better to use classes when I can write the codes with functions?
Excuseme for my bad english
--- End Message ---
--- Begin Message ---
It's really a matter of comfort level and opinion. There can be
strong arguments either way. Using just functions will be faster,
although the speed difference may be minimal and not noticeable.
Using just functions can be easier and quicker to develop, especially
for small projects.
But, using classes will allow your project to scale much better, if
only by giving you the ability to create variable scopes so that
variable and function names don't conflict. Classes will also allow
you to standardize your function names. For instance, you can have
multiple functions called getList(), but in different classes. Then
any time you need to retrieve a list of data, you call the getList()
function from the appropriate class (i.e. companies, contacts,
phones, etc).
That's a very basic example. My personal opinion is that you cannot
build a large scale project that will be easily maintainable without
using classes and object oriented concepts. That's not to say it
can't or hasn't been done (it has).
On Oct 19, 2005, at 12:42 PM, Khorosh Irani wrote:
What this methods are better for php4? classes or functions
Does it better to use classes when I can write the codes with
functions?
Excuseme for my bad english
--
Brent Baisley
Systems Architect
Landover Associates, Inc.
Search & Advisory Services for Advanced Technology Environments
p: 212.759.6400/800.759.0577
--- End Message ---
--- Begin Message ---
Thanks all. This was easy to install:
http://ccl.flsh.usherbrooke.ca/~johj2201/test.php
Jay Blanchard wrote:
[snip]
Is there a OS java (or other) html editor I can implement on a Web
page. I want a user to type text, use bold, italics, etc.
I would then store the html in a MySQl record and then use php to
insert the edited text.
[/snip]
Sorry I missed this earlier. Have you looked at htmlArea?
http://www.htmlarea.com/
--
John Taylor-Johnston
-----------------------------------------------------------------------------
"If it's not Open Source, it's Murphy's Law."
' ' ' Collège de Sherbrooke:
ô¿ô http://www.collegesherbrooke.qc.ca/languesmodernes/
- 819-569-2064
°v° Bibliography of Comparative Studies in Canadian, Québec and Foreign
Literatures
/(_)\ Université de Sherbrooke
^ ^ http://compcanlit.ca/ T: 819.569.2064
--- End Message ---
--- Begin Message ---
Please take a look at http://mozile.mozdev.org/
This is a browser based solution. Pretty cool i find.
bye
Am Dienstag, den 18.10.2005, 23:52 -0400 schrieb John Taylor-Johnston:
> Is there a OS java (or other) html editor I can implement on a Web page.
> I want a user to type text, use bold, italics, etc.
> I would then store the html in a MySQl record and then use php to insert
> the edited text.
> I've seen some packaged, in Moodle for example.
> John
>
--- End Message ---
--- Begin Message ---
On Wed, 2005-10-19 at 13:07, John Taylor-Johnston wrote:
> Thanks all. This was easy to install:
> http://ccl.flsh.usherbrooke.ca/~johj2201/test.php
IMHO would stay away from htmlarea, they've discontinued it in favour of
what I would guess is the unfree InnovaStudio (since it ranks first on
their site). Either way from what I've been seeing over the past few
months, fckeditor seems to be the most popular with good community
support.
Cheers,
Rob.
--
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting |
| a powerful, scalable system for accessing system services |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for |
| creating re-usable components quickly and easily. |
`------------------------------------------------------------'
--- End Message ---
--- Begin Message ---
Mike and all,
guess I still have something wrong as I am getting this error:
*Parse error*: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting
T_STRING or T_VARIABLE or T_NUM_STRING in *
/hsphere/local/home/bruceg/inspired-evolution.com/Contact_Form.php<http://evolution.com/Contact_Form.php>
* on line *52*
line 52 is:
<input class="<?PHP
if ($error_msg) {echo "error"}
else {echo "normal"}
?>" id="firstname" name="firstname" type="text" value="<?php
echo $_POST['firstname'] ?>">
how would I fix this error?
On 10/18/05, Ford, Mike <[EMAIL PROTECTED]> wrote:
>
> On 18 October 2005 15:50, Bruce Gilbert wrote:
>
> > I think so Minuk. Here is the *entire* form code below. Maybe
> > someone can
> > also point out why the email regex validation code isn't working? TIA
> > /****************************begin PHP form
> > code*************************************/
> >
> > <?php
> > $form_block=<<<END_FORM
>
> Here starteth a heredoc ;)
>
> > <form method="post" action="{$_SERVER['PHP_SELF']}"
> > class="info_request" > <fieldset class="left">
> > <legend title="About You">About You</legend>
> >
> > <p><label for="firstname"><span class="red">*</span> First
> > Name: </label><br
> > />
> >
> > <input class="<?PHP if ($error_msg){echo "input.error";}else{echo "
>
> Here you try to start a block of PHP code within the heredoc. You can't do
> that.
>
> Because you didn't show us the heredoc, most of the responses assumed you
> had broken out of PHP completely into HTML, which is why many of the
> solutions produced parse errors.
>
> > input.normal";}?>" id="firstname" name="firstname"
> > type="text" value="<?PHP
> > echo $_POST['firstname'];?>">
>
> Again, you're trying to use PHP code inside a heredoc -- this one's
> solvable, though: as you just want the value of the variable, you can use
> {$_POST['firstname']} (which I notice you do elsewhere!).
>
> Actually, since you use the heredoc's value once almost immediately after
> assigning it, I think you probably would be better breaking out into PHP for
> most of this, thusly:
>
> if ($_POST['op']!='ds') {
>
> ?>
> <form method="post" action="<?php echo $_SERVER['PHP_SELF'] ?>"
> class="info_request" >
> <fieldset class="left">
> <legend title="About You">About You</legend>
>
> <p><label for="firstname"><span class="red">*</span> First Name:
> </label><br />
>
> <input class="<?PHP
> if ($error_msg) {echo "error"}
> else {echo "normal"}
> ?>" id="firstname" name="firstname" type="text" value="<?php
> echo $_POST['firstname'] ?>">
>
> ... etc. ...
>
> <?php
> } else if ($_POST["op"] == "ds") {
>
> Hope this helps.
>
> Cheers!
>
> Mike
>
> ---------------------------------------------------------------------
> Mike Ford, Electronic Information Services Adviser,
> Learning Support Services, Learning & Information Services,
> JG125, James Graham Building, Leeds Metropolitan University,
> Headingley Campus, LEEDS, LS6 3QS, United Kingdom
> Email: [EMAIL PROTECTED]
> Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211
>
>
> To view the terms under which this email is distributed, please go to
> http://disclaimer.leedsmet.ac.uk/email.htm
>
--
::Bruce::
--- End Message ---
--- Begin Message ---
[snip]
<input class="<?PHP if ($error_msg) {echo "error"} else {echo "normal"}?>"
id="firstname" name="firstname" type="text" value="<?php echo
$_POST['firstname'] ?>">
how would I fix this error?
[/snip]
You are missing several semi-colons;
<input class="<?PHP if ($error_msg) {echo "error";} else {echo "normal";}?>"
id="firstname" name="firstname" type="text" value="<?php echo
$_POST['firstname']; ?>">
--- End Message ---
--- Begin Message ---
I now have:
<p><label for="firstname"><span class="red">*</span> First Name: </label><br
/>
<input class="<?PHP if ($error_msg) {echo "error";} else {echo "normal";}?>"
id="firstname" name="firstname" type="text" value="<?php echo
$_POST["firstname";]; ?>">
</p>
but I still receive the same error:
' *Parse error*: parse error, unexpected T_ENCAPSED_AND_WHITESPACE,
expecting T_STRING or T_VARIABLE or T_NUM_STRING in *
/hsphere/local/home/bruceg/inspired-evolution.com/Contact_Form.php<http://evolution.com/Contact_Form.php>
* on line *54 '*
On 10/19/05, Jay Blanchard <[EMAIL PROTECTED]> wrote:
>
> [snip]
> <input class="<?PHP if ($error_msg) {echo "error"} else {echo "normal"}?>"
> id="firstname" name="firstname" type="text" value="<?php echo
> $_POST['firstname'] ?>">
>
> how would I fix this error?
> [/snip]
>
> You are missing several semi-colons;
>
> <input class="<?PHP if ($error_msg) {echo "error";} else {echo
> "normal";}?>"
> id="firstname" name="firstname" type="text" value="<?php echo
> $_POST['firstname']; ?>">
>
--
::Bruce::
--- End Message ---
--- Begin Message ---
[snip]
I now have:
<p><label for="firstname"><span class="red">*</span> First Name: </label><br
/>
<input class="<?PHP if ($error_msg) {echo "error";} else {echo "normal";}?>"
id="firstname" name="firstname" type="text" value="<?php echo
$_POST["firstname";]; ?>">
</p>
You added one too many, change $_POST["firstname";]; to $_POST['firstname'];
<input class="<?PHP if ($error_msg) {echo "error";} else {echo "normal";}?>"
id="firstname" name="firstname" type="text" value="<?php echo
$_POST['firstname']; ?>">
--- End Message ---
--- Begin Message ---
Hello friend.
How can I get the url in the IE ?
best regards TOMAS
-------------------------------------------------------------------------
Este correo fue escaneado en busca de virus con el MDaemon Antivirus 2.27
en el dominio de correo angerona.cult.cu y no se encontro ninguna coincidencia.
--- End Message ---
--- Begin Message ---
[snip]
How can I get the url in the IE ?
[/snip]
http://us3.php.net/manual/en/reserved.variables.php#reserved.variables.serve
r
--- End Message ---
--- Begin Message ---
Hi,
I am now working on a concept for a webportal software in about 2 and a
halv year. As far as I am in the development of the project I was able
to write an authoring system with support of unlimited language transla-
tions and xml based frontend/screen engine.
All html forms and screens are generated via parsed xml frontend tem-
plates. The navigation elements are consisting of xml elements too.
Alot of things can be done, without the developer has to write html or
php code very much.
The media asset management system is able to convert images, videos and
in near future audio files to any format the player needs to play the
video or audio file without use of mplayer-plugin or windows media pla-
yer.
I wrote a question catalog management system, with which it is very easy
to add question catalogs to the content management system, so individual
services can be offered to customers, by evaluation of the user given
answers to the system.
The user management has a very detailed rights management, and the user
profiles are consisting of xml profile element templates which are
editable, thru the form engine, which is reading the xml profile tem-
plates and is displaying them as forms.
The screentext management is a nice frontend to the screentext database,
in which all frontend screentexts are stored, while the documents of the
content management system are entered by a special xml editor i wrote,
with wich the webauthor dont has to be able to know any html tags or
such things, so write content for the website.
In future i want to add the possebility to the editor, that authors are
going to be able to add tables, generated by the GD lib, so informations
cant just be grabbed by other companys too easy, so informations cant
really be stolen. And i want to add a frontend to the JPGraph lib, so
the authors will be able to enter values into the documents they are
working on, to add diagrams to the document.
I nice working template engine has to be written, so the design of the
hole page can change by daytime or the time of the year.
I added a cronjob management tool, so alot of tasks can be executed
timed as needed. If a customer of an couple finder service want to get
out of his contract, it can be done automatically to the end of the
month, without the site administrators have to do anything about it.
The Online shopping module should consist of a kind of neural network to
find out, what kind of products is fitting best to a customer with
specific account values based on the question catalog management tool.
Later I want to add an tracking system, a product managment system, and
marketing management tool, a statistics tool and many other things.
The hole system is build up modular and is based on php5.
No other programmer did ever take a look at this system, so I dont
really now, if my design is well, or if my php code is just wellformed.
I'm went to work alone, because i did so in the last 8 years.
My question is now, as this concept and the authoring system itself is
not opensource at the moment. If somepeople would like to take a look at
it, and maybe discuss with me, wheather to make it opensource, or
letting it stay as a commercial project.
My only goal is, to set up the webportals I have written concepts for in
the last couple of years. But the project is now comming into a size
where its nearly impossible to start anything new, because there still
are alot of holes in the modules.
And my pressure is growing abit.
All i can say, that is is possible to set up a content management based
website including webdesign and all other things can be done with the
authoring system in about 4 - 6 days, instead of one or two month, it
would take to write something like that on your own if you dont use all
of the modules the authoring system is consisting of at the moment.
I'm not the best programmer, but I'm good in software design and concep-
tion. So it would be really nice, to have some people around, who can
take care abit about the quality of the project. And maybe make use of
it, like i want too.
So best regards,
and lets make it happen :)))
Sascha Braun
--- End Message ---
--- Begin Message ---
I am making an imagegallery with fileuploads for the members of the site and
need a little info on how the open_basedir affects the fileupload.
I have read what I have found on it, but I'm not sure what it really does.
The phpinfo file says something like this:
PHP CORE config.
------------------------------------------
open_basedir (local value) /dir1/dir2/yoursite:/dir1/dir2/tempdir (master
value) No value
safe_mode (local value) On (master value) Off
-----------------------------------------
If I understood this correctly this means that I have to upload the
imagefile to $sysfolder="/dir1/dir2/tempdir"
Or would the $sysfolder be the whole value of the (local value):
/dir1/dir2/yoursite:/dir1/dir2/tempdir
And do I then have to move the file to the wanted directory for the uploads
with a php script?
And chmod(). Is this anything to have in mind?
Final question: Wich of the values am I gonna work out from?
My guess is offcourse the (local value), or I wouldn't get the:
*Warning: *copy(): open_basedir restriction in effect.
But I would believe the (master value) WAS the master value...if you get
what I mean?
Most of the time a "mastersomething" usually overrides a
"notmastersomething".... Agree?
Additional info:
The upload is from a form and works perfectly on my own testing server where
both safe_mode and open_basedir is turned of.
Can anyone explain this to me in a nice "master to noob" way? Or is more
information needed?
--- End Message ---
--- Begin Message ---
I asked my host to set up PHP and MySQL on the server.
They had either that or ASP with Access db.
I got an adress from them to the PHPmyadmin.
I don't think most webhosting companies allows remote access to th DB from
the local machines.
Offcourse....I could be wrong...
-Twisted-
--- End Message ---
--- Begin Message ---
Whre can i fid the source code for this extension?
it's documented at php.net/win32service and can be downloaded from
snaps.php.net/win32/ but the source isn't in the cvs. or did i miss
it?
--
"If you really want something in this life, you have to work for it.
Now, quiet! They're about to announce the lottery numbers..."
- Homer Simpson
--- End Message ---
--- Begin Message ---
On Thu, 2005-10-20 at 02:22 +0300, Evil Worm wrote:
> Whre can i fid the source code for this extension?
>
> it's documented at php.net/win32service and can be downloaded from
> snaps.php.net/win32/ but the source isn't in the cvs. or did i miss
> it?
http://cvs.php.net/pecl/win32service/
--
Jasper Bryant-Greene
General Manager
Album Limited
e: [EMAIL PROTECTED]
w: http://www.album.co.nz/
p: 0800 4 ALBUM (0800 425 286) or +64 21 232 3303
a: PO Box 579, Christchurch 8015, New Zealand
--- End Message ---
--- Begin Message ---
On 10/18/05, Oliver Grätz <[EMAIL PROTECTED]> wrote:
> Snippets are bad ;-)
>
> Please post a full example that is _not_ working on your server.
> Perhaps this is no PHP problem at all.
>
I know, but I don't want to post my tracking code. I am certain,
however, that it is not returning anything to the browser. The <?php
is at the top of the page, no echo, ...
Also, other people seem to be getting redirected, just not me! Paul
Waring mentioned here that he got redirected, as did a friend who
checked for me. I don't think that it is a php problem anymore,
rather, a problem at my end!
Thanks, though. I always appreciate the help I receive here. I
wouldn't get very far without it!
Dotan Cohen
http://lyricslist.com
3
--- End Message ---
--- Begin Message ---
On Thu, 2005-10-20 at 03:22 +0200, Dotan Cohen wrote:
> On 10/18/05, Oliver Grätz <[EMAIL PROTECTED]> wrote:
> > Snippets are bad ;-)
> >
> > Please post a full example that is _not_ working on your server.
> > Perhaps this is no PHP problem at all.
> >
>
> I know, but I don't want to post my tracking code. I am certain,
> however, that it is not returning anything to the browser. The <?php
> is at the top of the page, no echo, ...
So just blank out the tracking code. I'm not sure how you expect us to
help you if we can't see the code that isn't working :)
--
Jasper Bryant-Greene
General Manager
Album Limited
e: [EMAIL PROTECTED]
w: http://www.album.co.nz/
p: 0800 4 ALBUM (0800 425 286) or +64 21 232 3303
a: PO Box 579, Christchurch 8015, New Zealand
--- End Message ---
--- Begin Message ---
How can I grab parameters / key-value-pairs from a query string and put them
in to an associative array where each key-value pair inside the array
exactly corresponds with the key-value pairs inside the querystring?
Regards
Jacques
--- End Message ---