Re: [PHP] If you ever had a Vic20

2003-08-14 Thread John Taylor-Johnston
Ok ... so I can do it this way (below), but there must be a more intelligent way? This 
is like something I did with my Vic20, 19 years ago. (If you ever had a Vic20 ... :) 
you might sympathise)

while ($mydata = mysql_fetch_object($news))
{
if ($mydata->StudentId = $StudentId)
{$found =1}else{$found=0}
}

if ($found==1){do this}else{do that}



> $myconnection = mysql_connect($server,$user,$pass);
> mysql_select_db($db,$myconnection);
>
> $news = mysql_query("select StudentId FROM $table");
>
> while ($mydata = mysql_fetch_object($news))
> {
> }
>
> if exists
> {do this}else{do that}


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



[PHP] Re: LAMP > I need a good tutorial on how to install and configureGD2

2003-08-14 Thread Kae Verens
Matt Babineau wrote:
Anyone have a good place to help with this... Google was seeming a bit
light on good help. I tried to get it going but there seemed to be some
dependant libraries tha tI could not build myself, they were erroring
out..blah blah. Is there any easier way to do this?
Thanks,
Matt
try rpm, or even better, apt-get (http://apt-rpm.tuxfamily.org, I think) 
- simply install, and type "apt-get update && apt-get install gd2"

Kae

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


Re: [PHP] Re: How can I load load Additional extensions ?

2003-08-14 Thread Leif K-Brooks
Dennis Lee wrote:

Why it is wrong when I run php as module under apache 2.0.46 ?

PHP and Apache 2 are currently unstable together.

--
The above message is encrypted with double rot13 encoding.  Any unauthorized attempt 
to decrypt it will be prosecuted to the full extent of the law.


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


php-general Digest 15 Aug 2003 06:16:45 -0000 Issue 2237

2003-08-14 Thread php-general-digest-help

php-general Digest 15 Aug 2003 06:16:45 - Issue 2237

Topics (messages 159608 through 159642):

Re: project management php system
159608 by: Michael A Smith

Re: email confirmation script
159609 by: Anthony Ritter
159626 by: Anthony Ritter
159638 by: olinux

Newbie Session Question
159610 by: Tim Winters
159611 by: CPT John W. Holmes
159614 by: Analysis & Solutions
159615 by: Tim Winters

LAMP > I need a good tutorial on how to install and configure GD2
159612 by: Matt Babineau

Templates, custom functions, mysql
159613 by: Tyler Longren

searching date
159616 by: bl1412.hotpop
159617 by: Jay Blanchard
159642 by: Kae Verens

Category and sub-category logic
159618 by: Ryan A
159619 by: Chris W. Parker
159620 by: David Otton
159621 by: Chris W. Parker

Generate Dates
159622 by: Ralph Guzman
159624 by: CPT John W. Holmes

ldap_list + Novell eDirectory
159623 by: Daniel Bray

Image with graduated fill using PHP
159625 by: Adrian

Re: php.ini configuration can we have two include_path in php.in file
159627 by: Justin French

host name
159628 by: viraj.ceynet.net
159631 by: Mike Migurski
159632 by: Justin French

mail error
159629 by: merryE
159635 by: Jackson Miller

configure smtp in php.ini
159630 by: merryE

configure smtp error
159633 by: merryE
159636 by: Jackson Miller

How can I load load Additional extensions ?
159634 by: Dennis Lee
159637 by: Leif K-Brooks
159639 by: Dennis Lee
159641 by: Dennis Lee

How to Select
159640 by: John Taylor-Johnston

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 ---
I've developed PrattCMS... (Try out the latest RC, it's quite stable and 
note that 2.0 will be out later today or tomorrow depending...).

It's:
-GPL'ed
-PHP/MySQL (Could support other databases, with small amount of work.)
-Has an error reporting class to send notes when a db query fails (by 
e-mail).
-Has an in-line WYSIWYG editor that runs in IE 5.5+ and Mozilla 1.3+.
-Has a _really_ easy way to install/switch templates.
-Uses .xml files that exist inside the right directory to get 
information about each template.
-Creating a new template is easy... just look at the four provided, 
use smarty templates, and look at and *.xml file in the templates/ 
directory.
-Switching templates is as easy as clicking 1 button.
-Has customizable style-sheet values.
-Works fine with web spiders (uses ?id= to get different files).
-Doesn't require register_globals (never tested with register_globals 
on... ought to work though).
-Has user groups so that only certain users are allowed to create new 
users/edit site-wide configuration/change templates and you can even 
restrict which pages they are allowed to modify as well as whether they 
are allowed to create new pages or not.
-Has a front-page module so you can have an entry page (you can disable 
by emptying the "modules" table, but then you'll have to make a simple 
modification so that your home page will exist... you can ask me later 
if you want)
-You can backup all your information (pages, database configuration, 
downloads you've uploaded, images you've uploaded... requires --with-zlib)
-Has stats: Number of visitors, Country graph of where you're users come 
from, Browser detection, Most visited pages, Where the users came from, 
Graph of Hourly visits (does _not_ require GD).
-Has a SELECT only Database viewer that runs in PEAR::DB (just like the 
rest of the CMS).

