php-general Digest 3 Jan 2004 06:40:20 -0000 Issue 2509
Topics (messages 173646 through 173673):
Re: No cookie is being set?
173646 by: Matt Grimm
173651 by: Chris Shiflett
173652 by: Chris Shiflett
173673 by: Cesar Aracena
Happy New Year | PHP Look Back 2003
173647 by: Derick Rethans
Optional Vars in Functions
173648 by: Jason Williard
173650 by: Chris
173653 by: Chris Shiflett
173654 by: Eugene Lee
Re: Session logic question
173649 by: Chris Shiflett
173655 by: Al
extract/replace the content of html pages
173656 by: JLake
173659 by: Mike Migurski
173660 by: Martin Helie
Re: SimpleXML and documentation
173657 by: Tobias Bradtke
173658 by: Tobias Bradtke
End slash, small problem.
173661 by: Ryan A
173662 by: Mike Brum
173663 by: Ryan A
173667 by: Mike Brum
173668 by: Tom Rogers
example of posting board or shoutbox
173664 by: Austin
173665 by: Vail, Warren
173666 by: Austin
173671 by: Aidan Lister
Re: [sqlite] sqlite_encode_binary problems
173669 by: Bronislav Klu?ka
Production Websites (error loggin)
173670 by: Aidan Lister
Redirection to a named frame
173672 by: Geoffrey Thompson
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 ---
Why not just echo the ID var separately? Less confusing with the escaped
quotes and all. If you're not getting an ID var, it might be because you
didn't use the array quotes ($row['member_id']) as Larry mentioned.
Also be aware:
"If setcookie() successfully runs, it will return TRUE. This does not
indicate whether the user accepted the cookie."
http://us2.php.net/manual/en/function.setcookie.php
--
Matt Grimm
Web Developer
The Health TV Channel, Inc.
(a non - profit organization)
3820 Lake Otis Parkway
Anchorage, AK 99508
907.770.6200 ext. 686
907.336.6205 (fax)
E-mail: [EMAIL PROTECTED]
Web: www.healthtvchannel.org
"Cesar Aracena" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> As extrange as can be, the echo function simply returns the following:
>
> 31536000);
>
> but not the setcookie, $varname and $value parts... What's this? Do I
havve
> a missconfiguration in php.ini file?
>
> Thanks,
>
> Cesar Aracena
>
> "Larry Brown" <[EMAIL PROTECTED]> escribió en el mensaje
> news:[EMAIL PROTECTED]
> > shouldn't $row[member_id] be $row['member_id']. In case anyone can
profit
> > from this, when I find a function doesn't work right and I am using
> > variables in its execution I run an echo/die combination immediately
> before
> > the function to verify the data being fed to it is as it should be. In
> this
> > example...
> >
> > ...
> > $id = $_SESSION["user"];
> > echo "setcookie(\"memberlogin\", ".$id.", ".time() +60*60*24*365.");";
> > die();
> > setcookie...
> >
> > What does this yeild?
> >
> >
> >
> >
> >
> > -----Original Message-----
> > From: Cesar Aracena [mailto:[EMAIL PROTECTED]
> > Sent: Friday, January 02, 2004 2:28 AM
> > To: [EMAIL PROTECTED]
> > Subject: [PHP] No cookie is being set?
> >
> >
> > Hi again,
> >
> > I have the following code to first start a session and then write a
> > cookie... is that so hard? Well it is starting the session but the
cookie
> is
> > not being set. see:
> >
> > $row = mysql_fetch_array($result);
> > $_SESSION["user"] = $row[member_id];
> > if ($_POST["autologin"] == "yes")
> > {
> > $id = $_SESSION["user"];
> > setcookie("memberlogin", $id, time()+60*60*24*365);
> > header("Location: $CFG->wwwroot");
> > exit();
> > }
> > else
> > {
> > header("Location: $CFG->wwwroot");
> > exit();
> > }
> >
> > What can it be? No error is posted.
> >
> > Thanks in advanced,
> >
> > Cesar Aracena
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
--- Cesar Aracena <[EMAIL PROTECTED]> wrote:
> I have the following code to first start a session and then write a
> cookie... is that so hard?
Not hard at all. However, when trying to identify a problem, it is much
easier to try to isolate it. Forget the session, and see if you can set a
cookie:
<? header('Set-Cookie: foo=bar'); ?>
Try to read it on another page:
<? echo $_COOKIE['foo']; ?>
If that works, slowly modify it until it is identical to the code in
question, testing after each step.
Also, make sure the URL you are spcifying in the Location header is an
absolute URL. And, if you are on IIS, the Location header (and response
status code change) might be what is causing the problem, as IIS has a
known bug related to this.
Hope that helps.
Chris
=====
Chris Shiflett - http://shiflett.org/
PHP Security Handbook
Coming mid-2004
HTTP Developer's Handbook
http://httphandbook.org/
--- End Message ---
--- Begin Message ---
--- Larry Brown <[EMAIL PROTECTED]> wrote:
> when I find a function doesn't work right and I am using variables
> in its execution I run an echo/die combination immediately before
> the function to verify the data being fed to it is as it should be.
This is a very good suggestion, although your example might be confusing
to some people due to all of the quote escaping. Basically, Larry is
suggesting that you make your code appear in the browser with each of the
function parameters evaluated:
myfunc(foo, 1 + 2);
Your code may have:
myfunc($var1, $var2 + $var3);
So you might try this for debugging:
echo "myfunc($var1, $var2 + $var3);";
If this looks right, you can take it a step further to reveal the
arithmetic:
echo "myfunc($var1, " . $var2 + $var3 . ');';
Hope that helps.
Chris
=====
Chris Shiflett - http://shiflett.org/
PHP Security Handbook
Coming mid-2004
HTTP Developer's Handbook
http://httphandbook.org/
--- End Message ---
--- Begin Message ---
Hi all, and thanks for all your kind hel.
I found the problem although I don't know what was causing it. I simply
moved the setcookie() function to another page (standalone to say) and it
worked perfectly... my "Cookies" folder started to show/delete the cookie on
each request, and also the site could make use of it with no problem. Why
you ask? I don't know. I remember reading a long time ago that in some cases
the code was read by the server from the bottom up in some case, but I don't
know if this is the case... There was NOTHING that altered the setcookie()
function above it.
Cesar Aracena
"Chris Shiflett" <[EMAIL PROTECTED]> escribió en el mensaje
news:[EMAIL PROTECTED]
> --- Cesar Aracena <[EMAIL PROTECTED]> wrote:
> > I have the following code to first start a session and then write a
> > cookie... is that so hard?
>
> Not hard at all. However, when trying to identify a problem, it is much
> easier to try to isolate it. Forget the session, and see if you can set a
> cookie:
>
> <? header('Set-Cookie: foo=bar'); ?>
>
> Try to read it on another page:
>
> <? echo $_COOKIE['foo']; ?>
>
> If that works, slowly modify it until it is identical to the code in
> question, testing after each step.
>
> Also, make sure the URL you are spcifying in the Location header is an
> absolute URL. And, if you are on IIS, the Location header (and response
> status code change) might be what is causing the problem, as IIS has a
> known bug related to this.
>
> Hope that helps.
>
> Chris
>
> =====
> Chris Shiflett - http://shiflett.org/
>
> PHP Security Handbook
> Coming mid-2004
> HTTP Developer's Handbook
> http://httphandbook.org/
--- End Message ---
--- Begin Message ---
Hello!
I would like to wish you all a happy new year. In tradition with last
year I wrote a look back on the past year of PHP development again which
you can find here: http://www.derickrethans.nl/20040101.php
Have fun reading!
regards,
Derick
--- End Message ---
--- Begin Message ---
Is there a way to make a variable of a function optional?
Thank You,
Jason Williard
--- End Message ---
--- Begin Message ---
http://www.php.net/functions
-----Original Message-----
From: Jason Williard [mailto:[EMAIL PROTECTED]
Sent: Friday, January 02, 2004 1:11 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Optional Vars in Functions
Is there a way to make a variable of a function optional?
Thank You,
Jason Williard
--- End Message ---
--- Begin Message ---
--- Jason Williard <[EMAIL PROTECTED]> wrote:
> Is there a way to make a variable of a function optional?
Just give it a default value. Try this example:
<?
function myfunc($foo = 'bar')
{
echo "$foo\n";
}
myfunc('foo');
myfunc();
?>
Hope that helps.
Chris
=====
Chris Shiflett - http://shiflett.org/
PHP Security Handbook
Coming mid-2004
HTTP Developer's Handbook
http://httphandbook.org/
--- End Message ---
--- Begin Message ---
On Fri, Jan 02, 2004 at 01:20:50PM -0800, Chris wrote:
: Jason Williard asked:
: >
: > Is there a way to make a variable of a function optional?
:
: http://www.php.net/functions
More specifically:
http://www.php.net/manual/en/functions.arguments.php
e.g.
function puke ($stuff = "hairball")
{
echo "puking ".$stuff."\n";
return;
}
puke("beer"); // echoes "puking beer"
puke(); // echoes "puking hairball"
--- End Message ---
--- Begin Message ---
--- Al <[EMAIL PROTECTED]> wrote:
> Everything works fine, except when I include another script file that
> also uses the $_SESSION buffer.
>
> What appears to be happening is that start_session() on the second
> script reinitializes the session buffer and I lose the data from the
> first session.
Yes, as it should. You need to only start the session once.
Hope that helps.
Chris
=====
Chris Shiflett - http://shiflett.org/
PHP Security Handbook
Coming mid-2004
HTTP Developer's Handbook
http://httphandbook.org/
--- End Message ---
--- Begin Message ---
Thanks for the reply.
i just found the bug in my code. I had a statement in the second script:
$_SESSION = $array; that obviously, completely replaced everything in
the $_ SESSION buffer.
These little I gotchas can be fun.
Chris Shiflett wrote:
--- Al <[EMAIL PROTECTED]> wrote:
Everything works fine, except when I include another script file that
also uses the $_SESSION buffer.
What appears to be happening is that start_session() on the second
script reinitializes the session buffer and I lose the data from the
first session.
Yes, as it should. You need to only start the session once.
Hope that helps.
Chris
=====
Chris Shiflett - http://shiflett.org/
PHP Security Handbook
Coming mid-2004
HTTP Developer's Handbook
http://httphandbook.org/
--- End Message ---
--- Begin Message ---
Hello
I have a folder full of html pages that I need to extract the content from.
They all have <!-- content start --> and <!--content end --> comment tags
surrounding the content. I need an easy way (not one at a time) to extract
that content and place it in a new template.
Any ideas are appreciated. Im assuming it will have to be some sort of
strpos and substr thing, but I'm not sure how to automate my process
Thanks,
J.
--- End Message ---
--- Begin Message ---
>I have a folder full of html pages that I need to extract the content
>from. They all have <!-- content start --> and <!--content end -->
>comment tags surrounding the content. I need an easy way (not one at a
>time) to extract that content and place it in a new template.
>
>Any ideas are appreciated. Im assuming it will have to be some sort of
>strpos and substr thing, but I'm not sure how to automate my process
You want to get rid of the comments, or preserve the comments?
If the former, a simple preg_replace() will help. See the documentation
here: http://php.net/preg_replace, http://php.net/pcre.pattern.syntax, and
http://php.net/pcre.pattern.modifiers. You will search for pieces of text
bounded by '<!--' and '-->' that can span multiple lines. You will also
want to set the not-greedy modifier, so you don't clobber things like:
'<!-- comment -->not a comment<!-- comment -->'.
If the latter, you can use the third argument to preg_match_all() to save
above-matching comments strings into an array. See the documentation here:
http://php.net/preg-match-all.
---------------------------------------------------------------------
michal migurski- contact info and pgp key:
sf/ca http://mike.teczno.com/contact.html
--- End Message ---
--- Begin Message ---
Not sure I understand, but it sounds like you'd want to do something like:
$dir = "yourdir/";
$d = dir( $dir );
while (false !== ($file = $d->read())) {
if( substr( $file, 0, 1 ) == "." ) {
continue;
}
$fp = fopen( $dir . $file, "r" );
$contentArray = split( "<!--[a-z ]-->", fread( $fp, $file, filesize(
$dir . $file ) ) )
//deal with $contentArray here
fclose( $fp );
}
Is that what you had in mind?
"Jlake" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hello
>
> I have a folder full of html pages that I need to extract the content
from.
> They all have <!-- content start --> and <!--content end --> comment tags
> surrounding the content. I need an easy way (not one at a time) to extract
> that content and place it in a new template.
>
> Any ideas are appreciated. Im assuming it will have to be some sort of
> strpos and substr thing, but I'm not sure how to automate my process
>
> Thanks,
>
> J.
--- End Message ---
--- Begin Message ---
Hi!
> [SimpleXML] but cannot find
> any real documentation.
> Is there any docs somewhere ? where ?
I couldn't find any documentation either..
Only quite simple examples.
> If not, does someone can answer a few questions ?
I have a php-testscript with the things i found out.
But some things seem to be quite bugy..
Hope it helps a bit!
webwurst
--- End Message ---
--- Begin Message ---
hm.. attachement didn't work.
here is the script:
<?php
echo "<pre>";
// at first:
// sorry for my bad english! =)
// i'm using php5beta3 on win32
// some interessting links:
//
// http://www.w3.org/TR/DOM-Level-2-Core/core.html
//
$xml_string = "
<books>
<book id='22'>
<title attr='attr'>The Grapes of Wrath</title>
<author>John Steinbeck</author>
</book>
<book id='23'>
<title>The Pearl</title>
<author>John Steinbeck</author>
</book>
<test>
<dog>
<snout>
<cat>
<stomach>
<mouse />
</stomach>
</cat>
</snout>
</dog>
</test>
<test />
<test />
<test />
</books>
";
$sxe = simplexml_load_string($xml_string);
// i can't call sxe_dump() twice in this script
// causes crash.. (?)
//echo sxe_dump($sxe);
//echo sxe_dump($sxe);
// you can read and write the content of a node
echo $sxe->book[0]->title;
$sxe->test[0]->dog->snout->cat->stomach = "cat food";
// you can add/set an attribute
$sxe->test[0]->dog['mood'] = "evil";
// and remove it again
unset($sxe->test[0]->dog['mood']);
// but i don't know how to add another dog:
// $sxe->test[0]->dog[1]-> "test";
// ^conflicts with adding/setting attributes, i think
// and i can't add another element:
// (no error, but no effect too)
$sxe->newelement = "text_text";
// error; thinks 'newelement' is an attribute
$sxe->newelement = simplexml_load_string("<text_text>bla</text_text>");
// no error, no effect:
$sxe->newelement[] = simplexml_load_string("<text_text>bla</text_text>");
// to add a new element you can workaround with this:
// first you export the simplexml to dom.
// then you can append (or whatever) a new created child
// this immediatly takes effect on the $sxe! :) great!
//
// the create_node_from_string() is listed below
// only one line, unfortunately you have to pass
// the 'ownerDocument' or the new document-part
// can't be imported correctly..
// comment these two lines
// if you want to manipulate the search-result below..
$dom = dom_import_simplexml($sxe);
$dom->appendChild(create_node_from_string($dom->ownerDocument,
"<book><title>new_book</title><isbn>456</isbn></book>"));
// you also can manipulate xsearch-results directly:
$xsearch = $sxe->xsearch('[EMAIL PROTECTED]"23"]');
print_r($xsearch);
// for me this doesn't work if i did append the child above
// you can uncomment these two lines
// if you comment out the lines above
//
// :(
/*
$dom = dom_import_simplexml($xsearch[0]);
$dom->appendChild(create_node_from_string($dom->ownerDocument,
"<isbn>123abc</isbn>"));
*/
echo "<br /><br />";
echo sxe_dump($sxe);
// mayby some interesting output..
echo "<br /><br />";
print_r(get_class_methods('simplexml_element'));
print_r(get_class_methods('domelement'));
print_r(get_class_methods('domnode'));
exit;
function create_node_from_string($document, $xml_string)
{
return
$document->importNode(dom_import_simplexml(simplexml_load_string($xml_string)),
true);
}
function sxe_dump($sxe)
{
// tag_name
$tagName = dom_import_simplexml($sxe)->nodeName;
$echo = "<span style='color:#007700'><</span><span
style='color:#0000BB'>$tagName</span>";
// attributes
foreach ($sxe->attributes() as $attributeName => $attributeValue)
$echo .= " <span style='color:#0000BB'>$attributeName=</span><span
style='color:#DD0000'>\"$attributeValue\"</span>";
$count = count(get_object_vars($sxe));
if ($count or (string)$sxe)
{
// nodeValue
$echo .= "<span style='color:#007700'>></span>".trim($sxe);
// child_nodes
if ($count)
{
$echo .= "<div style='margin:0 1em'>";
foreach ($sxe as $childNode)
$echo .= sxe_dump($childNode)."<br />";
$echo .= "</div>";
}
// close tag_name
$echo .= "<span style='color:#007700'></</span><span
style='color:#0000BB'>$tagName</span><span
style='color:#007700'>></span>";
}
else
{
// close empty tag_name
$echo .= " <span style='color:#007700'>/></span>";
}
return $echo;
}
?>
--- End Message ---
--- Begin Message ---
Hi,
Small problem, I am asking my users to enter a path for something in a
textbox..
eg:
/home/blah/something
am confused as to how I can see if the entered path has an ending slash, if
it has a end slash:
$hasSlash=1 else $hasSlash=0
then i can carry on with my output...
Thanks in advance.
Cheers,
-Ryan
--- End Message ---
--- Begin Message ---
Do you want code to be handled differently if it's there or do you want it
to be a certain way (e.g. always with trailing slash or never w/ trailing
slash)?
If you want it to always be a certain way, why not grab the last character
of the path, check if it's a slash and then if it's not how you want it to
be, either add the slash or remove it accordingly and then proceed with your
logic.
This will keep your code more precise as you're always acting on a path of a
certain format and you can do your check before that code is executed.
Regards
-M
-----Original Message-----
From: Ryan A [mailto:[EMAIL PROTECTED]
Sent: Friday, January 02, 2004 8:08 PM
To: [EMAIL PROTECTED]
Subject: [PHP] End slash, small problem.
Hi,
Small problem, I am asking my users to enter a path for something in a
textbox..
eg:
/home/blah/something
am confused as to how I can see if the entered path has an ending slash, if
it has a end slash:
$hasSlash=1 else $hasSlash=0
then i can carry on with my output...
Thanks in advance.
Cheers,
-Ryan
--
PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:
http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Hi,
Thanks for replying.
Basically after that path I am adding a file "ryanFile.php" so I need that
ending slash to always be in the path
My question was exactly that...how do I "grab" the last character?
Thanks,
-Ryan
On 1/3/2004 2:14:10 AM, Mike Brum ([EMAIL PROTECTED]) wrote:
> Do you want code to be handled differently if
> it's there or do you want it
> to be a certain way (e.g. always with trailing slash or never w/ trailing
> slash)?
>
> If you want it to always be a certain way, why not grab the last character
> of the path, check if it's
> a slash and then if
> it's not how you want it to
> be, either add the slash or remove it accordingly and then proceed with
your
> logic.
>
> This will keep your code more precise as you're
> always acting on a path of a
> certain format and you can do your check before that code is executed.
>
> Regards
> -M
>
> -----Original Message-----
> From: Ryan A [mailto:[EMAIL PROTECTED]
> Sent: Friday, January 02, 2004 8:08 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] End slash, small problem.
>
> Hi,
> Small problem, I am asking my users to enter a path for something in a
> textbox..
> eg:
> /home/blah/something
>
> am confused as to how I can see if the entered path has an ending slash,
> if
> it has a end slash:
> $hasSlash=1 else $hasSlash=0
>
> then i can carry on with my output...
>
> Thanks in advance.
>
> Cheers,
> -Ryan
>
> --
> PHP
--- End Message ---
--- Begin Message ---
substr()
http://us2.php.net/manual/en/function.substr.php
Regards
-M
-----Original Message-----
From: Ryan A [mailto:[EMAIL PROTECTED]
Sent: Friday, January 02, 2004 8:23 PM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: RE: [PHP] End slash, small problem.
Hi,
Thanks for replying.
Basically after that path I am adding a file "ryanFile.php" so I need that
ending slash to always be in the path
My question was exactly that...how do I "grab" the last character?
Thanks,
-Ryan
On 1/3/2004 2:14:10 AM, Mike Brum ([EMAIL PROTECTED]) wrote:
> Do you want code to be handled differently if it's there or do you
> want it to be a certain way (e.g. always with trailing slash or never
> w/ trailing slash)?
>
> If you want it to always be a certain way, why not grab the last
> character of the path, check if it's a slash and then if it's not how
> you want it to be, either add the slash or remove it accordingly and
> then proceed with
your
> logic.
>
> This will keep your code more precise as you're always acting on a
> path of a certain format and you can do your check before that code is
> executed.
>
> Regards
> -M
>
> -----Original Message-----
> From: Ryan A [mailto:[EMAIL PROTECTED]
> Sent: Friday, January 02, 2004 8:08 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] End slash, small problem.
>
> Hi,
> Small problem, I am asking my users to enter a path for something in a
> textbox..
> eg:
> /home/blah/something
>
> am confused as to how I can see if the entered path has an ending
> slash, if it has a end slash:
> $hasSlash=1 else $hasSlash=0
>
> then i can carry on with my output...
>
> Thanks in advance.
>
> Cheers,
> -Ryan
>
> --
> PHP
--
PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:
http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Hi,
Saturday, January 3, 2004, 11:23:00 AM, you wrote:
RA> Hi,
RA> Thanks for replying.
RA> Basically after that path I am adding a file "ryanFile.php" so I need that
RA> ending slash to always be in the path
RA> My question was exactly that...how do I "grab" the last character?
RA> Thanks,
RA> -Ryan
I do it like this:
$sep = (PHP_OS == 'Windows')? '\':'/';
$template_path .= (substr($template_path,-1) == $sep)? '':$sep;
--
regards,
Tom
--- End Message ---
--- Begin Message ---
how do i make something where some1 enters text, a name, and email
address, etc. and can post it onto a textarea or something, in a format of
Name
Email(mailto link)
Message here
[If admin: link here to delete post]
--------Ending line that seperates each post---------
[ admin login at bottom ]
i know this is allot to explain,
i am new to php,
-thank you
-Austin
--- End Message ---
--- Begin Message ---
Not sure I fully understand your problem, but if you are trying to simply
move information from one area of a form to another, without doing a form
post, then you might consider a javascript solution. This will happen
almost instantaneously, since it all occurs on the browser machine.
In order to use PHP, you will need to cause a form post (a submit) to occur
to get the contents of your form elements to the server with the PHP code,
where your code will take the form contents and echo the form html back to
the browser with your data moved to the textarea like you want.
hope this helps,
Warren Vail
-----Original Message-----
From: Austin [mailto:[EMAIL PROTECTED]
Sent: Friday, January 02, 2004 5:29 PM
To: [EMAIL PROTECTED]
Subject: [PHP] example of posting board or shoutbox
how do i make something where some1 enters text, a name, and email
address, etc. and can post it onto a textarea or something, in a format of
Name
Email(mailto link)
Message here
[If admin: link here to delete post]
--------Ending line that seperates each post---------
[ admin login at bottom ]
i know this is allot to explain,
i am new to php,
-thank you
-Austin
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
ya, i want to do it in php with a submit, altho i dont know how =\.
can u send me examples of what the code would look like and explain it,
Thank you!
Vail, Warren wrote:
Not sure I fully understand your problem, but if you are trying to simply
move information from one area of a form to another, without doing a form
post, then you might consider a javascript solution. This will happen
almost instantaneously, since it all occurs on the browser machine.
In order to use PHP, you will need to cause a form post (a submit) to occur
to get the contents of your form elements to the server with the PHP code,
where your code will take the form contents and echo the form html back to
the browser with your data moved to the textarea like you want.
hope this helps,
Warren Vail
-----Original Message-----
From: Austin [mailto:[EMAIL PROTECTED]
Sent: Friday, January 02, 2004 5:29 PM
To: [EMAIL PROTECTED]
Subject: [PHP] example of posting board or shoutbox
how do i make something where some1 enters text, a name, and email
address, etc. and can post it onto a textarea or something, in a format of
Name
Email(mailto link)
Message here
[If admin: link here to delete post]
--------Ending line that seperates each post---------
[ admin login at bottom ]
i know this is allot to explain,
i am new to php,
-thank you
-Austin
--- End Message ---
--- Begin Message ---
Austin,
We're not here to write scripts for you, I suggest you start by reading the
manual at php.net. After you have a basic idea of how to use PHP, try
looking at a couple of examples online. Use google, and search for "Database
driven websites".
Another option is to use a pre-made shoutbox, again try google.com
"Austin" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> ya, i want to do it in php with a submit, altho i dont know how =\.
> can u send me examples of what the code would look like and explain it,
> Thank you!
>
> Vail, Warren wrote:
>
> >Not sure I fully understand your problem, but if you are trying to simply
> >move information from one area of a form to another, without doing a form
> >post, then you might consider a javascript solution. This will happen
> >almost instantaneously, since it all occurs on the browser machine.
> >
> >In order to use PHP, you will need to cause a form post (a submit) to
occur
> >to get the contents of your form elements to the server with the PHP
code,
> >where your code will take the form contents and echo the form html back
to
> >the browser with your data moved to the textarea like you want.
> >
> >hope this helps,
> >
> >Warren Vail
> >
> >-----Original Message-----
> >From: Austin [mailto:[EMAIL PROTECTED]
> >Sent: Friday, January 02, 2004 5:29 PM
> >To: [EMAIL PROTECTED]
> >Subject: [PHP] example of posting board or shoutbox
> >
> >
> >how do i make something where some1 enters text, a name, and email
> >address, etc. and can post it onto a textarea or something, in a format
of
> >
> >Name
> >Email(mailto link)
> >Message here
> >[If admin: link here to delete post]
> >--------Ending line that seperates each post---------
> >[ admin login at bottom ]
> >
> >
> >i know this is allot to explain,
> >i am new to php,
> >
> >-thank you
> >-Austin
> >
> >
> >
--- End Message ---
--- Begin Message ---
I do not know solution to your problem, but is it possible for u to use
BASE64 coding to convert binary file into text file and save it as test
field?
Brona
> -----Original Message-----
> From: John Scott [mailto:[EMAIL PROTECTED]
> Sent: Friday, January 02, 2004 2:35 PM
> To: [EMAIL PROTECTED]
> Subject: [sqlite] sqlite_encode_binary problems
>
>
> Hi folks,
>
> I want to use sqlite_encode_binary to encode zip files into
> sqlite databse. But somehow I don't get the wanted result of this
> procedure.
> Can someone tell me where i made a mistake??
>
>
> Encoding:
>
> wxFFile *load_file = new wxFFile();
> load_file->Open("pc.zip", "rb");
> size_t size = load_file->Length();
>
> char in[size];
> unsigned long nLoadSize = load_file->Read((void *)in, size);
> unsigned char out[2 +(257*nLoadSize)/254];
> sqlite_encode_binary((const unsigned char*)in,
> 257*nLoadSize)/254, (unsigned char*)out);
>
> Decoding:
>
> query_result->Execute("select * from file where ID = '1');
> const char* binary = query_result->GetField(0, 2);
> const char* out;
> int nSize = strlen(binary);
> unsigned char out[nSize];
> sqlite_decode_binary((const unsigned char*)binary, (unsigned char*)out);
>
> Result:
>
> The zip file is broken.
>
>
> Please help me,
> best regardes
> Martin
>
>
>
>
> ---------------------------------
> 每天都 Yahoo!奇摩
> 海的顏色、風的氣息、愛你的溫度,盡在信紙底圖
> 信紙底圖
--- End Message ---
--- Begin Message ---
If anyone has successfully got php error logging working on a production
website, could you please reply with the steps taken?
I'm using RH7.3, Apache1.3x, PHP4.3x
My php.ini has:
log_errors = On
error_log = /var/log/httpd/php/error_log
However the errorlog is never created.
Thanks for any help.
--- End Message ---
--- Begin Message ---
I was only able to find one reference to targeting a named frame on a
redirection, in the "MySQL Cookbook" by O'Reilly. According to the book,
this should work:
header('Window-target: main');
header('Location: http://localhost/phase1/report.php');
But, alas, it seems to only load up the current frame (which is not main).
I also tried:
header('Window-target: _top');
header('Location: http://localhost/phase1/report.php');
to see if I could get it to wipe out the frameset and get back to the full
window, but it still loaded up in the current frame.
Any help would be appreciated!
Thanks,
Geoff
--- End Message ---