php-general Digest 24 Aug 2003 18:54:05 -0000 Issue 2256

Topics (messages 160568 through 160598):

Re: Easy XML & PHP tutorials ?????
        160568 by: murugesan

CRC and Polynomials
        160569 by: Methusula
        160571 by: Andrew Brampton

regex replace href-content
        160570 by: Christoph Gassmann

Re: [EMAIL PROTECTED] RE: Can't POST over 500K
        160572 by: Jeffrey D. Means

HTML form handling
        160573 by: Chris Baxter

Re: homepage script..
        160574 by: DvDmanDT

Re: finding out localhost :-P
        160575 by: DvDmanDT

Does the URL influence if the page/data gets cached?
        160576 by: Richard Davey

str_replace performance in large mailing script
        160577 by: frederik feys
        160584 by: David Otton
        160586 by: David Otton

In need of a script
        160578 by: Stevie D Peele
        160580 by: Matt
        160581 by: jabber.raditha.com
        160596 by: Stevie D Peele
        160597 by: Curt Zirzow

Re: How to open random Flash page with hyperlink?
        160579 by: zerof

start_session()
        160582 by: murugesan
        160587 by: John W. Holmes

Help with reading files
        160583 by: Yasir Malik
        160585 by: jabber.raditha.com

Array element from function return
        160588 by: Wouter van Vliet
        160589 by: John W. Holmes
        160590 by: Wouter van Vliet

Content of Variable ist html code
        160591 by: Matthias Wulkow
        160592 by: Dan Anderson

Re: Using PHP on an .html file
        160593 by: Dan Anderson

vhost php_value include_path: Seg fault
        160594 by: Jason End

Re: parse error with mysql_connect
        160595 by: Catalin Trifu

Reading an MS Access Database file on *NIX platform using PHP
        160598 by: weston.leary.csoft.net

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 ---
www.w3schools.com

-murugesan
----- Original Message ----- 
From: "Boaz Yahav" <[EMAIL PROTECTED]>
To: "Joe Harman" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Sunday, August 24, 2003 1:09 AM
Subject: RE: [PHP] Easy XML & PHP tutorials ?????


Try this too : http://www.sitepoint.com/article/1165

Sincerely
 
berber
 
Visit http://www.weberdev.com/ Today!!!
To see where PHP might take you tomorrow.
Share your code : http://addexample.weberdev.com
Search for PHP Code from your browser http://toolbar.weberdev.com