It shouldn't be too hard to customize if you need to. You can create new 
templates/etc., obviously for yourself.

Webpage:
http://prattcms.sourceforge.net/
(You can try it out by visiting: http://opensourcecms.com/ and clicking 
the "PrattCMS" link on the left hand side.)

HTH!
-Michael
[EMAIL PROTECTED] wrote:
Hi guys ok i am doing it now, but i'm not asking for you to code something
for me, i'm looking for a classy project management system possibly in an
open source format in PHP and Mysql.
I was wondering who has implemented such a system they could recommend, i
am investigation to look into customising an already developed system or we
have to develop one from scratch to suit our needs.
Let me know.

Thanks

Dan



 



--- End Message ---
--- Begin Message ---
Thanks Jackson.

I appreciate the assistance.

Am I on the right track?

Best...
TR
..

// this is the form





Your e-mail address:






...
//process.php
mailto:[EMAIL PROTECTED]/email_verify.php?email=$email&c
onfirmation_ID=$confirmation_ID>link"
 mail($_POST['email'],

[PHP] Re: searching date

2003-08-14 Thread Kae Verens
[EMAIL PROTECTED] wrote:
Hi ,

The  user  have to choose 2 date ($date_begin & $date_last) and i want
to  know  howcan  i  make  to find field in mysql where field included
between ($date_begin & $date_last)
"SELECT  *  FROM  `news`  WHERE  `date`  included  in  ($date_begin  &
$date_last)"
$q=mysql_query('select * from news where `date` >= "'.$date_begin.'" and 
`date` < "'.$date_last.'" + interval 1 day');

you should rename the field you have called `date` - it's ambiguous.

Kae

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


[PHP] Re: How can I load load Additional extensions ?

2003-08-14 Thread Dennis Lee
I am really confused .

When I just run php as CGI without changing anything else, It works quite
well .

Why it is wrong when I run php as module under apache 2.0.46 ?

Is it a bug  or anything else ?

Any help will be appreciated .


"Dennis Lee" <[EMAIL PROTECTED]> дÈëÓʼþ
news:[EMAIL PROTECTED]
> My OS is Winxp . My web server is apache 2 which is installed as a NT
> service .
>
> My php version is 4.32 , and I extracted it into  "c:\php" .
>
> I run php as a apache module .
>
> I want to load Additional extensions .They are php_mbstring.dll,
> php_xslt.dll and php_domxml.dll .
>
> I have made changes to php.ini as follow.
> extension_dir = "c:\php\extensions"
> extension=php_mbstring.dll
> extension=php_xslt.dll
> extension=php_domxml.dll
>
> then I restarted apache2 .
>
> but it told me that the modules could not be located .
>
> what was wrong ? thanks for any useful words .
>
>



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



Re: [PHP] Allowed mem size exhausted

2003-08-14 Thread Shawn McKenzie
Thanks!

Would anyone care to expand on the "tools" or the methods for preparing on
disk???

Thanks again!
-Shawn

"Curt Zirzow" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> * Thus wrote David Nicholson ([EMAIL PROTECTED]):
> > Hello,
> >
> > This is a reply to an e-mail that you wrote on Tue, 5 Aug 2003 at
> > 17:57, lines prefixed by '>' were originally written by you.
> > > I would prepare the file on disk instead of memory. If you do
> > > increase the memory to handle bigger files, what happens when you
> > > get 10 requests at the same time?  about 80MB of memory used.
> >
> > Correct me if I am wrong but would it not be better to use the
> > functions he is currently using (which prepare the data in volitile
> > memory) for as long as they allow for this.  The OS should then
> > realise when it does not have enough physical RAM for each of the
> > requests and handle swapping onto disk itself as and when it is
> > needed.  This would mean you haven't got the overheads of writing
> > lots of data to disk, just to delete it again when you do only have
> > one request at a time and have plenty of RAM spare to take care of
> > the operation.
>
> Better all depends on the situation.
>
> Now if one script forces your whole system to start using swap, I
> think there is something wrong. The system should never swap unless
> under heavy load.  And even then, things should be changed so that
> the system does not swap EVER.
>
> Having one script be inefficient is better than having the whole
> system brought down to its knees (and perhaps die due to lack of
> swap.)
>
> if only one person will be accessing the script at one time there
> isn't any issues, but I would always be weary of loading 8MB of
> data into one script, excpecially when there are tools readily
> available.
>
> Curt
> -- 
> "I used to think I was indecisive, but now I'm not so sure."



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



[PHP] How to Select

2003-08-14 Thread John Taylor-Johnston
Ok, this is a basic MySQL question, but I don't know how to code it in PHP. I want to 
check in StudentId. If it exists, ...
Anyone good humoured who would help me fill in the blank. Like I should know this, but 
haven't even thought of coding SQL in a while :)

$myconnection = mysql_connect($server,$user,$pass);
mysql_select_db($db,$myconnection);

$news = mysql_query("select StudentId $table");

while ($mydata = mysql_fetch_object($news))
{
}

if exists
{do this}else{do that}



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



Re: [PHP] How can I load load Additional extensions ?

2003-08-14 Thread Dennis Lee
I am sure they are in c:\php\extensions .

any other idea  ?

"Leif K-Brooks" <[EMAIL PROTECTED]> 
news:[EMAIL PROTECTED]
> Dennis Lee wrote:
>
> >what was wrong ? thanks for any useful words .
> >
> Are those extensions in c:\php\extensions?
>
> -- 
> The above message is encrypted with double rot13 encoding.  Any
unauthorized attempt to decrypt it will be prosecuted to the full extent of
the law.
>
>



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



Re: [PHP] Re: why doesn't default values for this function work

2003-08-14 Thread anders thoresson
function secure_string($unsafe_string, $max_length)
{
if(!is_int($max_length))
error("Variable max_length is not an integer." );
if (strlen($unsafe_string) > $max_length)
error("Too many characters.");
}
I want the $max_length to be optional. With your solution it isn't? I 
thought I could make it optional by assigning a default value of -1, which 
would tell the function not to bother with max_length and continue the 
execution.

All in all my function looks like this (crossing my fingers and hopes that 
linewrap works this time):

function secure_string($unsafe_string, $max_length = -1, $errormessage = 
"Du har skrivit för många tecken.")
{
// verify that string isn't longer then $max_length, if $max_length is set
if ($max_length > -1)
{
 if (!is_int($max_length))
 {
  error("Variabeln max_length är inte en siffra.");
 }
 if (strlen($unsafe_string) > $max_length)
 {
  error($errormessage);
 }
}
// create array containing bad words
$badwords = array(";","--","select","drop","insert","xp_","delete");
$goodwords = array(":","-","choose","leave","add"," ","remove");
// check for occurences of $badwords
for($i=0; $i<7; $i++)
{
 $unsafe_string = str_replace("$badwords[$i]", 
"$goodwords[$i]","$unsafe_string");
}
$unsafe_string = AddSlashes($unsafe_string);
$unsafe_string = htmlentities($unsafe_string);
$unsafe_string = strip_tags($unsafe_string);
$unsafe_string = trim($unsafe_string);
Return $unsafe_string;
}

Are the last steps (AddSlashes through trim) overkill? I want to make it 
safe for mysql.

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


Re: [PHP] Display Records in Multiple Pages help please !

2003-08-14 Thread Justin French
Well, you haven't told us what database you're using at all, but I'll 
assume MySQL.  In which case you should look at the LIMIT part of your 
query.

http://www.mysql.com/doc/en/SELECT.html

All you need to do is pass around a starting point variable on each 
page, so that you know where the result for the next page of results 
will start from (eg row 40 or 41 for page 3)

Justin

On Tuesday, August 5, 2003, at 02:53  AM, Coello, David wrote:

good afternoon i found a forum about displaying 25 records per page, 
im using cgi and i need also to display only 25 records per page but i 
want to be able to go to my next page and see the next 25 and so on... 
the proble that im having is that i have a about 2000 records and the 
query that i use calls all of them? how do i limit them
thank you david coello

David Coello
[EMAIL PROTECTED]
phone: 212-657-1649
Fax: 212-657-7517
---
[This E-mail scanned for viruses]



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


Re: [PHP] snippet

2003-08-14 Thread imran
hi

It is a Ternary Operator, Often you can avoid large if/else statements in
your code by using the ternary operator. For example:


echo "You have $i ". ($i==1 ? "message" : "messages"). " in your box.\n";


Note: "? : " operator has this syntax  "expr ? expr : expr;"

imran

- Original Message -
From: "Harry Wiens" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, August 05, 2003 3:26 PM
Subject: [PHP] snippet


> can someone explain this for me:
> ...
> $sFont =submit("font") ? SITE_ROOT . PROG_PATH . submit("font") : "";
> ...
>
> mfg.
> hwiens
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


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



Re: [PHP] email confirmation script

2003-08-14 Thread olinux
Read the manual notes for mail() and find out how to
send html messages.
www.php.net/mail

or better - just send a text message
make your link shorter though so the link won't break.


olinux


--- Anthony Ritter <[EMAIL PROTECTED]>
wrote:
> This is what I receive via e-mail after I click
> submit using the following
> code.  As you can see - the html attribute  shows up and the whole
> string in linked.  All I was looking for is a link
> to the URL and the word -
> Click - to be underlined showing the link.
> 
> Additionally, the value (as in key/value) part of
> confirmation_ID  is
> nowhere to be found in the query string.
> 
> Thank you for any assistance.
> Tony Ritter
> 
> .
> // This is what I get back via e-mail:
> 
> - Original Message -
> From: 
> To: <[EMAIL PROTECTED]>
> Sent: Thursday, August 14, 2003 2:04 PM
> Subject: Thank you for registering
> 
> 
> > Thank you for registering tony
> >
> > 
href="http://www.gonefishingguideservice.com/[EMAIL PROTECTED]
> efishingguideservice.com&confirmation_ID=">Click
> 
> -
> 
> 
> /*the .html form which takes a name and an e-mail
> address */
> 
> 
> 
> 
> 
> Your name:
> 
> Your e-mail address:
> 
> 
> 
> 
> 
> ...
> 
> 
> /*process_a.php: which receives the name and email
> variables.  The script
> then tries to then send the note back to the user
> with a link - called
> CLICK.  When the user hits the link to
> email_verify.php the email address is
> inserted into the database*/
> 
>   $msg = "Thank you for registering $name\n\n";
>  $msg .= "
href=\"http://www.gonefishingguideservice.com/email_verify.php?email=$email&;
> confirmation_ID=$confirmation_ID>CLICK";
>  $secret_variable = "something_only_you_know";
>  $confirmation_ID = md5($email.$secret_variable);
>  $to="[EMAIL PROTECTED]";
>  $subject="Thank you for registering";
>  $mailheaders="From: Us";
>  mail($to,$subject,$msg,$mailheaders);
> ?>
> .
> 
> // email_verify.php
> 
>  if ($_GET['confirmation_ID'] =
> md5($_GET['email'].$secret_variable)) {
> // insert the user into the database
> } else {
>   // display an error message
> }
> ?>
> 
> 
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


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

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



Re: [PHP] setting header() for csv file

2003-08-14 Thread David T-G
Hi again --

...and then David T-G said...
% 
...
% How do I construct the headers so that the browser says "Oh, this is a

It turns out that my header attempt was good and I just had to try again.
I don't *think* I had the same blank-line-of-output as mentioned in the
manual, but it's possible :-)

Now my

  header("Content-Type: application/csv") ;

works dandily.


% CSV file, and here is its name; where shall I save it?" and the user
% doesn't have to jump through any hoops?

I finally found it!  Thanks, google, and some patience :-)  What I wanted
was the disposition, so I now have

  header ("Content-disposition: attachment; filename=$name.csv") ;

