php-general Digest 30 Dec 2001 17:22:27 -0000 Issue 1082
Topics (messages 79043 through 79065):
Re: could not create new mailbox: Permission denied
79043 by: Brian Clark
Quiz script
79044 by: Indera
79046 by: Bogdan Stancescu
Re: Which is which??
79045 by: Brian Clark
Re: Control Panel , Webmin or similar Written in PHP
79047 by: Brian Clark
Re: WYSIWYG editors for HTML
79048 by: Brian Clark
Handling checkboxs (MySQL+PHP)
79049 by: David Jackson
79051 by: Brian Clark
79054 by: David Jackson
79056 by: Brian Clark
79059 by: George Nicolae
Re: Real Simple, but i'm new!!
79050 by: Brian Clark
79055 by: scott
Re: Session troubles
79052 by: Sean LeBlanc
79053 by: David Jackson
array in email
79057 by: Jordan
79058 by: George Nicolae
79065 by: Jordan
Parsing out numbers from a string
79060 by: John Weez
index.php
79061 by: Caleb Carvalho
79062 by: scott
79063 by: Rambo Amadeus
79064 by: Daniel Urstöger
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 ---
* gaukia 345 ([EMAIL PROTECTED]) [Dec 28. 2001 23:04]:
> The error message was
> Newname will be 'phpnewbox'
> could not create new mailbox: Permission denied
Looks like the user doesn't have write permission to the mailbox directory.
> I logged in as cyrus on the server I'm working on. I typed "cyradm" but this
> error message came out
> Can't locate Cyrus/IMAP/Shell.pm in @INC (@INC contains:
> /usr/lib/perl5/5.6.0/i5
> 86-linux /usr/lib/perl5/5.6.0 /usr/lib/perl5/site_perl/5.6.0/i586-linux
> /usr/lib
> /perl5/site_perl/5.6.0 /usr/lib/perl5/site_perl .).
> BEGIN failed--compilation aborted.
That tool is written in Perl. If you need that tool, you need to get
the IMAP::Shell module from somewhere and install it. You might
already have it, but it's not in your perl include path.
> Could the problem be the misconfig of IMAP server. Pls advise. Thanx.
It's likely it's just a permissions problem..
--
Brian Clark | Avoiding the general public since 1805!
Fingerprint: 07CE FA37 8DF6 A109 8119 076B B5A2 E5FB E4D0 C7C8
10 out of 5 doctors feel it's OK to be skitzo!
--- End Message ---
--- Begin Message ---
Hello,
I have been looking for a script that I can use to create online quizzes. I also need
to be able to
score them online, save the results to a database, as well as, email the results to
the student and
teacher. The ideal option would use php and a mysql database.
Any suggestions would be greatly appreciated.
Thanks
Indera
--- End Message ---
--- Begin Message ---
Hello!
Check these out -- they're not filtered as to only search PHP projects:
http://freshmeat.net/search/?site=Freshmeat&q=quiz§ion=projects
The only PHP project in there is Duck.
HTH
Bogdan
Indera wrote:
> I have been looking for a script that I can use to create online quizzes. I also
>need to be able to
> score them online, save the results to a database, as well as, email the results to
>the student and
> teacher. The ideal option would use php and a mysql database.
>
> Any suggestions would be greatly appreciated.
--- End Message ---
--- Begin Message ---
* Gerard Samuel ([EMAIL PROTECTED]) [Dec 29. 2001 00:35]:
> I got a fairly big script with a lot of functions.
> Which is more effiecient to pass global information to functions
> ie
> 50 variables
> 50 constants
> or 1 array with 50 values
I'm not sure I'm the right person to answer this, but if I had to
give answer, I'd say they're all equal. You're going to have to
define them _somewhere_. I mean, if they're global, right? So how
much difference could one or the other make?
If there is any huge difference, I'd love to know as well.
--
Brian Clark | Avoiding the general public since 1805!
Fingerprint: 07CE FA37 8DF6 A109 8119 076B B5A2 E5FB E4D0 C7C8
Job Placement: Telling your boss what he can do with your job.
--- End Message ---
--- Begin Message ---
* rick ([EMAIL PROTECTED]) [Dec 29. 2001 03:18]:
> I was Wondering if it would be possible to write a proyect like Control
> Panel , WebMin (both are in Perl ) using PHP instead of PERL ?
> Would it be possible ?
Sure, why not?
> PHP has the power and flexibility like Perl to write TRUE Systems programs that
> could be able to manage all the aspects related to System Administration ??
> If there any proyect I would like to hear about it and join it .
Don't know of any, but check here
<http://www.hotscripts.com/PHP/Scripts_and_Programs/>
or maybe here
<http://www.hotscripts.com/PHP/Scripts_and_Programs/Server_Management/>
--
Brian Clark | Avoiding the general public since 1805!
Fingerprint: 07CE FA37 8DF6 A109 8119 076B B5A2 E5FB E4D0 C7C8
Where are we going and why am I in this handbasket?
--- End Message ---
--- Begin Message ---
* Dennis Gearon ([EMAIL PROTECTED]) [Dec 29. 2001 00:56]:
> What WYSIWYG editors are you guys using with PHP templates? I'd like to
> layout pages, frames, multiple levels of graphics with a WYSIWYG editor.
> I looked at an online template from the macromedia site, and it is
> completely unformatted and has some unprintable character in it at every
> <b>. It is completely useless for putting PHP template information in. I
> don't know if their program 'dreamweaver' actually MAKES the templates
[...]
I would imagine you haven't gotten many answers because Dreamweaver is
the most popular WYSIWYG editor for that kind of stuff. I've never used
Dreamweaver (or UltraDev?) but I hear they have "PHP Extensions" which
may explain the popularity.
--
Brian Clark | Avoiding the general public since 1805!
Fingerprint: 07CE FA37 8DF6 A109 8119 076B B5A2 E5FB E4D0 C7C8
Hardware: The parts of a computer system that can be kicked.
--- End Message ---
--- Begin Message ---
ALL --
The snipet below is used to generate the table containing
product info (product_id(pid), title, amount) and checkboxs.
When submit is clicked the data is passed to "instert into"
sql statement.
My question is how do I process checkbox when multi boxes have
been check. I keep thinking a array is created by check boxes?
-- David
-------- order_form.php --------
// Define table
echo "<br><table bgcolor=\"gray\" border=\"1\" >";
// Generate book listing
$result = mysql_query("SELECT pid,date,title,subtitle,author,amount FROM
catalog ") or die("Dis ain't right !!");
while (
list($pid,$date,$title,$subtitle,$author,$amount)=mysql_fetch_row($result)){
echo "<tr>\n";
echo "<td><input type=\"checkbox\" name=\"frm_pid\" value = \"$pid\"
></td>";
echo "<td>$title</td>";
echo "<td>Price: $amount</td>";
echo "</tr>\n";
}
echo "</table>";
--- End Message ---
--- Begin Message ---
* David Jackson ([EMAIL PROTECTED]) [Dec 29. 2001 21:41]:
[...]
> My question is how do I process checkbox when multi boxes have
> been check. I keep thinking a array is created by check boxes?
Use string[] as the name(s) -- where "string" is the label for the array
you want.
--
Brian Clark | Avoiding the general public since 1805!
Fingerprint: 07CE FA37 8DF6 A109 8119 076B B5A2 E5FB E4D0 C7C8
Caution: Cape does not enable user to fly.
--- End Message ---
--- Begin Message ---
Brian --
So I should change the line:
echo "<td><input type=\"checkbox\" name=\"frm_pid\" value = \"$pid\"
></td>";
To:
echo "<td><input type=\"checkbox\" name=\"frm_pid[]\" value = \"$pid\"
></td>";
Or do I change the value=
Thanks -- David
> * David Jackson ([EMAIL PROTECTED]) [Dec 29. 2001
> 21:41]:
>
> [...]
>
>> My question is how do I process checkbox when multi boxes have
>> been check. I keep thinking a array is created by check boxes?
>
> Use string[] as the name(s) -- where "string" is the label for the
> array you want.
>
> --
> Brian Clark | Avoiding the general public since 1805!
> Fingerprint: 07CE FA37 8DF6 A109 8119 076B B5A2 E5FB E4D0 C7C8
> Caution: Cape does not enable user to fly.
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail:
> [EMAIL PROTECTED]
--
--- End Message ---
--- Begin Message ---
* David Jackson ([EMAIL PROTECTED]) [Dec 29. 2001 22:40]:
> Brian --
> So I should change the line:
> echo "<td><input type=\"checkbox\" name=\"frm_pid\" value = \"$pid\"
> ></td>";
> To:
> echo "<td><input type=\"checkbox\" name=\"frm_pid[]\" value = \"$pid\"
> ></td>";
That should do it.
--
Brian Clark | Avoiding the general public since 1805!
Fingerprint: 07CE FA37 8DF6 A109 8119 076B B5A2 E5FB E4D0 C7C8
Women are probably the main cause of free software starvation.
--- End Message ---
--- Begin Message ---
//you must make some change :
echo "<td><input type=\"checkbox\" name=\"frm_".$pid."\" value =
\"$pid\"></td>";
^^^^^^^^^^
//you must find the max pid from database with query
//"select pid from catalog order by pid desc limit 1"
for ($i=0;$i<max_pid;$i++)
{
$v="pid_".$i;
if(isset($$v)) ... make what you want to do .....;
}
--
Best regards,
George Nicolae
IT Manager
___________________
X-Playin - Professional Web Design
www.x-playin.f2s.com
"David Jackson" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> ALL --
> The snipet below is used to generate the table containing
> product info (product_id(pid), title, amount) and checkboxs.
> When submit is clicked the data is passed to "instert into"
> sql statement.
>
> My question is how do I process checkbox when multi boxes have
> been check. I keep thinking a array is created by check boxes?
> -- David
>
> -------- order_form.php --------
> // Define table
> echo "<br><table bgcolor=\"gray\" border=\"1\" >";
> // Generate book listing
> $result = mysql_query("SELECT pid,date,title,subtitle,author,amount FROM
> catalog ") or die("Dis ain't right !!");
> while (
>
list($pid,$date,$title,$subtitle,$author,$amount)=mysql_fetch_row($result)){
> echo "<tr>\n";
> echo "<td><input type=\"checkbox\" name=\"frm_pid\" value = \"$pid\"
> ></td>";
> echo "<td>$title</td>";
> echo "<td>Price: $amount</td>";
> echo "</tr>\n";
> }
> echo "</table>";
>
>
--- End Message ---
--- Begin Message ---
* FiShcAkE ([EMAIL PROTECTED]) [Dec 29. 2001 13:07]:
> Hey,
Howdydo
> I've just started learning php and I need to know this... What are the
> commands I use to get i.e. index.php?links and index.php?news to
> work?
You can use QUERY_STRING, but you could also use action=news,
action=links, action=asdfg and use a switch($action)
I guess you're trying to make the URL as pretty as possible, right?
--
Brian Clark | Avoiding the general public since 1805!
Fingerprint: 07CE FA37 8DF6 A109 8119 076B B5A2 E5FB E4D0 C7C8
A library is an arsenal of liberty.
--- End Message ---
--- Begin Message ---
well, if your URL is index.php?links
if (!empty($links))
is similar to what you'd want to use.
> -----Original Message-----
> From: Brian Clark [mailto:[EMAIL PROTECTED]]
> Sent: Saturday, December 29, 2001 9:44 PM
> To: PHP is not a drug.
> Subject: Re: [PHP] Real Simple, but i'm new!!
>
>
> * FiShcAkE ([EMAIL PROTECTED]) [Dec 29. 2001 13:07]:
>
> > Hey,
>
> Howdydo
>
> > I've just started learning php and I need to know this... What are the
> > commands I use to get i.e. index.php?links and index.php?news to
> > work?
>
> You can use QUERY_STRING, but you could also use action=news,
> action=links, action=asdfg and use a switch($action)
>
> I guess you're trying to make the URL as pretty as possible, right?
>
> --
> Brian Clark | Avoiding the general public since 1805!
> Fingerprint: 07CE FA37 8DF6 A109 8119 076B B5A2 E5FB E4D0 C7C8
> A library is an arsenal of liberty.
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>
--- End Message ---
--- Begin Message ---
On 12-29 16:46, David Jackson wrote:
> Sean --
>
> Give the attached scripts a shot, a post the results.
>
> Note: Xitami(server+WinMe) + IE5.5 or Mozilla 9.7 works
> fine but with Netscape-4.9 it returns var names? But
> when served from Unix/Linux and Apache all 3 work as expected !!
>
> Anywhy give them shot. -- David
I created and ran these. After hitting submit on form.html, I get this:
Fatal error: Failed to initialize session module in
/usr/local/apache/htdocs/form.php on line 3
>
> --- form.html ---
> <?xml version="1.0" encoding="iso-8859-1"?>
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
> <html xmlns="http://www.w3.org/1999/xhtml">
> <head>
> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
> <title>No title</title>
> <meta name="GENERATOR" content="amaya 5.2" />
> </head>
> <body>
>
> <form method="post" action="form.php">
> <p><input type="text" size="20" name="stuff" /></p>
> <p><input type="text" size="20" name="more_stuff" /></p>
> <p><input type="text" size="20" name="still_more_stuff" /></p>
>
> <p><input type="submit" value="Submit" /></p>
> <p><input type="reset" value="Reset" /></p>
> </form>
> </body>
> </html>
>
> --- form.php ----
>
> <?php
> // sessions on 48 N. Random Rd.
> session_start();
> session_register('Green');
> session_register('Yellow');
> session_register('Red');
> $Green = $stuff;
> $Yellow = $more_stuff;
> $Red = $still_more_stuff;
>
> // basic echo of var from form
> echo "We've just echoed var from form\n";
> echo "<p>$Green</p>";
> echo "<h2>$Yellow</h2>";
> echo "<h3>$Red</h3>";
> echo "<p><a href=\"form02.php\">Verify that session_vars were
> passwd</a></p>";
> // Get out of here
>
> ?>
>
> --- form02.php -------------
> <?php
> session_start();
> // sessions on 48 N. Random Rd.
> // basic echo of var from form
> echo "<html><head><title></title></head>";
> echo "<body>";
> echo "<h2>session_registers:";
> echo "<p>Green:$Green</p>";
> echo "<p>Yellow:$Yellow</p>";
> echo "<p>Red:$Red</p>";
> echo "</body></html>";
> ?>
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
--
Sean LeBlanc:[EMAIL PROTECTED] Yahoo:seanleblancathome
ICQ:138565743 MSN:seanleblancathome AIM:sleblancathome
One lives in the hope of becoming a memory.
-Antonio Porchia
Management QOTD:I am very concerned that we may not give a dog and pony show
and examine where the rubber meets the road on the deliverables,
etc.
--- End Message ---
--- Begin Message ---
Sean --
Does you standard (non session) seem to work ok? Such as:
<?php
// basic echo of var from form
echo "We've just echoed var from form\n";
echo "<p>$stuff</p>";
echo "<h2>$more_stuff</h2>";
echo "<h3>$still_more_stuff</h3>";
?>
Did you compile Apache and PHP from source? If so
could you provide me with the ./configure --options you used?
This is sound like a config/compile problem to me.
You might also want to cross-post to linux-admin mail list?
-- David
--- End Message ---
--- Begin Message ---
I've searched the archive but can't seem to find anything on the mail()
function of PHP. I've got the whole function working in a simplistic manner
but I can't do one thing. How is it possible to print arrays inside the
body of the message. I can't seem to run a loop or anything and all I have
are session variables to use. Thanks in advance for the help.
-Jordan
--- End Message ---
--- Begin Message ---
the mail function looks like : mail($to,$subject,$body) ("in a simplistic
manner")
you can use
$to="[EMAIL PROTECTED]";
$subject="test";
for ($i=0;i<count(a)/*your array*/;$i++)
$body.=a[i];
//and then, of course
mail($to,$subject,$body);
--
Best regards,
George Nicolae
IT Manager
___________________
X-Playin - Professional Web Design
www.x-playin.f2s.com
"Jordan" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I've searched the archive but can't seem to find anything on the mail()
> function of PHP. I've got the whole function working in a simplistic
manner
> but I can't do one thing. How is it possible to print arrays inside the
> body of the message. I can't seem to run a loop or anything and all I
have
> are session variables to use. Thanks in advance for the help.
>
> -Jordan
>
>
--- End Message ---
--- Begin Message ---
Thanks George...that did the trick...sometimes I want to smack myself for
not seeing the obvious. Thanks for the help.
-Jordan
George Nicolae <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> the mail function looks like : mail($to,$subject,$body) ("in a simplistic
> manner")
> you can use
>
> $to="[EMAIL PROTECTED]";
> $subject="test";
> for ($i=0;i<count(a)/*your array*/;$i++)
> $body.=a[i];
>
> file://and then, of course
> mail($to,$subject,$body);
> --
>
>
> Best regards,
> George Nicolae
> IT Manager
> ___________________
> X-Playin - Professional Web Design
> www.x-playin.f2s.com
>
>
>
> "Jordan" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > I've searched the archive but can't seem to find anything on the mail()
> > function of PHP. I've got the whole function working in a simplistic
> manner
> > but I can't do one thing. How is it possible to print arrays inside the
> > body of the message. I can't seem to run a loop or anything and all I
> have
> > are session variables to use. Thanks in advance for the help.
> >
> > -Jordan
> >
> >
>
>
--- End Message ---
--- Begin Message ---
Hi all
I have a small program which captures the output of a webpage and puts the
data in to a string variable.
I then use teh strip tags function of php to clean it up a bit.
then i want to use regular expressions to extract all the numbers from the
page ..they are like this usually numbers.numbers (IE: 40.40 ).
For some reason my expressions are not matching anything in the string
unless i type exactly what i am looking for... could the fact that there
are line reurns in the string be causing a problem? or do i need to
somehow tell php to goto the next line?
I had an older version of the program which saved teh data to a file and
then PhP scanned the file line by line..this worked...but i'm trying to
make a more elegant solution that won;t kill my hard drive faster ;)
Any tips appreciated...
John
[EMAIL PROTECTED]
--- End Message ---
--- Begin Message ---
Hi all,
all the sudden my apache 1.3.22 is not showing my index.php page
php-4.0.6, i have added the addtype .php inside httpd.conf
not only that, i have also noticed that the <?php phpinfo(); ?> is not
working also, this is not displaying the test page,
I am using netscape as a browser, do you guys know about any issue related
to this?
many thanks and happy x-mas/happy new year
_________________________________________________________________
Join the world’s largest e-mail service with MSN Hotmail.
http://www.hotmail.com
--- End Message ---
--- Begin Message ---
well... a good first step is to think about what has
changed with your configuration. did you turn on
any output handlers/buffering? Compile a new
version? Modify apache in any way?
> -----Original Message-----
> From: Caleb Carvalho [mailto:[EMAIL PROTECTED]]
> Sent: Sunday, December 30, 2001 4:40 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] index.php
>
>
> Hi all,
>
> all the sudden my apache 1.3.22 is not showing my index.php page
> php-4.0.6, i have added the addtype .php inside httpd.conf
>
> not only that, i have also noticed that the <?php phpinfo(); ?> is not
> working also, this is not displaying the test page,
>
> I am using netscape as a browser, do you guys know about any issue related
> to this?
>
> many thanks and happy x-mas/happy new year
>
>
>
> _________________________________________________________________
> Join the world’s largest e-mail service with MSN Hotmail.
> http://www.hotmail.com
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>
--- End Message ---
--- Begin Message ---
you can make .htacces file and put
DirectoryIndex /index.php
That will work
----- Original Message -----
From: Caleb Carvalho <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: 30. prosinac 2001 10:40
Subject: [PHP] index.php
> Hi all,
>
> all the sudden my apache 1.3.22 is not showing my index.php page
> php-4.0.6, i have added the addtype .php inside httpd.conf
>
> not only that, i have also noticed that the <?php phpinfo(); ?> is not
> working also, this is not displaying the test page,
>
> I am using netscape as a browser, do you guys know about any issue related
> to this?
>
> many thanks and happy x-mas/happy new year
>
>
>
> _________________________________________________________________
> Join the world’s largest e-mail service with MSN Hotmail.
> http://www.hotmail.com
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
--- End Message ---
--- Begin Message ---
I am not sure if this is the problem. but why don´t just do something like
this:
DirectoryIndex index.html index.php index.cgi
Search the httpd.conf, there is surely already for the index.html ! ;)
Ehm, yeah, and this is one is ordered in priority from the left to right ..
Hope it helps !
Cya !
"Caleb Carvalho" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi all,
>
> all the sudden my apache 1.3.22 is not showing my index.php page
> php-4.0.6, i have added the addtype .php inside httpd.conf
>
> not only that, i have also noticed that the <?php phpinfo(); ?> is not
> working also, this is not displaying the test page,
>
> I am using netscape as a browser, do you guys know about any issue related
> to this?
>
> many thanks and happy x-mas/happy new year
>
>
>
> _________________________________________________________________
> Join the world's largest e-mail service with MSN Hotmail.
> http://www.hotmail.com
>
--- End Message ---