-----Original Message-----
From: Joe Harman [mailto:[EMAIL PROTECTED] 
Sent: Friday, August 22, 2003 1:16 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Easy XML & PHP tutorials ?????


Hello all. does anyone have any very easy XML tutorials . I have a
simple weather feed I want to implement. but no XML experience

thanks

Joe Harman




 
 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

--- End Message ---
--- Begin Message ---
Hi,

Can anyone tell me which 32-bit polynomial is used by PHP in the crc
function? I am trying to write a crc function from scratch, however, php
does not appear to use any of the most commonly used polynomial divisors.

Methusula.



--- End Message ---
--- Begin Message ---
I found this mentioned in a old user comment (it might not be relevant now):
"Some quick reverse engineering shows they're using the standard CRC32
parameters:

Polynomial 0x04C11DB7l
Initial register value 0xFFFFFFFF
Register is inverted at end of calculation
Bytes are reflected as they come in, and the result is reflected before it
is returned.

The documentation says this function returns the CRC polynomial of the
string - that's a little misleading IMHO. I'd say it simply returns the CRC
of the string. The polynomial is a magic number in the calculation."

and I've just downloaded the lastest source and found the crc32 function to
be in crc32.c and crc32.h. In the comments it mentions that the polynomial
is
/* generated using the AUTODIN II polynomial
 * x^32 + x^26 + x^23 + x^22 + x^16 +
 * x^12 + x^11 + x^10 + x^8 + x^7 + x^5 + x^4 + x^2 + x^1 + 1
 */

and there is a big table of 256 number which you may find useful.

Oh finally I also found mentioned in the NEWS file that:
"- Added a crc32 checksum function - used by the UdmSearch search engine
  and currently run through a system call.  This will speed up the UdmSearch
  php frontend significantly. (Rasmus)"

Which seems to be called udm_crc32, and so far undocumented.

I hope this information has been useful.
Andrew
----- Original Message -----
From: "Methusula" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, August 22, 2003 1:01 PM
Subject: [PHP] CRC and Polynomials


> Hi,
>
> Can anyone tell me which 32-bit polynomial is used by PHP in the crc
> function? I am trying to write a crc function from scratch, however, php
> does not appear to use any of the most commonly used polynomial divisors.
>
> Methusula.
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

--- End Message ---
--- Begin Message ---
Dear List,

Iīm writing a little framework with special features for my application. The
content of my Website is in HTML-Pages from other users working with
HTML-Editors.

I parse the content in their <body> in my framework.

now I have to replace the content of their links from <a
href="test.html">test</a> to <a href="index.php?page=test.html">test</a>. It
works fine with the following replacement.

$body2 = preg_replace('/href="(.*?)"/i', 'href="index.php?page=$1"', $body);

But if the content of their hrefīs is an external link (http:// at
beginning) or a javascript-link (javascript: at beginning) I donīt want to
do that.

With (?<!http:\/\/) before a word I can say, if there is an http:// in front
of, donīt replace. But it works only if I know the content of the link...
like this.

$body1 = preg_replace('/href="(?<!http:\/\/)www.test.com"/i',
'href="index.php?page=internal"', $body);

I canīt figure out how to combine the two replacements to work...

do you have any sugesstion? thanks for your help.

christoph

--- End Message ---
--- Begin Message ---
This is not an apache proble it is a problem with your php.ini file.  In
this file there is a line that specifies how large of POST data can be
received, the default is 500k.  If you are running apache 2.0 there is
an additional place where this might be being defined.  You can find
this file in the conf.d directory where your config files for apache
live mine is /etc/httpd/conf.d/php.conf  I hope this helps.

-----Original Message-----
From: Caldwell Sgt Brandon L [mailto:[EMAIL PROTECTED] 
Sent: Friday, August 22, 2003 1:17 PM
To: '[EMAIL PROTECTED]'
Subject: RE: [EMAIL PROTECTED] RE: Can't POST over 500K


It really seems like apache isn't letting me post over 500kb. Here is
the sample code I used to test this problem independantly from the
bulletin board software:

<form name="form1" method="post" action=""
enctype="multipart/form-data"> <input type="file" name="imagefile"> 
 
<input type="submit" name="Submit" value="Submit"> 
  <?
if(isset( $Submit ))
{
copy ($_FILES['imagefile']['tmp_name'],$_FILES['imagefile']['name']) or
die ("Could not copy");
        echo "";
        echo "Name: ".$_FILES['imagefile']['name']."";
        echo "Size: ".$_FILES['imagefile']['size']."";
        echo "Type: ".$_FILES['imagefile']['type']."";
        echo "Copy Done....";//}
}
?></form>

I may have to break down and send this in chunks, but it really seems
that shouldn't be required. As for my phpinfo() response, it list 20M
which is what is in php.ini. I've gone all the way up to 200M just to be
sure.

-----Original Message-----
From: Leif W [mailto:[EMAIL PROTECTED]
Sent: Friday, August 22, 2003 9:54 AM
To: [EMAIL PROTECTED]
Subject: Re: [EMAIL PROTECTED] RE: Can't POST over 500K


If it is in fact a timeout issue, you may want to consider either
breaking up the file into smaller chunks and reassembling on the server,
or have the script only read so much, then stop and alert the client
with a page with a refresh and some javascript to resubmit the file
again, and have the server seek to the right position and read another
chunk of data, and so on until the file is done.  Not sure how to do it
in PHP.  I think PHP doesn't let you get at the system reads for a file
upload, it just does it and sticks it in $_FILES.  But Perl will let you
do such a thing, as there's no built-in mechanism for file uploads, it
has to be coded, or use some module.

Leif

----- Original Message ----- 
From: "Mike" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, August 22, 2003 9:36 AM
Subject: Re: [EMAIL PROTECTED] RE: Can't POST over 500K


> At 06:30 AM 8/22/2003, you wrote:
> >So no one else has anything suggestions on this?
> >
> >-----Original Message-----
> >From: Caldwell Sgt Brandon L
> >Sent: Wednesday, August 20, 2003 7:46 AM
> >To: '[EMAIL PROTECTED]'
> >Subject: Can't POST over 500K
> >
> >
> >         Not sure if this is Apache or PHP, but I'm leaning towards
Apache.
> >I'm using Invision Power Board (also phpBB), and whenever I attempt 
> >to upload a file, I am limited to 500KB files.  I've changed all the 
> >setting
in
> >php.ini as well as the settings in each of the respective BB
configurations.
> >The error varies per browser: IE returns page not found; Mozzilla 
> >return "The document has no data."; Konqueror responds with a lost
connection.
> >         I'm using Apache 2.0.40 with PHP 4 on a RedHat 9.0 server.
Thanks
>
> Someone else would be better suited then me to point you were to 
> change it (whether Apache or PHP or the Bulletin Board software), but 
> I would check time-out settings.
>
> 500kb files are pretty large, even for Cable, ISDN and DSL 
> connections. I just uploaded a 700+kb file to one of our servers (in 
> my case I used a
Miva
> applet I wrote some years ago to upload the file).
>
> I'm on business DSL (typically faster than residential DSL services) 
> and that 700+kb file took awhile to upload. I didn't time it (I should

> have - duh). While it didn't take minutes, it wasn't "near 
> instantaneous" either.
>
> So rather than checking for a "size limit", it might be worth looking 
> into a potential low time-out setting somewhere in your configuration 
> or application(s).
>
> Hope that helps.
> -mike
>
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server 
> Project. See <URL:http://httpd.apache.org/userslist.html> for more 
> info. To unsubscribe, e-mail: [EMAIL PROTECTED]
>    "   from the digest: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>



---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server
Project. See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: [EMAIL PROTECTED]
   "   from the digest: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server
Project. See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: [EMAIL PROTECTED]
   "   from the digest: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.512 / Virus Database: 309 - Release Date: 8/19/2003
 

---

Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.512 / Virus Database: 309 - Release Date: 8/19/2003
 

--- End Message ---
--- Begin Message ---
Hi,

I am trying to send the results of a form to my email account and am having
difficulty carrying the form variable through if I use an html mime type.

Basically, if I send the form using a plain text format, the form results
are sucessfully copied to the email, however, if I change to mime type to
HTML (becuase I want to include a company logo and make the form a little
easier to read by using tabulation and bold text), I only seem to get the
HTML, not the php variables that carry the from info.

Below is an example of the script for the body of the email, which I am then
sending using the mail() function:

$body =  <html>
    <body>
    <table width="85%" border="0"  align="center">
           <tr>
              <td width=50%>Applicant 1 Forename:</td>
              <td> <? $App_1_Forename; ?></td>
            </tr>
            <tr>
              <td>Applicant 1 Surname:</td>
              <td> <? $App_1_Surname; ?></td>
            </tr>
            <tr>
              <td>Applicant 2 Forename:</td>
              <td> <? echo $App_2_Forename; ?></td>
            </tr>
            <tr>
              <td>Applicant 2 Surname: </td>
              <td> <? echo $App_2_Surname; ?></td>
            </tr>
            </table>
            </body>
            </html>;

thanks in advance for any suggestions,

Chris

--- End Message ---
--- Begin Message ---
easyhost and invisionpower filemanager... Although, it seems better to write
the script yourself, would make it so much more fitting your exact wantings
and needs...

-- 
// DvDmanDT
MSN: [EMAIL PROTECTED]
Mail: [EMAIL PROTECTED]
"Dasmeet" <[EMAIL PROTECTED]> skrev i meddelandet
news:[EMAIL PROTECTED]
> Hi!,
> I am developing a web site for an ISP.. They want to add homepage
> functionality.. that is their subscribers can have thier homepage (say
> with 2MB space each).
> Is there any script (free or paid) for such system.. to manage, create
> accounts etc...
> Any information would be of great help!
> Thanks
> Dasmeet
>
> -- 
> --
> Domainwala.com
> Domain Names from $7.99 at http://www.domainwala.com

--- End Message ---
--- Begin Message ---
You can goto like whatsmyip.com (or something similar) to get your ip and
connect to it unless there's a proxy or something...
http://www.liero-masters.host.sk/ip.php is another place, that I use as it
only displays the IP, and nothing else... :p

However, connecting to the domainname should work... So, check the
settings...
-- 
// DvDmanDT
MSN: [EMAIL PROTECTED]
Mail: [EMAIL PROTECTED]
"Pag" <[EMAIL PROTECTED]> skrev i meddelandet
news:[EMAIL PROTECTED]
>
> Heres the problem. I have one of my client's site hosted on a crappy
> server, and i have it running with php+mysql ok, the thing is i need to
> connect to that site's mysql's database from a different site to get data.
> The problem is that on the origin site (the crappy server), to connect to
> the database, i use "localhost". How can i find out the real server to
> connect to from the other site? I tried using the whole domain, like
> www.crappyserver.com, but doesnt work. :-P
> Thanks.
>
> Pag

--- End Message ---
--- Begin Message ---
Hi all,

We've recently released a significantly sized new web site coded entirely in
PHP. One of the things done on the site is to link to various sections of it
as follows:

http://www.domain.com/?m=orders
http://www.domain.com/?f=index

As you can see we're neglecting to include the index.php in the link. Now
this actually works perfectly (as it should) and the pages are displayed as
you'd expect, however one thing we're finding is that it appears some
browser just don't cache any of the page data. The images, html etc seems to
be called back from the server each time. This is part speculation on my
behalf of just watching the page load, sometimes it doesn't seem to do it,
othertimes it does.  It's very hard to explain but I'm throwing it out here
incase anyone has any ideas?  I've not done anything special with the
headers, there's no gzip compression or anything. I'm just wondering in the
back of my mind if the data on a page with a URL such as that simply doesn't
get cached?

Feel free to test it out for yourselves on the live site:
http://www.thegamecreators.com - I do apologise in advance for Mozilla
users, we tested it heavily with Mozilla 1.4 on Windows but have had reports
that in newer versions the menu breaks out of the page.  In Opera7, IE and
Moz 1.4 it should work as designed.

Cheers,

Rich

--- End Message ---
--- Begin Message ---

Hi all,

 

I have a mailing script that sends individualised mails to users(some users even get more than one mail).

I have a template html mail file. I individualise this by using str_replace function.

It is really slow.

Can anyone point me to some performance tips?

I was thinking of including an modified template(with variables) in my message part.

 

Thanks for any help!

Fred

 


--- End Message ---
--- Begin Message ---
On Sun, 24 Aug 2003 14:42:01 +0200, you wrote:

>I have a mailing script that sends individualised mails to users(some
>users even get more than one mail).
>I have a template html mail file. I individualise this by using
>str_replace function. 
>It is really slow. 
>Can anyone point me to some performance tips?

Without knowing how you're doing it now, it's kinda hard.

First tip is to use the right tool for the job - use mailing list software,
not a scripting language optimised for HTML.

Second tip is that sprintf() should be faster than str_replace(). Compare:

$text = "Hello %s";
$name = "John";

echo (str_replace ("%s", $name, $text));
echo (sprintf ($text, $name));

Third tip is to make your template an array of strings rather than a single
large array.

Fourth tip is that you're probably running str_replace over the entire body
of the text. At the very least, pre-process the template to find out which
lines have substitutions in them, then only perform the replace on those
lines in the main loop.

Eg if we find that only lines 2, 3, and 15 need to be modified:

$text = array (/* blah */);
$lines = array (2, 3, 15);
$replacements = array ("John", "[EMAIL PROTECTED]", "Viagra");
$i = 0;
foreach ($lines as $line)
{
        $text[$line] = sprintf ($text[$line], $replacements[$i++]);
}

BTW, do you realise you're sending HTML emails?

--- End Message ---
--- Begin Message ---
On Sun, 24 Aug 2003 15:38:13 +0100, you wrote:

>Second tip is that sprintf() should be faster than str_replace(). Compare:
>
>$text = "Hello %s";
>$name = "John";
>
>echo (str_replace ("%s", $name, $text));
>echo (sprintf ($text, $name));

Thinking about it, straight concatenation should be faster than sprintf()

$text = "Hello %s, welcome to the list";
$text = explode ("%s", $text);
echo ($text[0] . $name . $text[1]);

The explode goes outside the main loop, of course. Pre-processing.

The downside is that the simpler (and faster) you make it, the more
assumptions you have to make about the template (in this case, one
substitution per line and the substitution can't be the first or last
element on the line).

--- End Message ---
--- Begin Message ---
Can someone show me an example of some code that works something like
this :

<?php

if cookie is present
redirect to a certain page

?>

Thanks

________________________________________________________________
The best thing to hit the internet in years - Juno SpeedBand!
Surf the web up to FIVE TIMES FASTER!
Only $14.95/ month - visit www.juno.com to sign up today!

--- End Message ---
--- Begin Message ---
On  Sunday, August 24, 2003 at 9:49 AM Stevie D Peele wrote:

> Can someone show me an example of some code that works something like
> this :
>
> <?php
>
> if cookie is present
> redirect to a certain page
>
> ?>
<?php // this must be the first line in the script (or use output
buffering) -- see http://www.php.net/header for explanation
if ($_COOKIE['cookie_I_want_to_know_about']) {
  header('Location: http://www.someserver.com/page.php');
?>

--- End Message ---
--- Begin Message --- it's in the manual.

Stevie D Peele wrote:

Can someone show me an example of some code that works something like
this :

<?php

if cookie is present
redirect to a certain page

?>

Thanks

________________________________________________________________
The best thing to hit the internet in years - Juno SpeedBand!
Surf the web up to FIVE TIMES FASTER!
Only $14.95/ month - visit www.juno.com to sign up today!





--
http://www.raditha.com/php/progress.php
A progress bar for PHP file uploads.

--- End Message ---
--- Begin Message ---
Heres what I wrote --

<?php
if ($_COOKIE['pagename'])
{
header('Location: http://www.net-riches.com/800x600.html');
}
?> 

and I got a parse error on line 4, but I do not see what is wrong on line
4!

Can anyone else see?

Thanks



On Sun, 24 Aug 2003 10:04:50 -0400 "Matt" <[EMAIL PROTECTED]> writes:
> On  Sunday, August 24, 2003 at 9:49 AM Stevie D Peele wrote:
> 
> > Can someone show me an example of some code that works something 
> like
> > this :
> >
> > <?php
> >
> > if cookie is present
> > redirect to a certain page
> >
> > ?>
> <?php // this must be the first line in the script (or use output
> buffering) -- see http://www.php.net/header for explanation
> if ($_COOKIE['cookie_I_want_to_know_about']) {
>   header('Location: http://www.someserver.com/page.php');
> ?>
> 
> 
> 
> 

--- End Message ---
--- Begin Message ---
* Thus wrote Stevie D Peele ([EMAIL PROTECTED]):
> Heres what I wrote --
> 
> <?php
> if ($_COOKIE['pagename'])
> {
> header('Location: http://www.net-riches.com/800x600.html');
> }
> ?> 
> 
> and I got a parse error on line 4, but I do not see what is wrong on line
> 4!

There is no parse error in that code.
 
Curt
-- 
"I used to think I was indecisive, but now I'm not so sure."

--- End Message ---
--- Begin Message ---
Please see this simple exemple:
http://www.educar.pro.br/faqgeral/fla0003.php
----
zerof
-----
"Phillip Pang" <[EMAIL PROTECTED]> escreveu na mensagem
news:[EMAIL PROTECTED]
> I'm trying to create a hyperlink that will open a random Flash page so that  users 
> will
see a different flash module each time. Here is some of the code  that I wrote but I'm 
not
sure if it'll work since I'm not very good at
> coding. Oh yeah, I'm not using a database either.
-----

--- End Message ---
--- Begin Message ---
Can any one say what it the purpose of start_session()
fuction
-murugesan.

--- End Message ---
--- Begin Message --- murugesan wrote:
Can any one say what it the purpose of start_session()
fuction

Umm... to start a session. Read this: http://us2.php.net/manual/en/ref.session.php


--
---John Holmes...

Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

PHP|Architect: A magazine for PHP Professionals – www.phparch.com




--- End Message ---
--- Begin Message ---
I am doing my development for our project on a Linux server, but our
client uses Windows. One of the features that we have is the ability to
send emails. The email feature will have a feature where the client can
upload a file from their computers with a list of emails. My script would
then parse out the file and send the emails. How would I access the
contents of the file? We are using PHP for the development. Thanks in
advance.
Yasir

--- End Message ---
--- Begin Message --- How to handle file upload is well explained right at the start of the manual. Once the file has been transfered to your server you can make use of the numerous methods described in the 'filesystem functions' of the manual to handle it.


Yasir Malik wrote:


I am doing my development for our project on a Linux server, but our
client uses Windows. One of the features that we have is the ability to
send emails. The email feature will have a feature where the client can
upload a file from their computers with a list of emails. My script would
then parse out the file and send the emails. How would I access the
contents of the file? We are using PHP for the development. Thanks in
advance.
Yasir





--
http://www.raditha.com/php/progress.php
A progress bar for PHP file uploads.

--- End Message ---
--- Begin Message ---
Hi,

I'm trying to get the first element of a value returned by a function ..

== example ==
function return_Array() {
        return ('one', 'zwei', 'kolm', 'vier');
}

print return_Array()[0];
==/ example ==

Now i'd like this script to print 'one' for me .. can it be done without
creating a temporary variable?

Thanks,
Wouter

--- End Message ---
--- Begin Message --- Wouter van Vliet wrote:

I'm trying to get the first element of a value returned by a function ..

== example ==
function return_Array() {
        return ('one', 'zwei', 'kolm', 'vier');
}

print return_Array()[0];
==/ example ==

Now i'd like this script to print 'one' for me .. can it be done without
creating a temporary variable?

No, use a temporary variable.


--
---John Holmes...

Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

php|architect: The Magazine for PHP Professionals – www.phparch.com
--- End Message ---
--- Begin Message ---
Hmm .. thanks .. but shortly after posting I came to this idea that I might
want to use array_shift(); for this one .. works with numerical indices ....

Out of interest, is it really impossible to get such a thing for string
indices?

 -> -----Oorspronkelijk bericht-----
 -> Van: John W. Holmes [mailto:[EMAIL PROTECTED]
 -> Verzonden: zondag 24 augustus 2003 17:34
 -> Aan: Wouter van Vliet
 -> CC: PHP General
 -> Onderwerp: Re: [PHP] Array element from function return
 ->
 ->
 -> Wouter van Vliet wrote:
 ->
 -> > I'm trying to get the first element of a value returned by a
 -> function ..
 -> >
 -> > == example ==
 -> > function return_Array() {
 -> >   return ('one', 'zwei', 'kolm', 'vier');
 -> > }
 -> >
 -> > print return_Array()[0];
 -> > ==/ example ==
 -> >
 -> > Now i'd like this script to print 'one' for me .. can it be
 -> done without
 -> > creating a temporary variable?
 ->
 -> No, use a temporary variable.
 ->
 -> --
 -> ---John Holmes...
 ->
 -> Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/
 ->
 -> php|architect: The Magazine for PHP Professionals – www.phparch.com
 ->
 -> --
 -> PHP General Mailing List (http://www.php.net/)
 -> To unsubscribe, visit: http://www.php.net/unsub.php
 ->

--- End Message ---
--- Begin Message ---
Hi php-general,

I'm thinking of how I could store the content of a String-variable a) in a
Variable to be passed to other functions b) in a Database (MySQL) too . The content is 
html-code (with
tags and style code (css)).
The point is that I'm making myself a kind
of CMS, and I want to edit a page, enter html code, store it in the
database and then display it as content on a page. So, in the edit
menu, I have to be able to see the html tags, but on the target page,
the html entities have to be translated by the browser... and all that
has to be storable in MySQL...

How do I do that the best...?!?
addslahes, stripslahses, htmlentities, html_entity_decode are the only
functions I have found, which seem to be really useful. Are there
others I could need, or do you think I'm fine with that?

Thanx for answering

SvT

-- 
Who is the ennemy?

--- End Message ---
--- Begin Message ---
I'm not sure what you're asking but...

Using htmlentities() and undohtmlentities() (look up the real functions)
to data going into and out of your database will allow you to store it
without getting lots of errors...

mySQL storage (even TEXT and BLOB types) can't be larger then so many
bytes (system dependent) so you would have to have code to split up and
put back together big web pages.

-Dan

On Sun, 2003-08-24 at 11:55, Matthias Wulkow wrote:
> Hi php-general,
> 
> I'm thinking of how I could store the content of a String-variable a) in a
> Variable to be passed to other functions b) in a Database (MySQL) too . The content 
> is html-code (with
> tags and style code (css)).
> The point is that I'm making myself a kind
> of CMS, and I want to edit a page, enter html code, store it in the
> database and then display it as content on a page. So, in the edit
> menu, I have to be able to see the html tags, but on the target page,
> the html entities have to be translated by the browser... and all that
> has to be storable in MySQL...
> 
> How do I do that the best...?!?
> addslahes, stripslahses, htmlentities, html_entity_decode are the only
> functions I have found, which seem to be really useful. Are there
> others I could need, or do you think I'm fine with that?
> 
> Thanx for answering
> 
> SvT
> 
> -- 
> Who is the ennemy?

--- End Message ---
--- Begin Message ---
> Better to do this in an .htaccess file, so you don't incur PHP processing
> overhead on the entire server (if there are others using it).

Apache suggests not using .htaccess files at all because they require a
recursive traversing of directories looking for .htaccess files, because
some supersede others or something like that.

So look up how to allow it only on that directory using the main config
files.  (Not sure if that's possible)

-Dan

--- End Message ---
--- Begin Message ---
Using:
- Apache 1.3.27
- PHP 4.2.3

I just changed my httpd.conf to have two virtual
hosts. One of them uses php, so I added the
include_path, but when I try to test the config I get
a core dump.
Here's the vhost section for the domain using php:
[...]
<VirtualHost *>
            ServerAdmin [EMAIL PROTECTED]
    DocumentRoot /usr/local/www/data/domain/
    ServerName domain.org
    ErrorLog /var/log/domain.org-error_log
    CustomLog /var/log/domain.org-access_log common
    php_value include_path ".:/usr/local/domainlibs"
    Alias /admin/ "/usr/local/www/data/domain/admin/"
</VirtualHost>
[...]

thanks, 

Jay

__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

--- End Message ---
--- Begin Message ---
    Hi,

    The prototype for mysql_connect is:

resource mysql_connect ( [string server [, string username [, string
password [, bool new_link [, int client_flags ]]]]] )

    As you can see you get parse error because the fourth argument
should be boolean, not string.

Cheers,
Catalin

35:     // Initialize MySQL database
36: $h =
mysql_connect('localhost','localhost',constant("mysql_user"),constant("mysql
_password"));
37: mysql_select_db('mjec_mjecnet', $h);

--- End Message ---
--- Begin Message ---
I'm building a small web application for a friend using PHP. He'd like to
use MS Access to keep the data in, and update the data on the site by FTP'ing 
Access files he edits on his machine up to the web host.

The web host is unix-based (FreeBSD, slightly hacked by Verio, I believe), so
this means COM functions aren't available. ODBC was my next thought, but I've
never used it, and there are a few things I don't understand. Setting up a 
DSN is one of them -- apparently this isn't as simple as constructing a string,
and all the tutorials I can find seem to involve going into a Windows control
panel and making a setting. This of course will not be possible, since there
are no windows control panels on FreeBSD.

In short: can anyone offer any quick tips on how to use the odbc database functions or 
PEAR::DB to query data from an MS Access file sitting on a UNIX box?

Thanks,
        Weston

--- End Message ---

Reply via email to