and all the user has to do is pick the local directory.  Woo hoo!


% 
% 
% TIA & HAND


Thanks anyway, and here's hoping that this will pop up in the archives
for the next seeker.


HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!



pgp0.pgp
Description: PGP signature


Re: [PHP] Help with Mod mathematical function

2003-08-14 Thread Groboski, Joshua
http://us4.php.net/math

The operator you want is %

Eg: 5%3 = 2

<[EMAIL PROTECTED]> wrote in message
news:<[EMAIL PROTECTED]>...
> 
> 
> if you turn on --enable-bcmath, you can use de bcmod function 
> equivalen to Mod operator from visual basic
> 
> 
> Un saludo, Danny
> 
> 
>

>   Dean Baldwin

>   <[EMAIL PROTECTED]>  Para:
<[EMAIL PROTECTED]>

>cc:

>   06/08/2003 12:19 Asunto:   [PHP] Help
with Mod mathematical function 
>

>

> 
> 
> 
> 
> Hi,
> 
> I am porting a vb application across to php but have come up against a

> small problem. The code uses the Mod calculation however I cannot find

> any Mod in php. The line of code that uses it looks like:
> 
> Data = (index Mod 16)
> 
> Anybody have any ideas how I recreate this in php? Both data and index

> are integers.
> 
> Regards,
> Dean
> 
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
> 
> 
> 
> 
> 

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



[PHP] Unzipping Files

2003-08-14 Thread Matt Palermo
Anyone know where I can find tutorials or examples on how to use the
gunzip, gzip, and other commands using PHP to work with compressed
files?  I would really appreciate it if someone could send me some links
or examples of how to use them.  My goal would be to be able to extract
.zip, .gz, and other types of compressed files using a PHP script.  Let
me know if you can help. 
 
Thanks,
 
Matt


Re: [PHP] gettin parameters from url, architecture question

2003-08-14 Thread Merlin
>   RewriteRule  ^file_html_22.html$ dospamfile.php

this looks somehow faster than doing a errordocument redirect. Would it for
example be possible to redirect all files
starting with /travelogue_ to a specific file?

Merlin

PS: thanx for the great hint!

--