[PHP] Re: Why use XML?

2003-02-10 Thread Ilya Nemihin
> well Im out of a job so I am sitting around learning XML. It seems like a
> great tool, but I am trying to figure out why I would actually use it?

If you intersting for my experience:

I find xml+xslt useful for offline-site generation tasks,
right now I am making site, and there are folders
content\
  db\
  pages\
  xslt\

in 'db' I store 'pages.xml', 'news.xml' and 'common.xml'

f.e. 'pages.xml' - describe all pages of site:



  
about
more description
  

  
address
more descritption
  
...


where  are going to menu and to page header,  - this is 'title'
for ,

'news.xml' - news of site:



  01.01.2003
  opening site



'common.xml' - common information about company (name, year, email, phones
...)


  2003
  Name of company
  slogan
  
russia/ekaterinburg
street/building
phone
email
  
  


paragraph



then in folder 'xslt' are stored xslt files,
there is 'fp-page.xsl'
an 'site-page.xsl'

first - this is xslt-transformation for First Page (index.html)
second - this is xslt-transformation  for any page of site.

my php script make next - for each page of site
make one xml file, as aggregation of
pages.xml + common.xml + {idPage}.xml
and with this one xml file make site-page.xsl transformation and then save
this as file {idPage}.html

script have template:



#add_elements_here#


and on #add_elements_here# it are placed that xml files,
also script placed tag {idPage}
where {idPage} - are real page's id ('about', 'address' ...)
by this tag xsl can determine what page he show, and make menu bar with
selected item,
and take from "page-of-site/pages/page[@id = $idPage]/name" (this is XPath)
name of page, for placing description of page.

content may contains any tags, and in xsl there is handlers for them, f.e. I
have 'price.xml',
and I have specific tags for price-list, and price line:






  Things1
  Things1





and in site-page.xsl there is handler (tamplate in xslt term.) for this:

  
  

  
#ee
  
  
  

  
  



hope this helps :)

Ilya

ps: may be in future I make my this project open-source.





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




[PHP] Regex Help

2003-02-10 Thread Lord Loh.
I am new to regex and broke my head on it the other day...in vain...

Can any one tell me a place to get a step by step tutorial on it or help me
out on how to work it out ?

I am trying to make a link collector.

after opening the desired page, I want to get all the hyperlinks on it...

Thank You!
==
~ Lord Loh ~
==



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




Re: [PHP] php-cli

2003-02-10 Thread Jason Wong
On Tuesday 11 February 2003 14:20, Michael P. Carel wrote:
> i've tried that several times but it doesnt work here. here's my test
> script
>
>  exec("cls");
>
> echo"/
>
> **/";
>
> ?>
>
> This does'nt clear the previous lines of  MS-DOS. Any ideas why?

Try echo "\n" or echo "\r\n" enough times to scroll the stuff you don't want 
to see off the screen :-)

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
If the government doesn't trust the people, why doesn't it dissolve them
and elect a new people?
*/


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




Re: [PHP] php-cli

2003-02-10 Thread Michael P. Carel

i've tried that several times but it doesnt work here. here's my test script



This does'nt clear the previous lines of  MS-DOS. Any ideas why?


> you will want to issue a "cls" command to the shell with the exec
> command for using the back ticks...
>
> That should do it for you...
>
> example:
>
> exec( "cls" );
>
> That should do it for you...
>
> Ray
>
> On Mon, 2003-02-10 at 21:20, Michael P. Carel wrote:
> > Hi to all,
> >
> > Is there anyone who could help me regarding php-cli in windows. What
should
> > be the syntax to make the screen clear before echoing something?
> > Is there a good reference in php-cli?
> >
> > Thanks in advance for the replies.
> >
> >
> >
> > mike
> >
> >
> >
> >
> > --
> > 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 General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] mac os 9 - file upload problems

2003-02-10 Thread Jimmy Brake
Hi,

I have a file upload page that accepts file uploads from pretty much
every browser and os EXCEPT any browser on mac os 9.  I have no idea
why, any of you ever have problems with file uploads on mac os 9? How
did you solve the issue.

  
-- 
Jimmy Brake <[EMAIL PROTECTED]>


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




Re: [PHP] php-cli

2003-02-10 Thread Ray Hunter
you will want to issue a "cls" command to the shell with the exec
command for using the back ticks...

That should do it for you...

example:

exec( "cls" );

That should do it for you...

Ray

On Mon, 2003-02-10 at 21:20, Michael P. Carel wrote:
> Hi to all,
> 
> Is there anyone who could help me regarding php-cli in windows. What should
> be the syntax to make the screen clear before echoing something?
> Is there a good reference in php-cli?
> 
> Thanks in advance for the replies.
> 
> 
> 
> mike
> 
> 
> 
> 
> -- 
> 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] Re: Need help storing and displaying html/text!

2003-02-10 Thread Jason Wong
On Tuesday 11 February 2003 07:03, Shawn McKenzie wrote:
> Hmmm...  I guess no one is doing this???  Seems fairly common.

Patience. You should allow 1 day to give every list subscriber a chance to 
read your post.

> "Shawn McKenzie" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>
> > I have a form and I want the user to be able to enter html in a text
> > area. This will then be stored in an array in a config file.  Example
> > $htmlstuff[1] = '

Re: [PHP] automatically delete records from a table

2003-02-10 Thread Jason Wong
On Tuesday 11 February 2003 06:34, Sunfire wrote:

> i have never used cron/crontab before ..
>
> and just so i know what should i search for on google...since none of my
> searches for anything about cron/crontab come back with anything on the
> list archive..

Which list archive did you search? If it's the one in my signature, did you 
select to search on "Bodies"?

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
Excess on occasion is exhilarating.  It prevents moderation from
acquiring the deadening effect of a habit.
-- W. Somerset Maugham
*/


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




[PHP] " and ' giving problems

2003-02-10 Thread Pag

	Hi,

	When a user wants to add a comment on my site and uses either " or  ', and 
when it gets printed out,  comes out as /" or /', either to the web page or 
on a form to alter.

	The only "treatment" i give it after its submitted on the form is:

	$comentarioc = str_replace("\r\n", "\n", $comentarioc);
	$comentarioc = str_replace("\r", "\n", $comentarioc);

	Is there a way to solve this? So it can accept both " and ', and be able 
to alter/print it with no problem?
	Thanks.

	Pag



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



Re: [PHP] problem with " and '

2003-02-10 Thread Jason Wong
On Tuesday 11 February 2003 10:47, Pag wrote:

You have started a new thread by taking an existing posting and replying to
it while you changed the subject.

That is bad, because it breaks threading. Whenever you reply to a message,
your mail client generates a "References:" header that tells all recipients
which posting(s) your posting refers to. A mail client uses this information
to build a threaded view ("tree view") of the postings.

With your posting style you successfully torpedoed this useful feature; your
posting shows up within an existing thread it has nothing to do with.

Always do a fresh post when you want to start a new thread. To achieve this,
click on "New message" instead of "Reply" within your mail client, and enter
the list address as the recipient. You can save the list address in your
address book for convenience.


>   When a user wants to add a comment on my site and uses either " or  ', and
> when it gets printed out,  comes out as /" or /', either to the web page or
> on a form to alter.

I'm sure you mean "  ... comes out as \" or \' ...  ". If so, either 
stripslash() or disable magic_quotes_gpc in php.ini.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
Statistics means never having to say you're certain.
*/


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




[PHP] How to use fopen() with protected directory (i.e .htaccess)

2003-02-10 Thread Daevid Vincent
How can I pass in a user/pw to an fopen() (or something similar)?

I am trying to render a dynamic db/php page into a static .html page --
or more specifically, I'm trying to email me back an html version of a
report page on remote servers. The reports are located behind an
https:// Apache user/pass authenticated directory.

I tried:
$file =
fopen("https://username:[EMAIL PROTECTED]/admin/report.php","r";)
; 

If I try to do something like:
$file = fopen("/www/htdocs/admin/report.php","r"); 

But then the PHP isn't executed, it just dumps me the straight source
code.


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




RE: [PHP] Re: How do I force a 'timeout' in a loop for that itteration, or conversley how to timeout a 'ping" request?

2003-02-10 Thread Daevid Vincent
On linux it says:

-t ttl  Set the IP Time to Live for multicasted packets.  This flag
only
 applies if the ping destination is a multicast address.

> -Original Message-
> From: Philip Hallstrom [mailto:[EMAIL PROTECTED]] 
> Sent: Friday, February 07, 2003 4:31 PM
> To: Daevid Vincent
> Cc: [EMAIL PROTECTED]
> Subject: [PHP] Re: How do I force a 'timeout' in a loop for 
> that itteration, or conversley how to timeout a 'ping" request?
> 
> 
> Not sure on linux, but on freebsd ping's man page says:
> 
> -t timeout Specify a timeout, in seconds, before ping exits regardless
> of how many packets have been recieved.
> 
> On Fri, 7 Feb 2003, Daevid Vincent wrote:
> 
> > I'm trying to automate finding pingable domains given an IP 
> or a domain.
> > The problem is that some domains don't actually return 
> "pings", and on
> > Linux, it just sits there forever (ugh!). So... Can someone 
> tell me how
> > to 'abort' or 'timeout' an itteration of a loop. Maybe 
> start a timer and
> > then check if a number of millis has gone by? But it seems 
> that won't
> > work b/c PHP isn't threaded, it will just hang at the exec() command
> > right? Converseley, anyone know how to force a /bin/ping to
> > automatically timeout (sans hitting CTRL+C)? I 'man ping' 
> but it didn't
> > seem to have that option.
> > Here is the code I'm using...
> >
> > $typeArray = array ('www' => false,
> > 'ftp' => false,
> > 'mail' => false,
> > 'exchange' => false,
> > 'owa' => false,
> > 'dns' => false,
> > 'dns1' => false,
> > 'dns2' => false,
> > 'dns3' => false,
> > 'router' => false,
> > 'firewall' => false,
> > 'fw' => false,
> > 'fw1' => false,
> > 'sql' => false,
> > 'db' => false,
> > 'database' => false,
> > 'crm' => false
> > );
> >
> > reset($typeArray);
> > while ( list($key, $val) = each($typeArray) )
> > {
> > $testDomain = $key.".".$domain;
> > $pingtest = exec("/bin/ping -c 1 -q ".$testDomain);
> > //echo "pingtest of ".$testDomain." =
> > ".$pingtest."\n";
> > if ( strstr($pingtest,"rtt min") )
> > {
> > $typeArray[$key] = gethostbyname($testDomain);
> > echo " > VALUE='".$typeArray[$key]."' CHECKED>".$testDomain."
> > (".$typeArray[$key].")\n";
> > $ipCounter++;
> > }
> > //sleep(3);
> > }
> > if ($ipCounter == 0)
> > echo "No pingable domains found in our test
> > list";
> >
> >
> > --
> > 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 General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] WYSIWIG CMS Part1

2003-02-10 Thread @ Nilaab
I really really like the idea of using XML/XSLT for creating future CMS
Apps. XML is simply a good way to manage and share content between different
companies, etc. Those that are not too familiar with XML, should try and
read a little bit on the advantages of it. It is the next generation markup
language that many major players support. It's more flexable than HTML/XHTML
and less difficult than SGML.

> -Original Message-
> From: Kevin Waterson [mailto:[EMAIL PROTECTED]]
> Sent: Monday, February 10, 2003 6:27 PM
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP] WYSIWIG CMS Part1
>
>
> This one time, at band camp,
> Hardik Doshi <[EMAIL PROTECTED]> wrote:
>
>
> > THe stuff which you are doing with XSLT and XML is
> > pretty same like Smarty template engine? What is the
> > advantage of using XML, XSLT than Smarty template
> > engine?
>
> Well basically, Smarty is gay.
> Smarty supposedly will seperate code from content.
> but you have still need to markup to able to handle loops,
> conditions etc which puts code right back into the content.
> But it is Smarty code and not PHP code, where is the value in that?
> The pre-supposition is of course that html designers are idiots when
> what is really needed is to teach them some basics about PHP rather
> than introducing an entire new (Smarty) concept.
> Of course when you build an application with Smarty you get to
> use buzzwords like multi-tiered, but this slows you down.
>
> The extensive use of regex within the application cannot be a
> good thing. The use of tags such as {foobar} could easily be replaced
> by  or  and most every thing else
> is easily handled with file_get_contents() include() or eval()
> I am not saying Smarty is a worthless piece of dog shit, quite, I just
> feel it create unneccessary overhead without delivering true seperation
> of code and content.
>
> The XML way I am implementing also does not achieve this, and
> does not make any claim to
> it mearly makes the information available to many applications which
> can format or do with whatever the programmer wants. Example...
> If I have a news
> script with the output
> 
>  
>24
>Smarty is dead
>People finally wake up
>  
> 
>
> Now other applications can snarf this information readily. So you
> can do something
> like a news headlines block on the side of your page ala
> freshmeat. just take the
>  in a xsl:foreach and you have it.
> This can be done
> application using xml.
>
> So anyhow, just my $0.02
> Try Smarty, try other template solutions, roll your own, or find
> the solution that
> best fits your needs. There is no ultimate Template Engine or
> application. It really
> is horses for courses.
>
> enjoy
> Kevin
>
> --
>  __
> (_ \
>  _) )           
> |  /  / _  ) / _  | / ___) / _  )
> | |  ( (/ / ( ( | |( (___ ( (/ /
> |_|   \) \_||_| \) \)
> Kevin Waterson
> Port Macquarie, Australia
>
> --
> 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] Re: MySQL for storing PHP code

2003-02-10 Thread Tom Rogers
Hi,

Tuesday, February 11, 2003, 7:39:16 AM, you wrote:
DP> Thanks for the comments everyone! eval() has just made my day :)

DP> Cheers,
DP> Daniel


DP> "Daniel Page" <[EMAIL PROTECTED]> a écrit dans le message de news:
DP> [EMAIL PROTECTED]
>> Hi,
>>
>> Would it be possible to store PHP code in a MySQL table, then via a web
>> page, connect to the DB, recover the code that corresponds to a certain id
>> number, then include that code for execution?
>>
>> For example (quick, dirty, and untested!):
>>
>> $sql = "SELECT phpcode FROM phpstorage WHERE codeid = 1";
>> $result = mysql_query($sql);
>> $_php_code = mysql_result($result, 0,"phpcode");
>> echo $_php_code;
>>
>> Will the echo (or print() ) just output code that can be read by the
DP> reader
>> of the page, or will it generate output that will be executed?
>>
>> If the echo/print does not work, is there another way to do this?
>>
>> Cheers,
>> Daniel
>>
>>

Be aware that it could also ruin your life :)
It would be a good idea to store an encrypted checksum of the code to ensure it
has not been tampered with as eval will do exactly what it is told to do.

-- 
regards,
Tom


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




[PHP] php-cli

2003-02-10 Thread Michael P. Carel
Hi to all,

Is there anyone who could help me regarding php-cli in windows. What should
be the syntax to make the screen clear before echoing something?
Is there a good reference in php-cli?

Thanks in advance for the replies.



mike




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




Re: [PHP] WYSIWIG CMS Part1

2003-02-10 Thread michael kimsal
Kevin Waterson wrote:



Well basically, Smarty is gay.
Smarty supposedly will seperate code from content.
but you have still need to markup to able to handle loops, 
conditions etc which puts code right back into the content.
But it is Smarty code and not PHP code, where is the value in that?
The pre-supposition is of course that html designers are idiots when
what is really needed is to teach them some basics about PHP rather
than introducing an entire new (Smarty) concept.
Of course when you build an application with Smarty you get to 
use buzzwords like multi-tiered, but this slows you down.



I'm no Smarty fan, but there are two aspects which are
rarely, if ever (I'd say NEVER, but 'never say never'!)
brought up in Smarty's defense.

First - if you're dealing with multiple people on a project,
having 'HTML' people use Smarty can prevent them from including
random PHP code, which may email contents of forms to themselves,
etc.  The rebuttal to that (at our office) is that especially
on projects that have multiple people, you should rarely
have people putting stuff on  a live server without peer review
of some sort.

Second - there's a POTENTIAL for Smarty (or any other template
system) to be 'cross platform'.  If you could reuse the same
Smarty template across PHP, Perl, CF, Java, Python, TCL, whatever,
it'd become a defacto standard.  They aren't pushing this.

There is one (ultimatetemplate.com I think) which has
ASP and PHP parsers for the same template syntax system.  Good
idea, but not getting enough attention.

It'd be one of the few reasons I'd recommend someone
learning/using an external template system.



The extensive use of regex within the application cannot be a 
good thing. The use of tags such as {foobar} could easily be replaced
by  or  and most every thing else
is easily handled with file_get_contents() include() or eval()
I am not saying Smarty is a worthless piece of dog shit, quite, I just
feel it create unneccessary overhead without delivering true seperation
of code and content.

The regexes are only done once per file, until it changes, as
Smarty will take the 'original' version and translate it into
native PHP calls then save that file.  I'm not sure
how it handles concurrency on new templates (possibility of race 
conditions?) but I tend to think most people getting their
ire up over various template systems usually don't have
sites with much traffic anyway.  I may be wrong here - it's
more of a hunch than anything else.


Michael Kimsal
http://www.logicreate.com <-- doesn't use Smarty  :)
734-480-9961


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



Re: [PHP] Class within a class

2003-02-10 Thread Tom Rogers
Hi,

Tuesday, February 11, 2003, 5:36:22 AM, you wrote:
JM> I have made a Mysql database class. I wanted to know how I could use
JM> that class in another class without using extend. For example:

JM> include 'db.php';
JM> $db = new db();

JM> ...some php code...


JM> class blah  {

JM> var $test = 1;

JM> function blah() {
JM> ..
JM> $db->query(some query); //mysql class being used here
JM> }
JM> }

JM> I don't want to create an instance of db class in the blah class because
JM> I use db in other parts of the script so an instance already exists. Any
JM> way I can do this?

I do it this way

$class_ref = array()

class db{
  function db(){
   global $class_ref;
   $class_ref['db'] =& $this;
  }
}

class a {
  var $db;
  function a{
   global $class_ref;
   if(isset($class_ref['db'])){
$this->db =& $class_ref['db'];
   }else{
 $this->db = new db();
   }
  }
}

using $class_ref you can register all classes thay may be shared.


-- 
regards,
Tom


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




[PHP] Printing an image - insights needed!

2003-02-10 Thread Andre Dubuc
Hi,

I have a very annoying little problem that someone might have an insight as 
to its cause. The opening page on my site has two small jpeg pixs (3.9KB) 
that display properly for any user. I have another page, with exactly the 
same code, and same jpeg pixs that displays properly as well.

";

?>

**

";

?>


However, when I want to print a copy of these pages, while on the web, the 
first one (the opening page) does not print the jpeg pixs, whereas the 
second page does.

The only difference I can see between the two is that the second page has img 
src and alt in caps (but that shouldn't make any difference). I've tried 
Opera, Konqueror, Galeon, and Mozilla with the same effect. Even tried 
changing to .jpg but no difference. Any ideas what might be  messing up the 
print function? Btw, in Konqueror it displays an empty white box, while in 
Opera no box at all. Any ideas, suggestions, or where to look would be 
greatly appreciated. I'm stumped.

Tia,
Andre



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




Re: [PHP] File upload problem

2003-02-10 Thread Pag



Which sounds like it has to be there to me? I just checked a working
file upload form without MAX_FILE_SIZE field, and it worked.. I guess i
misunderstood what was on the tutorials ? Or i wonder if this was a must
in the earlier versions of PHP? Anyone?


I have an upload feature on my administration side of my site and 
i dont use the MAX_FILE_SIZE as a hidden field on the form. I simply have a 
field for the file to upload and do all the checks, for size, change 
filename, etc, on the receiving end (different script) and it works fine.
If you want the code, i can send it to you or post it here. :-)

Pag 



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



RE: [PHP] File upload problem

2003-02-10 Thread Dennis Cole
MAX_FILE_SIZE only tells the browser how large the file should be. This is
why the PHP manual page also says, "The MAX_FILE_SIZE is advisory to the
browser. It is easy to circumvent this maximum. So don't count on it that
the browser obeys your wish! The PHP-settings for maximum-size, however,
cannot be fooled. "

-Original Message-
From: Gurhan Ozen [mailto:[EMAIL PROTECTED]]
Sent: Monday, February 10, 2003 9:50 PM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] File upload problem


On Sun, 2003-02-09 at 19:43, Jason Wong wrote:
> On Monday 10 February 2003 05:56, Gurhan Ozen wrote:
>
> > You need to specifye the MAX_FILE_SIZE value as a hidden argument to the
> > form..
> > See: http://www.php.net/manual/en/features.file-upload.php
>
> You don't.
>
> If you can show otherwise please post details to the list.
>

Hi Jason,
I remember reading it on the book "PHP and MySQL Web development" book
by Luke Welling and Laura Thompson. I just checked the book again, on
page 353, when explaining file upload it reads "You must have a form
field that sets the maximum size file that can be uploaded". Then it
says "The name of this form field must be MAX_FILE_SIZE".
Also in the PHP manual which can be seen at:
http://www.php.net/manual/en/features.file-upload.php, it reads:
" The _URL_ should point to a PHP file. The MAX_FILE_SIZE hidden field
must precede the file input field and its value is the maximum filesize
accepted. The value is in bytes."
Which sounds like it has to be there to me? I just checked a working
file upload form without MAX_FILE_SIZE field, and it worked.. I guess i
misunderstood what was on the tutorials ? Or i wonder if this was a must
in the earlier versions of PHP? Anyone?
And thanks for correcting me..
Gurhan

> --
> Jason Wong -> Gremlins Associates -> www.gremlins.biz
> Open Source Software Systems Integrators
> * Web Design & Hosting * Internet & Intranet Applications Development *
> --
> Search the list archives before you post
> http://marc.theaimsgroup.com/?l=php-general
> --
> /*
> To keep your friends treat them kindly; to kill them, treat them often.
> */
>
>
> --
> 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 General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] problem with " and '

2003-02-10 Thread Pag

	Hi,

	When a user wants to add a comment on my site and uses either " or  ', and 
when it gets printed out,  comes out as /" or /', either to the web page or 
on a form to alter.

	The only "treatment" i give it after its submited on the form is:

	$comentarioc = str_replace("\r\n", "\n", $comentarioc);
	$comentarioc = str_replace("\r", "\n", $comentarioc);

	Is there a way to solve this? So it can accept both " and ', and be able 
to alter/print it with no problem?
	Thanks.

	Pag



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



Re: [PHP] File upload problem

2003-02-10 Thread Gurhan Ozen
On Sun, 2003-02-09 at 19:43, Jason Wong wrote:
> On Monday 10 February 2003 05:56, Gurhan Ozen wrote:
> 
> > You need to specifye the MAX_FILE_SIZE value as a hidden argument to the
> > form..
> > See: http://www.php.net/manual/en/features.file-upload.php
> 
> You don't. 
> 
> If you can show otherwise please post details to the list.
> 

Hi Jason, 
I remember reading it on the book "PHP and MySQL Web development" book
by Luke Welling and Laura Thompson. I just checked the book again, on
page 353, when explaining file upload it reads "You must have a form
field that sets the maximum size file that can be uploaded". Then it
says "The name of this form field must be MAX_FILE_SIZE".
Also in the PHP manual which can be seen at:
http://www.php.net/manual/en/features.file-upload.php, it reads:
" The _URL_ should point to a PHP file. The MAX_FILE_SIZE hidden field
must precede the file input field and its value is the maximum filesize
accepted. The value is in bytes."
Which sounds like it has to be there to me? I just checked a working
file upload form without MAX_FILE_SIZE field, and it worked.. I guess i
misunderstood what was on the tutorials ? Or i wonder if this was a must
in the earlier versions of PHP? Anyone?
And thanks for correcting me..
Gurhan
   
> -- 
> Jason Wong -> Gremlins Associates -> www.gremlins.biz
> Open Source Software Systems Integrators
> * Web Design & Hosting * Internet & Intranet Applications Development *
> --
> Search the list archives before you post
> http://marc.theaimsgroup.com/?l=php-general
> --
> /*
> To keep your friends treat them kindly; to kill them, treat them often.
> */
> 
> 
> -- 
> 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] sorting multi-dimensional array where array elements are structs [simple class]

2003-02-10 Thread Michael Sims
On Mon, 10 Feb 2003 16:23:10 -0600, you wrote:

>Hi.
> 
>I’m working with a multidimensional array where the data in the 
>array is a class (struct).  All the information is being stored correctly, 
>but I need to sort each “column” (AA0, BA0, etc. – see below) 
>by the fieldNo portion of the struct.
> 
>class fieldClass
>{
>var $fieldNo;
>var $srcLineNo;
>var $data;
>}
[...]

Although I've never personally used it, I believe usort() is what you
need:

http://www.php.net/manual/en/function.usort.php

You would need to create a callback function, something like:

function cmp($a, $b) {
  if ($a->fieldNo == $b->fieldNo) { return 0; }
  return ($a->fieldNo > $b->fieldNo) ? 1 : -1;
}

usort($structArray, 'cmp');

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




Re: [PHP] several buttons in form - which one was clicked

2003-02-10 Thread Justin French
Hi,

Why do you want a checkbox beside each button?  Wouldn't the button alone be
enough?  I'm assuming it's for something like a delete items list?

This is one of many ways to do it... I can't see why you need checkboxes --
perhaps you need to tell us more abut what you want to achieve.

";
echo "Delete Item # {$i} ";
echo "";
echo "";
echo "";
}
?>

This would create 30 go buttons, each one on it's own form, each one having
a hidden name/value of item/$i.  On anyfile.php you would be concerned with
the POST var $_POST['item'] (or $item if reg globals on), and perhaps
$_POST['delete'] to know that the form was submitted.


Another option might be a list of checkboxes, and ONE go button to delete
all checked items:


";
}
?>


On anyfile.php, you would have an array $_POST['delete'] that you could loop
through, getting the keys (id's of items to be deleted) and acting upon
them.


I could go on :)


Justin







on 11/02/03 12:09 PM, Vahldieck, Mike ([EMAIL PROTECTED]) wrote:

> Hi there,
> 
> I'm new to PHP, so maybe this Q makes me look rather stupid... never mind,
> asking it anyway...
> 
> I want to have a form with several checkboxes and an OK button next to each
> of them, to enable users to send data when checkbox has been changed..
> I need to pass $i to know, which button has been clicked...
> 
> for ($i = 1; $i <= 30; $i++) {
> echo "checkbox No. $i";
> echo "";
> echo "";
> echo "";
> echo "";
> }
> ?>
> 
> 
> I always get anyfile.php?box=1 ... What am I doing wrong?
> Better ways to do that?
> 
> Thanks for your help
> greetings from Berlin/Germany
> Mike
> 
> 


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




[PHP] Re: Anyone? more info...

2003-02-10 Thread Shawn McKenzie
Thanks Phillip!

"Philip Hallstrom" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> That is the right answer though... along with the various magic_quotes
> flags in the configuration.
>
> You need to look at your existing settings and then create a simple test
> where you type in something such as: x'x"x\x and then spit it out and save
> it and generally see at what point slashes are being added.
>
> There's a couple of ways to do it...
>
> put slashes in automatically, strip them on display
> don't do it automatically, add them before insertion to a database
>
> but which one is easiest for you depends on your sites configuration and
> what code you've already written, etc...
>
> -philip
>
>
> On Mon, 10 Feb 2003, Shawn McKenzie wrote:
>
> > Is more info needed, or was everyone just going post replies like:
> >
> > "see  stripslashes() and htmlentities()"
> >
> > ***
> >
> > I have a form and I want the user to be able to enter html in a text
area.
> > This will then be stored in an array in a config file.  Example
> > $htmlstuff[1] = '

[PHP] several buttons in form - which one was clicked

2003-02-10 Thread Vahldieck, Mike
Hi there,

I'm new to PHP, so maybe this Q makes me look rather stupid... never mind,
asking it anyway...

I want to have a form with several checkboxes and an OK button next to each
of them, to enable users to send data when checkbox has been changed..
I need to pass $i to know, which button has been clicked...

for ($i = 1; $i <= 30; $i++) {
echo "checkbox No. $i";
echo "";
echo "";
echo "";
echo "";
}
?>


I always get anyfile.php?box=1 ... What am I doing wrong?
Better ways to do that?

Thanks for your help
greetings from Berlin/Germany
Mike



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




Re: [PHP] WYSIWIG CMS Part1

2003-02-10 Thread Kevin Waterson
This one time, at band camp,
Hardik Doshi <[EMAIL PROTECTED]> wrote:


> THe stuff which you are doing with XSLT and XML is
> pretty same like Smarty template engine? What is the
> advantage of using XML, XSLT than Smarty template
> engine?

Well basically, Smarty is gay.
Smarty supposedly will seperate code from content.
but you have still need to markup to able to handle loops, 
conditions etc which puts code right back into the content.
But it is Smarty code and not PHP code, where is the value in that?
The pre-supposition is of course that html designers are idiots when
what is really needed is to teach them some basics about PHP rather
than introducing an entire new (Smarty) concept.
Of course when you build an application with Smarty you get to 
use buzzwords like multi-tiered, but this slows you down.

The extensive use of regex within the application cannot be a 
good thing. The use of tags such as {foobar} could easily be replaced
by  or  and most every thing else
is easily handled with file_get_contents() include() or eval()
I am not saying Smarty is a worthless piece of dog shit, quite, I just
feel it create unneccessary overhead without delivering true seperation
of code and content.

The XML way I am implementing also does not achieve this, and does not make any claim 
to
it mearly makes the information available to many applications which
can format or do with whatever the programmer wants. Example... If I have a news
script with the output 

 
   24
   Smarty is dead
   People finally wake up
 


Now other applications can snarf this information readily. So you can do something
like a news headlines block on the side of your page ala freshmeat. just take the
 in a xsl:foreach and you have it. This can be done 
application using xml.

So anyhow, just my $0.02
Try Smarty, try other template solutions, roll your own, or find the solution that
best fits your needs. There is no ultimate Template Engine or application. It really
is horses for courses.
 
enjoy
Kevin

-- 
 __  
(_ \ 
 _) )            
|  /  / _  ) / _  | / ___) / _  )
| |  ( (/ / ( ( | |( (___ ( (/ / 
|_|   \) \_||_| \) \)
Kevin Waterson
Port Macquarie, Australia

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




[PHP] Re: Anyone? more info...

2003-02-10 Thread Philip Hallstrom
That is the right answer though... along with the various magic_quotes
flags in the configuration.

You need to look at your existing settings and then create a simple test
where you type in something such as: x'x"x\x and then spit it out and save
it and generally see at what point slashes are being added.

There's a couple of ways to do it...

put slashes in automatically, strip them on display
don't do it automatically, add them before insertion to a database

but which one is easiest for you depends on your sites configuration and
what code you've already written, etc...

-philip


On Mon, 10 Feb 2003, Shawn McKenzie wrote:

> Is more info needed, or was everyone just going post replies like:
>
> "see  stripslashes() and htmlentities()"
>
> ***
>
> I have a form and I want the user to be able to enter html in a text area.
> This will then be stored in an array in a config file.  Example
> $htmlstuff[1] = '

[PHP] Re: How can I install PHP 4.2.3 and Apache on WIN98 ?

2003-02-10 Thread Shawn McKenzie
Apache won't be a service on Win98.  there should be a batch file to start
it, or just start apache.exe from the command line with options.  You'll
need to do it every you reboot unless you put a batch file in Startup.

Once Apache is running, just follow the install instructions for PHP,
restart Apache, and it should work fine.

FYI... Posting in this forum you're most likely to just get a link to the
Apache documentation.

HTH
-Shawn

"Rija" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I want to run php 4.2.3 on Windows 98 2nd edition using apache server, but
> after installing apache on it, I've got the following message, No service
> installed.
> So how can I install it? Then, I also cannot install php.
>
> Any thought?
>
>



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




[PHP] Anyone? more info...

2003-02-10 Thread Shawn McKenzie
Is more info needed, or was everyone just going post replies like:

"see  stripslashes() and htmlentities()"

***

I have a form and I want the user to be able to enter html in a text area.
This will then be stored in an array in a config file.  Example
$htmlstuff[1] = '

[PHP] How can I install PHP 4.2.3 and Apache on WIN98 ?

2003-02-10 Thread rija
I want to run php 4.2.3 on Windows 98 2nd edition using apache server, but
after installing apache on it, I've got the following message, No service
installed.
So how can I install it? Then, I also cannot install php.

Any thought?



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




[PHP] Re: $_SESSION['user']['nickname'] = "Herbert"

2003-02-10 Thread Brendon
On Mon, 10 Feb 2003 16:36:58 +0100, Sascha Braun <[EMAIL PROTECTED]> 
wrote:

Hi is something wrong with the above show argument?

Under Windows everything works fine under linux it just
shows me an 0 or 1, maybe for true or false, dont know.




Nothing really, except maybe the missing semicolon.

Maybe your problem is you haven't started the session? And don't forget, 
you need to start the session on every page.

Good luck.
--
_BB

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



Re: [PHP] numerics

2003-02-10 Thread Justin French
I guess it might be possible with javascript.  At the very least, you can do
a validation client-side for numbers only before submitting.

Justin.


on 11/02/03 5:27 AM, Edward Peloke ([EMAIL PROTECTED]) wrote:

> IS there a way to only allow the user to type in numerics to a text field?
> I do not want to allow them to even type in anything unless it is a number.
> Basically, I don't want to allow them to enter hi and then I do checks and
> give them a warning that it isn't a number, I want to force it from the
> start.
> 
> Thanks,
> Eddie
> 


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




Re: [PHP] Who's Online

2003-02-10 Thread Justin French
Search the archives.  This asked, and answered, a few times a week.

Justin French


on 11/02/03 9:53 AM, Vernon ([EMAIL PROTECTED]) wrote:

> I have a membership base that is logging into a php and MySQL based web site
> and am wanting to be able to create a who's online (and perhaps an ability
> to contact that person, but that's later) so that that person's profile is
> available.
> 
> Anyone have any ideas where I could download a quick script someone to plug
> it in or if not a tutorial on how to make that happen?
> 
> Thanks
> 
> 


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




[PHP] Re: Need help storing and displaying html/text!

2003-02-10 Thread Shawn McKenzie
Hmmm...  I guess no one is doing this???  Seems fairly common.

Thanks!
Shawn

"Shawn McKenzie" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I have a form and I want the user to be able to enter html in a text area.
> This will then be stored in an array in a config file.  Example
> $htmlstuff[1] = '

[PHP] Help needed for submitting multiple files!

2003-02-10 Thread Geckodeep
I am building a page that submits an article with 9 jpgs images of 45 to
60ko in size.

I got it working with no problems for two to three files, until when I
tested with all nine images I saw the real problem, that wouldn't uploaded
it.

When I consulted with my service provider they said they have put a limit to
upload of 200ko per submit.

Here I am stuck with no real solution to this problem, except that I have
this idea of submitting the article by breaking it down in 3 steps and by
presenting three different forms which should be ok, but what will I do if
the person wanted to edit the article after having submitted e.g. to modify
the article later on.

How will I go fetching the article and presenting it in 3 steps, but this
time for update and taking it into consideration of the images stored in the
file and referenced in the db.


I am opened to all advice and suggestion.

Thanks again.
GD



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




[PHP] Who's Online

2003-02-10 Thread Vernon
I have a membership base that is logging into a php and MySQL based web site
and am wanting to be able to create a who's online (and perhaps an ability
to contact that person, but that's later) so that that person's profile is
available.

Anyone have any ideas where I could download a quick script someone to plug
it in or if not a tutorial on how to make that happen?

Thanks



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




[PHP] Test

2003-02-10 Thread rija
test



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




Re: [PHP] Re: jumping between php and html or using echo for printing html-tags.

2003-02-10 Thread Askengren
Great
Thanks a lot!
/Håkan


"Marek Kilimajer" <[EMAIL PROTECTED]> skrev i meddelandet
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Then why not use single quotes, its faster than double quotes, and you
> could also use comma instead of full stop (echo can take multiple
> parameters,
> which is faster than building up a new string)
>
> function admin_menu() {
>echo ' Meny ';
>echo 'Medlemmar';
>
>
>
> Askengren wrote:
>
> >I do not know why so many developers use the "-character (double quote)
> >instead of ' (single quote) in php/html-scripts.
> >
> >Much easier is:
> >function admin_menu() {
> >   echo " Meny ";
> >   echo "Medlemmar";
> >.
> >You do then not have to worry about all backslashes.
> >And single quote is w3c html-standard just as double quote.
> >And it?s faster - you do not have to switch between html and php so
often.
> >
> >/Håkan
> >
> >
> >
> >"Anders Thoresson" <[EMAIL PROTECTED]> skrev i meddelandet
> >[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> >
> >
> >>Which is more efficient:
> >>
> >>function admin_menu() {
> >>  echo " Meny ";
> >>  echo "Medlemmar";
> >>  echo "Album";
> >>  echo "Huvudmeny";
> >>  echo "Logga ut";
> >>}
> >>
> >>or
> >>
> >>function admin_menu() {
> >>  ?>
> >>   Meny 
> >>  Medlemmar
> >>  Album
> >>  Huvudmeny
> >>  Logga
> >>ut
> >>   >>}
> >>
> >>Any reasons other than speed to choose either?
> >>
> >>--
> >>anders thoresson
> >>
> >>
> >
> >
> >
> >
> >
>



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




Re: [PHP] automatically delete records from a table

2003-02-10 Thread Chris Shiflett
--- Sunfire <[EMAIL PROTECTED]> wrote:
> i need to have the date and time of the event checked
> so when cron runs if the posted event is on 2003-02-11
> 15:00:00 for example then at 24:00:00 that day cron will
> delete that record because it isnt needed anymore

Work on creating a script that you can run yourself to do
this. Don't worry about cron just yet. Cron is not going to
help you with any logic; it is only useful for scheduling
your script to run on a specific schedule that you
determine.

So, in PHP, just check each of these "events" and delete
any of them that are more than 9 hours old. Once you get
that, adding it to cron is a simple matter of syntax.

Chris

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




[PHP] Newbie recursive directory

2003-02-10 Thread Kim Kohen
G'day all

I've been trying for a day or so to get a script to traverse all the levels
of a directory.  With help from list archives and web sites I've come up
with this:

";
}

?>

I've read lots f stuff about "if (is_dir($blah)" but I get a bit lost with
the navigation after that (I'm _real_ new to *nix as well).  Could someone
please help as to how it would fit into my script?

Cheers and thanks

kim


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




Re: [PHP] automatically delete records from a table

2003-02-10 Thread Sunfire
im writing an announcement board and i have a posted timestamp a field for
the date and time of the event (needs to be checked with cron) and a event
name and message field in the table..

i need to have the date and time of the event checked so when cron runs if
the posted event is on 2003-02-11 15:00:00 for example then at 24:00:00 that
day cron will delete that record because it isnt needed anymore.. the
variables i have are $EventDate $EventTime $Note and NULL (for timestamp)..
based on the $EventDate and $EventTime vars pulled out of the table or based
on vars created with day(EventDay) and so on how to use them with cron...

i have never used cron/crontab before ..

and just so i know what should i search for on google...since none of my
searches for anything about cron/crontab come back with anything on the list
archive..

tnx


- Original Message -
From: "Steve Werby" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, February 10, 2003 5:12 PM
Subject: Re: [PHP] automatically delete records from a table


> "Sunfire" <[EMAIL PROTECTED]> wrote:
> > was wondering about how you could run a script that automatically ran at
> > midnight every day and deleted records that matched a certain date
stored
> in
> > a mysql table? any ideas how that supposed to work?..
> >
> > i think the script has to be a chron task on linux but im not really
sure
> > how to go about doing such a job..
>
> man cron and man crontab.  If PHP is compiled as a CGI or CLI then you can
> call the script directly, otherwise call it via the web using lyxn or
wget.
> I'd opt for CGI or CLI if at all possible so that you don't need to send a
> request to the web server.  I figure you know how to write the script and
> that it's just a matter of scheduling it.  If not please be specific about
> the problem.  This is asked pretty frequentl on php-general so between the
> archives and Google you should find what you're looking for quickly.
>
> --
> Steve Werby
> President, Befriend Internet Services LLC
> http://www.befriend.com/
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.443 / Virus Database: 248 - Release Date: 1/10/2003


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




[PHP] sorting multi-dimensional array where array elements are structs [simple class]

2003-02-10 Thread Erin Fry
Hi.
 
I’m working with a multidimensional array where the data in the array is a class 
(struct).  All the information is being stored correctly, but I need to sort each 
“column” (AA0, BA0, etc. – see below) by the fieldNo portion of the struct.
 
class fieldClass
{
var $fieldNo;
var $srcLineNo;
var $data;
}
 
   AA0   BA0   BA1  …
   __
0 ||_|_|___
1 ||_|_|___
2 ||_|_|___
3 ||_|_|___
4 ||_|_|___
.  ||_|_|___
.  ||_|_|___
.  |   | || 
 
I can find tons of examples and the such for regular multidimensional arrays with one 
data element (not a struct), and I’ve tried several sort function in php but they 
didn’t work (although I could have just been trying the wrong thing).
 
If anyone has done this before or has any suggestions, I would greatly appreciate it.
 
Erin

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.449 / Virus Database: 251 - Release Date: 1/27/2003
 



[PHP] Making a location with http authentication

2003-02-10 Thread Lasse Laursen
Hi all,

I have the following script that (in theory) would work:

http://$PHP_AUTH_USER:$clean@server/member/index.php";;

header ("Content-Location: $url");

}

?>

So here is the basics: The user authenticates using http auth against a
MySQL database - if the username and password is corrent then a NEW entry is
created in a .htpasswd file - this file contains the username along with an
unknown password. Why? To prevent people from posting passwords... (we can
monitor the number of logins from the PHP script).

If I make a Location: username:password@server/ then it simply fails :(
However if I make a metatag with a refresh (GET) to the same url then it
works just fine.

Am I missing something? Or?

Your input and help is appreciated - please answer to this email as well :-)



Thanks in advance

Regards


--
Lasse Laursen <[EMAIL PROTECTED]> - Systems Developer
NetGroup A/S, St. Kongensgade 40H, DK-1264 København K, Denmark
Phone: +45 3370 1526 - Fax: +45 3313 0066 - Web: www.netgroup.dk

- Don't be fooled by cheap finnish imitations ; BSD is the One True Code



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




Re: [PHP] WYSIWIG CMS Part1

2003-02-10 Thread Hardik Doshi
--- Kevin Waterson <[EMAIL PROTECTED]> wrote:
> This one time, at band camp,
> Hardik Doshi <[EMAIL PROTECTED]> wrote:
>  
> > I know how to write XSL style sheet along with XML
> > document. But i really dont know what contents
> should
> > be in XML. If XML contains data (and it is true)
> then
> > what is the need of MySQL? At last i can say i
> don't
> > know application of XML and XSL for seperating PHP
> and
> > HTML code.
> 
> I am putting together a cms as we speak
> I use PHP for my logic, and MySQL for dynamic
> content storage
> I extract info from the db using PEAR sql2xml class
> to put
> all the info in a XML string and then
> use xslt/sablotron to call the xsl template and
> render the 
> page

THe stuff which you are doing with XSLT and XML is
pretty same like Smarty template engine? What is the
advantage of using XML, XSLT than Smarty template
engine?

thanks for your nice comments.

Hardik
> 
> Kind regards
> Kevin
> 
> 
> -- 
>  __  
> (_ \ 
>  _) )            
> |  /  / _  ) / _  | / ___) / _  )
> | |  ( (/ / ( ( | |( (___ ( (/ / 
> |_|   \) \_||_| \) \)
> Kevin Waterson
> Port Macquarie, Australia
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


__
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

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




Re: [PHP] automatically delete records from a table

2003-02-10 Thread Steve Werby
"Sunfire" <[EMAIL PROTECTED]> wrote:
> was wondering about how you could run a script that automatically ran at
> midnight every day and deleted records that matched a certain date stored
in
> a mysql table? any ideas how that supposed to work?..
>
> i think the script has to be a chron task on linux but im not really sure
> how to go about doing such a job..

man cron and man crontab.  If PHP is compiled as a CGI or CLI then you can
call the script directly, otherwise call it via the web using lyxn or wget.
I'd opt for CGI or CLI if at all possible so that you don't need to send a
request to the web server.  I figure you know how to write the script and
that it's just a matter of scheduling it.  If not please be specific about
the problem.  This is asked pretty frequentl on php-general so between the
archives and Google you should find what you're looking for quickly.

--
Steve Werby
President, Befriend Internet Services LLC
http://www.befriend.com/



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




[PHP] Need help storing and displaying html/text!

2003-02-10 Thread Shawn McKenzie
I have a form and I want the user to be able to enter html in a text area.
This will then be stored in an array in a config file.  Example
$htmlstuff[1] = '

[PHP] automatically delete records from a table

2003-02-10 Thread Sunfire
hi..
was wondering about how you could run a script that automatically ran at
midnight every day and deleted records that matched a certain date stored in
a mysql table? any ideas how that supposed to work?..

i think the script has to be a chron task on linux but im not really sure
how to go about doing such a job..

any ideas?




---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.443 / Virus Database: 248 - Release Date: 1/10/2003


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




Re: [PHP] WYSIWIG CMS Part1

2003-02-10 Thread Kevin Waterson
This one time, at band camp,
Hardik Doshi <[EMAIL PROTECTED]> wrote:
 
> I know how to write XSL style sheet along with XML
> document. But i really dont know what contents should
> be in XML. If XML contains data (and it is true) then
> what is the need of MySQL? At last i can say i don't
> know application of XML and XSL for seperating PHP and
> HTML code.

I am putting together a cms as we speak
I use PHP for my logic, and MySQL for dynamic content storage
I extract info from the db using PEAR sql2xml class to put
all the info in a XML string and then
use xslt/sablotron to call the xsl template and render the 
page

Kind regards
Kevin


-- 
 __  
(_ \ 
 _) )            
|  /  / _  ) / _  | / ___) / _  )
| |  ( (/ / ( ( | |( (___ ( (/ / 
|_|   \) \_||_| \) \)
Kevin Waterson
Port Macquarie, Australia

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




[PHP] Re: MySQL for storing PHP code

2003-02-10 Thread Daniel Page
Thanks for the comments everyone! eval() has just made my day :)

Cheers,
Daniel


"Daniel Page" <[EMAIL PROTECTED]> a écrit dans le message de news:
[EMAIL PROTECTED]
> Hi,
>
> Would it be possible to store PHP code in a MySQL table, then via a web
> page, connect to the DB, recover the code that corresponds to a certain id
> number, then include that code for execution?
>
> For example (quick, dirty, and untested!):
>
> $sql = "SELECT phpcode FROM phpstorage WHERE codeid = 1";
> $result = mysql_query($sql);
> $_php_code = mysql_result($result, 0,"phpcode");
> echo $_php_code;
>
> Will the echo (or print() ) just output code that can be read by the
reader
> of the page, or will it generate output that will be executed?
>
> If the echo/print does not work, is there another way to do this?
>
> Cheers,
> Daniel
>
>



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




Re: [PHP] MySQL for storing PHP code

2003-02-10 Thread Chris Shiflett
--- Daniel Page <[EMAIL PROTECTED]> wrote:
> Would it be possible to store PHP code in a MySQL table,
> then via a web page, connect to the DB, recover the code
> that corresponds to a certain id number, then include
> that code for execution?

Yes, and since your example demonstrates that you know how
to query MySQL, this is all you need:

http://www.php.net/manual/en/function.eval.php

Chris

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




Fw: [PHP] MySQL for storing PHP code

2003-02-10 Thread Kevin Stone
Check out eval();
http://www.php.net/manual/en/function.eval.php

- Kevin

- Original Message -
From: "Daniel Page" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, February 10, 2003 2:21 PM
Subject: [PHP] MySQL for storing PHP code


> Hi,
>
> Would it be possible to store PHP code in a MySQL table, then via a web
> page, connect to the DB, recover the code that corresponds to a certain id
> number, then include that code for execution?
>
> For example (quick, dirty, and untested!):
>
> $sql = "SELECT phpcode FROM phpstorage WHERE codeid = 1";
> $result = mysql_query($sql);
> $_php_code = mysql_result($result, 0,"phpcode");
> echo $_php_code;
>
> Will the echo (or print() ) just output code that can be read by the
reader
> of the page, or will it generate output that will be executed?
>
> If the echo/print does not work, is there another way to do this?
>
> Cheers,
> Daniel
>
>
>
> --
> 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] MySQL for storing PHP code

2003-02-10 Thread Daniel Page
Hi,

Would it be possible to store PHP code in a MySQL table, then via a web
page, connect to the DB, recover the code that corresponds to a certain id
number, then include that code for execution?

For example (quick, dirty, and untested!):

$sql = "SELECT phpcode FROM phpstorage WHERE codeid = 1";
$result = mysql_query($sql);
$_php_code = mysql_result($result, 0,"phpcode");
echo $_php_code;

Will the echo (or print() ) just output code that can be read by the reader
of the page, or will it generate output that will be executed?

If the echo/print does not work, is there another way to do this?

Cheers,
Daniel



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




Re: [PHP] Testing if any of the items are false

2003-02-10 Thread Chris Shiflett
--- [EMAIL PROTECTED] wrote:
> How can I do this to determine if one of the items is
> false if none are then I what it to print the first
> echo of there is one that is false then print the
> second echo

Sorry, that makes no sense to me.

> $test1= "YES";
> $test2= "YES";
> $test3= "YES";
> $test4= "YES";
> $ftest1= "YES";
> $ftest2= "NO";
> $ftest3= "YES";
> $ftest4= "YES";
> 
> if
> ($test1==$ftest1)or($test2==$ftest2)or($test3==$ftest3)
> or($test4==$ftest4){
> echo "all of the items are true";
>  }else{
>   echo "one of the items is false";
>  }

That code makes less sense. Are you wanting to see if each
of your $test variables match their corresponding $ftest
variable?

Your current statement is true when any of the $test
variables match their corresponding $ftest variable. Try
using "and" instead of "or" if you want to require them all
to be true. Just read it aloud, and it should make sense.

if ($flavor == 'vanilla' || $flavor == 'chocolate')
{
   eat('ice_cream');
}

In this example, you would eat the ice cream if it was
vanilla *or* chocolate.

Chris

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




[PHP] Testing if any of the items are false

2003-02-10 Thread rdkurth


How can I do this to determine if one of the items is false if none are
then I what it to print the first echo of there is one that is false
then print the second echo
$test1= "YES";
$test2= "YES";
$test3= "YES";
$test4= "YES";
$ftest1= "YES";
$ftest2= "NO";
$ftest3= "YES";
$ftest4= "YES";

if ($test1==$ftest1)or($test2==$ftest2)or($test3==$ftest3)
or($test4==$ftest4){
echo "all of the items are true";
 }else{
  echo "one of the items is false";
 }

-- 
Best regards,
 rdkurth  mailto:[EMAIL PROTECTED]


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




[PHP] Re: Session Time

2003-02-10 Thread Bobby Patel
What you could do, is get the current time stamp using time() or date() and
create a sesion variable with this value, when they login (and the session
is created.  Then when they logout, and the sesion is destoyed get the
current time stamp again and minus it from the start time.

Note: This requires the user to "login" and "logout", if they just close the
browser then they will never get to your logour script, thus you can't
calculate their money owed.

"Stephen Craton" <[EMAIL PROTECTED]> wrote in message
004e01c2d11a$0e3a4590$0200a8c0@melchior">news:004e01c2d11a$0e3a4590$0200a8c0@melchior...
> Got a quick and easy question that I'm not sure about. What I need to do
is
> calculate how long someone has been in a chatroom, then update a members
> table to add some "money" to their account. Something like this:
>
> For every hour they're in the chatroom: 5 cents
>
> Thanks,
> Stephen Craton
> http://www.melchior.us
>
>



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




RE: [PHP] any windows php developers out here?

2003-02-10 Thread John W. Holmes
It's step 2 and 3 on this list that need to get added to the PHP manual.
Step 3 can be skipped if you're not running NTFS.

---John Holmes...

-Original Message-
From: Victor [mailto:[EMAIL PROTECTED]]
Sent: Sunday, February 09, 2003 4:20 PM
To: 'Victor'; [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: RE: [PHP] any windows php developers out here?


> So I guess I al looking to finding out what I need to configure IIS to
> to get the ISAPI module to work, etc.

1. Unzip the php .zip file to C:\php\

2. Copy c:\php\sapi\php4isapi.dll to c:\php\php4isapi.dll

3. Ensure the user IIS runs as, generally IUSR_, has read
permissions to C:\php\ and all subdirectories.

4. Follow directions as in the manual

5. Shut down IIS (net stop iisadmin)

6. Open up IIS control panel

7. Add ISAPI filter pointing to c:\php\php4isapi.dll

8. Add application mapping pointing to c:\php\php4isapi.dll

9. Start up IIS (net start w3svc)

That's it...

---John W. Holmes...

You are the best!

Thanks, BTW who is in charge of the PHP installation documentation, I
would like to slap them in the face with these instructions. I know that
IIS setup is not their domain but they are responsible for helping users
use PHP and facilitating that is made by clear documentation, this
documentation here is not perfect, but it's much more in depth and
clearer to the one who doesn't want to go to get a MSCSE degree so that
they know how to get PHP running on IIS...

- Vic

__
Post your free ad now! http://personals.yahoo.ca


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




Re: [PHP] Class within a class

2003-02-10 Thread Leif K-Brooks
If the DB object is already a global, like you seem to be saying, then 
you're already using globals...

Justin Mazzi wrote:

Is there anyway to do this without using globals?

-Original Message-
From: Leif K-Brooks [mailto:[EMAIL PROTECTED]] 
Sent: Monday, February 10, 2003 2:46 PM
To: Justin Mazzi
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] Class within a class

Use $GLOBALS['db'] (or whatever the variable name of the global variable

is).

Justin Mazzi wrote:

 

I have made a Mysql database class. I wanted to know how I could use
that class in another class without using extend. For example:

include 'db.php';
$db = new db();

...some php code...


class blah  {

	var $test = 1;

	function blah() {
		..
		$db->query(some query); //mysql class being used here
	}
}

I don't want to create an instance of db class in the blah class
   

because
 

I use db in other parts of the script so an instance already exists.
   

Any
 

way I can do this?





   


 


--
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.





Re: [PHP] Class within a class

2003-02-10 Thread Leif K-Brooks
Use $GLOBALS['db'] (or whatever the variable name of the global variable 
is).

Justin Mazzi wrote:

I have made a Mysql database class. I wanted to know how I could use
that class in another class without using extend. For example:

include 'db.php';
$db = new db();

...some php code...


class blah  {

	var $test = 1;

	function blah() {
		..
		$db->query(some query); //mysql class being used here
	}
}

I don't want to create an instance of db class in the blah class because
I use db in other parts of the script so an instance already exists. Any
way I can do this?



 


--
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] Class within a class

2003-02-10 Thread Justin Mazzi
I have made a Mysql database class. I wanted to know how I could use
that class in another class without using extend. For example:

include 'db.php';
$db = new db();

...some php code...


class blah  {

var $test = 1;

function blah() {
..
$db->query(some query); //mysql class being used here
}
}

I don't want to create an instance of db class in the blah class because
I use db in other parts of the script so an instance already exists. Any
way I can do this?



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




Re: [PHP] Why use XML?

2003-02-10 Thread Colin Kettenacker
> It seems like a
> great tool, but I am trying to figure out why I would actually use it? All
> it does is seperate content and data, albeit on the client

Not necessarily only on the client, but on the server side as well.

> It would just add
> another layer of content/data seperation that would have to processed on the
> other end. 

And that is the heart of the matter. That additional layer as you have so
correctly put it allows you to take the data structure you have defined in
your XML document and port it into any other system. Let's say that you
define a data structure in XML that is being parsed in PHP... maybe at some
point you need it to work in a PERL application as well. By conventional
means if you needed to update your data specifications you'd need to update
it and integrate that into both your PHP and PERL applications. This means
you are duplicating the work effort for each platform you support. If you
have an XML spec defined for your data structure (and content) then all you
need to do is update the XML document and it *should* work seamlessly in
both applications. I say should work seamlessly, as you *may* need to write
additional API's in your platforms to support the changes you've made in
your XML spec. That really depends on what changes you make to you XML spec.

As you have already touched on, there is an additional overhead, as one
would have to write an API layer that will parse the XML for each platform
application that they support. The nice thing is that there is a building
base of XML specifications for a number of data structures, as well as a
growing base of existing API's that will parse those specs... so if you are
lucky you may not need to build the XML structure and API's to run your
spec.

ck


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




Re: [PHP] Integrating PHP with Perl

2003-02-10 Thread Jason Wong
On Tuesday 11 February 2003 03:11, Monica Lau wrote:

> I have a system that uses Perl scripts to process the HTML forms.  It uses
> HTTP Basic Authentication to authenticate the users.  The problem is that
> there is no session tracking and no logout button.  I heard that PHP makes
> this login/logout and session tracking very simple, so I was wondering if I
> could somehow incorporate some PHP code with the existing Perl code?  Is
> this possible?  I suppose I could use PHP to check for the validity of the
> session id before passing it to the Perl scripts.

http://freshmeat.net/projects/php-session/

This is supposed to allow access to PHP sessions from within Perl.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
Indomitable in retreat; invincible in advance; insufferable in victory.
-- Winston Churchill, on General Montgomery
*/


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




[PHP] Integrating PHP with Perl

2003-02-10 Thread Monica Lau

Hi all,

I have a system that uses Perl scripts to process the HTML forms.  It uses HTTP Basic 
Authentication to authenticate the users.  The problem is that there is no session 
tracking and no logout button.  I heard that PHP makes this login/logout and session 
tracking very simple, so I was wondering if I could somehow incorporate some PHP code 
with the existing Perl code?  Is this possible?  I suppose I could use PHP to check 
for the validity of the session id before passing it to the Perl scripts.  

Thanks for your time and help!  

Monica



-
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now


[PHP] Fw: help plz server

2003-02-10 Thread Nate

- Original Message -
From: "Maxim Maletsky" <[EMAIL PROTECTED]>
To: "Nate" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Monday, February 10, 2003 5:42 AM
Subject: Re: help plz server


> please forward this email to `[EMAIL PROTECTED]'
>
>
> --
> Maxim Maletsky
> [EMAIL PROTECTED]
>
>
>
> "Nate" <[EMAIL PROTECTED]> wrote... :
>
> > ok i have a problem
> > my computer/server got messed up a week ago i just got my server back up
and i installed php well my requires and includes don't work my path is
this:
> >
> > include_path = "..;c:\inetpub\wwwroot"
> >
> > i dunno what's up with it it should work but it keeps coming up with
this:
> >
> > Warning: main(/includes/functions.inc) [function.main]: failed to create
stream: No such file or directory in c:\inetpub\wwwroot\stats\include.php on
line 1
> >
> > Fatal error: main() [function.main]: Failed opening required
'/includes/functions.inc' (include_path='..;c:\inetpub\wwwroot\') in
c:\inetpub\wwwroot\stats\include.php on line 1
> >
> > the page resides in c:\inetpub\wwwroot\stats\
> > this is the code for the page:
> >
> > 
> >  
> >  
> >  
> >  >  require ("/includes/Sec.inc");
> >
> > if (isset($_REQUEST['inc']))
> >  require ($_REQUEST['inc']);
> > else
> >  require ("index.php");
> >
> >  require ("/includes/parts/bottom.inc");
> > ?>
> >
> > can ya help me at all?
>


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




Re: [PHP] numerics

2003-02-10 Thread Kevin Stone
I'm sorry I misunderstood.  As previously stated PHP is server-side only,
you need a client-side solution.  Search for Javascript validate numeric.
- Kevin

- Original Message -
From: "Kevin Stone" <[EMAIL PROTECTED]>
To: "Edward Peloke" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Monday, February 10, 2003 11:38 AM
Subject: Re: [PHP] numerics


> Check out: is_numeric()
> http://www.php.net/manual/en/function.is-numeric.php
>
> -Kevin
>
> - Original Message -
> From: "Edward Peloke" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Monday, February 10, 2003 11:27 AM
> Subject: [PHP] numerics
>
>
> > IS there a way to only allow the user to type in numerics to a text
field?
> > I do not want to allow them to even type in anything unless it is a
> number.
> > Basically, I don't want to allow them to enter hi and then I do checks
and
> > give them a warning that it isn't a number, I want to force it from the
> > start.
> >
> > Thanks,
> > Eddie
> >
> >
> > --
> > 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 General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] numerics

2003-02-10 Thread Steve Werby
"Edward Peloke" <[EMAIL PROTECTED]> wrote:
> IS there a way to only allow the user to type in numerics to a text field?
> I do not want to allow them to even type in anything unless it is a
> number.
> Basically, I don't want to allow them to enter hi and then I do checks and
> give them a warning that it isn't a number, I want to force it from the
> start.

PHP is server-side so it can't be accomplished via PHP, but it can via
JavaScript.  Google for something like 'javascript validate numeric'.
Here's JS script that limits entry to alphanumeric characters.  I've seen
better JS code to do the same so if it's not suitable keep looking.

http://javascript.internet.com/forms/val-char.html

--
Steve Werby
President, Befriend Internet Services LLC
http://www.befriend.com/




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




Re: [PHP] numerics

2003-02-10 Thread Kevin Stone
Check out: is_numeric()
http://www.php.net/manual/en/function.is-numeric.php

-Kevin

- Original Message -
From: "Edward Peloke" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, February 10, 2003 11:27 AM
Subject: [PHP] numerics


> IS there a way to only allow the user to type in numerics to a text field?
> I do not want to allow them to even type in anything unless it is a
number.
> Basically, I don't want to allow them to enter hi and then I do checks and
> give them a warning that it isn't a number, I want to force it from the
> start.
>
> Thanks,
> Eddie
>
>
> --
> 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] numerics

2003-02-10 Thread Jason Wong
On Tuesday 11 February 2003 02:27, Edward Peloke wrote:
> IS there a way to only allow the user to type in numerics to a text field?
> I do not want to allow them to even type in anything unless it is a number.
> Basically, I don't want to allow them to enter hi and then I do checks and
> give them a warning that it isn't a number, I want to force it from the
> start.

You can use javascript to enforce it at the input stage. But ultimately 
there's nothing that can stop people from submitting whatever they want. If 
you value the integrity of your data you NEED server-side verification -- 
there's no substitute for it.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
I'm sorry a pentium won't do, you need an SGI to connect with us.
*/


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




[PHP] numerics

2003-02-10 Thread Edward Peloke
IS there a way to only allow the user to type in numerics to a text field?
I do not want to allow them to even type in anything unless it is a number.
Basically, I don't want to allow them to enter hi and then I do checks and
give them a warning that it isn't a number, I want to force it from the
start.

Thanks,
Eddie


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




[PHP] sockets: resource(20) of type (Unknown)

2003-02-10 Thread Jason k Larson
Hi -

I have an problem and I'm not sure how to proceed troubleshooting.  I 
have a socket connection that I'm making to a local stunnel daemon.  The 
connection works and is valid until it seemingly dies and the resource 
type becomes unknown.

at timestamp: 1044900028.6608 my object has this resource:
resource(20) of type (stream)

at timestamp: 1044900028.6808 it becomes:
resource(20) of type (Unknown)

I don't think this is a timeout issue, and I can perform all of my 
functionality via a telnet session without any problems as well.  This 
code used to work great, I have made recent upgrades and changed 
environments.  However the code consistently dies in the exact place, a 
place where other fsocket reads and writes are successfully been made.

Any suggestions would be appreciated.

Regards,
Jason k Larson


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



Re: [PHP] a while loop that does't end with the script

2003-02-10 Thread Sunfire
try putting exit; at the end of your script will kill it dead in its tracks


- Original Message -
From: "Francesco Leonetti" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, February 10, 2003 6:34 AM
Subject: [PHP] a while loop that does't end with the script


> Hi,
> I'm a newcomer here to the list, so do please apologize in the case my
> question has already been discussed before.
>
> I just moved from php 4.0.6 to php 4.2.2 for security reasons (4.0.6 got a
> big buffer overflow hole...). The working environment now is Redhat 8.1,
> mysql 3.23.54a, kernel 2.4.18-19.
>
> My problem is in a php page including a neverending loop, like this:
>
> mysql_connect()
>
> while (1) {
>flush()
> ... do things...
> ... query the database ...
> ... echo other things...
>flush()
> }
>
> In the previous version of PHP when I exit the page, the script ended as
> well (this stopping querying the database). Now when I exit from the page,
I
> see from the mysqladmin processlist that the mysql_query thread is still
> running. It doesn't end and it keeps running 'til I restart httpd.
>
> This is time and  memory consuming. Why the script doesn't end as usual?
>
> Am I missing something in the configuration files?
>
> Thank you for any help.
>
> Bye
> Francesco Leonetti
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.443 / Virus Database: 248 - Release Date: 1/10/2003


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




[PHP] php and postie

2003-02-10 Thread Javier Gloria Medina
 hi everyone:

i was wondering if its posible to use the program postie, so u can send
mails with the fuction mail().

is there anyone that can help me with this.

thanks



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




[PHP] Graphics for PHP Help!

2003-02-10 Thread D.Starr
PHP programmer needed to assist with development of an ultra-simple XML
driven portfolio site. Extensive planning phase already completed. Primary
goal is total separation of content from interface.

Accomplished digital artist (and student) prefers to offer in exchange
services in 3D & 2D animation, illustration and/or design. Previous work
examples can currently be viewed online at www.discoloured.org.

So, if you need any sort of digital eyecandy and are willing to help with
some simple scripting, please email [EMAIL PROTECTED] today!



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




[PHP] I get a "File Download" dialogue box from http://localhost

2003-02-10 Thread nelson
I am trying to configure run PHP4 on Apache on Windows XP.

When I type http://localhost/ all I get is a "File Download" dialogue box,
instead of the normal Apache server page.

Does anyone know whats is going on here?

Please tell me if you need any more information.

-Nelson



RE: [PHP] I get a "File Download" dialogue box

2003-02-10 Thread Barajas, Arturo
You need to tell Apache that the .php extension is a web page.

Take a look at the README or the INSTALL text files, there is the solution. I think it 
has to be something along the "AddType" lines.
--
Un gran saludo/Big regards...
   Arturo Barajas, IT/Systems PPG MX (SJDR)
   (427) 271-9918, x448

> -Original Message-
> From: news [mailto:[EMAIL PROTECTED]]
> Sent: Lunes, 10 de Febrero de 2003 10:50 a.m.
> To: [EMAIL PROTECTED]
> Subject: [PHP] I get a "File Download" dialogue box
> 
> 
> I am trying to configure run PHP4 on Apache on Windows XP.
> 
> When I type http://localhost/ all I get is a "File Download" 
> dialogue box,
> instead of the normal Apache server page.
> 
> Does anyone know whats is going on here?
> 
> Please tell me if you need any more information.
> 
> -Nelson
> 
> 
> 
> -- 
> 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] I get a "File Download" dialogue box

2003-02-10 Thread news
I am trying to configure run PHP4 on Apache on Windows XP.

When I type http://localhost/ all I get is a "File Download" dialogue box,
instead of the normal Apache server page.

Does anyone know whats is going on here?

Please tell me if you need any more information.

-Nelson



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




Re: [PHP] Vulvan Logic SRM - does anyone use it?

2003-02-10 Thread Tamas Arpad
On Monday 10 February 2003 16:03, Derick Rethans wrote:
> On 10 Feb 2003, Tamas Arpad wrote:
> > I'm thinking about using SRM application server for storing cached data.
> > But I have to convince my customers that it's stable enough and is ready
> > to use in production environment.
> > Is it considered stable enough to use in such applications? As I see it
> > hasn't been maintained for at least half year.
>
> I won't consider it production stable _yet_, we're still working on it
> though, and it is definitely maintained. But without a lot of feedback
> we don't know about the things that go wrong.

Thanks for your answer Derick.
Then I'm starting to use it as an alternative of storing serialised objects in 
files, and will test it carefully.
I'll let you know if I found something.

regards,
Arpi

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




Re[2]: [PHP] Delimited file values behaving strangely... SOLVED

2003-02-10 Thread Geoff Caplan
Hi,

Of course, I solve it just after I decide to post...

For some reason, my customer's spreadsheet data has unusual non-printing
characters in some of the fields that weren't showing up in the page
source. All I needed to do is strip them out with a regex.

Anyway, thanks for the suggestions

Geoff Caplan
Advantae Ltd


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




[PHP] GoLive dynamic actions anyone?

2003-02-10 Thread Brian Dunning
I have a GoLive dynamic content site, and its pages require than you 
include at the top a file called mysql.runtime6.php. All is well, 
except when I try to type in my own SQL actions that are intended to be 
totally separate from anything the GoLive stuff is doing, I get an 
error in mysql.runtime6.php saying that there's some invalid MySQL 
result resource.

Is there something special I need to do to run my own database stuff 
without that GoLive thing interfering?

- Brian


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



Re: [PHP] Delimited file values behaving strangely...

2003-02-10 Thread Guru Geek
When this happens to me I always just echo the variable value like so to
see if something is there that shouldn't be:

echo "";
echo "$id";
echo "";

obviously all this does is print the variable with a bunch of c's before
and after.  That way I can see if there are any extra things included with
the value that shouldn't be there.

Then use the trim() commands as someone else mentioned.

Roger

Geoff Caplan wrote:

> Hi folks,
>
> A strange one - unless I am having a brainstorm...
>
> I am reading in tab delimited files created in Excel on Windows and
> uploaded to Linux.
>
> Cell A1 contains a numeric id - I extract this into a variable, $id,
> by exploding on \n and \t.
>
> But for some files, the values of $id do not behave as expected. Say
> the value should be "23".
>
> If I echo, it prints as "23". But comparisons fail to match:
>
> if( $id == 23 ) ...
>
> It also fails if I try to find the value as a key in an
> array:
>
> if( isset( $my_array[$id] ) ) ...
>
> On the other hand, values from some of the files work as expected.
>
> One clue: if I try and cast the values that are failing to int, the
> cast produces the value 0 (zero). On the other hand, the values that
> are working as expected cast from, say, the string 22 to the int 22 as
> expected.
>
> Never seen anything like this before - can anyone give me a pointer??
>
> --
>
> Geoff Caplan
> Advantae Ltd
>
> --
> 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] Re: Why use XML?

2003-02-10 Thread Lee W
"Christian Calloway" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi,
>
> well Im out of a job so I am sitting around learning XML. It seems like a
> great tool, but I am trying to figure out why I would actually use it? All
> it does is seperate content and data, albeit on the client, but that is
what
> I have been doing with Smarty and MySQL for awhile now. Why would I choose
> to parse XML documents with PHP and do transformations on the server, it
> sounds terribly inefficient and complicated, as opposed to just pulling
data
> out of a database. I also realize that I can generate XML dynamically (ie
> include PHP code in an actual XML template) by editing my Apache config,
but
> that is not always an option and what would be the point? It would just
add
> another layer of content/data seperation that would have to processed on
the
> other end. Thanks
>
> Chris
>
>

Have a look at the following link:
http://www.w3schools.com/xml/default.asp

The section on "How XML Can be used" may provide the answers you need.

Regards

Lee



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




Re: [PHP] Delimited file values behaving strangely...

2003-02-10 Thread Jason Wong
On Tuesday 11 February 2003 00:15, Geoff Caplan wrote:
> Hi folks,
>
> A strange one - unless I am having a brainstorm...
>
> I am reading in tab delimited files created in Excel on Windows and
> uploaded to Linux.
>
> Cell A1 contains a numeric id - I extract this into a variable, $id,
> by exploding on \n and \t.
>
> But for some files, the values of $id do not behave as expected. Say
> the value should be "23".
>
> If I echo, it prints as "23". But comparisons fail to match:
>
> if( $id == 23 ) ...
>
> It also fails if I try to find the value as a key in an
> array:
>
> if( isset( $my_array[$id] ) ) ...
>
> On the other hand, values from some of the files work as expected.
>
> One clue: if I try and cast the values that are failing to int, the
> cast produces the value 0 (zero). On the other hand, the values that
> are working as expected cast from, say, the string 22 to the int 22 as
> expected.
>
> Never seen anything like this before - can anyone give me a pointer??

If in doubt print it out (TM). Use var_dump() on the values in question.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
It's better to burn out than to fade away.
*/


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




Re: [PHP] Delimited file values behaving strangely...

2003-02-10 Thread Lowell Allen
> From: Geoff Caplan <[EMAIL PROTECTED]>
> 
> Hi folks,
> 
> A strange one - unless I am having a brainstorm...
> 
> I am reading in tab delimited files created in Excel on Windows and
> uploaded to Linux.
> 
> Cell A1 contains a numeric id - I extract this into a variable, $id,
> by exploding on \n and \t.
> 
> But for some files, the values of $id do not behave as expected. Say
> the value should be "23".
> 
> If I echo, it prints as "23". But comparisons fail to match:
> 
> if( $id == 23 ) ...
> 
Try using trim() on the value to get rid of blank spaces, returns, and other
weirdness.

--
Lowell Allen


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




Re: [PHP] Delimited file values behaving strangely...

2003-02-10 Thread Leif K-Brooks
I'm guessing it containt a trailing space, which wouldn't display in 
HTML.  Try trim()ing it.

Geoff Caplan wrote:

Hi folks,

A strange one - unless I am having a brainstorm...

I am reading in tab delimited files created in Excel on Windows and
uploaded to Linux.

Cell A1 contains a numeric id - I extract this into a variable, $id,
by exploding on \n and \t.

But for some files, the values of $id do not behave as expected. Say
the value should be "23".

If I echo, it prints as "23". But comparisons fail to match:

if( $id == 23 ) ...

It also fails if I try to find the value as a key in an
array:

if( isset( $my_array[$id] ) ) ...

On the other hand, values from some of the files work as expected.

One clue: if I try and cast the values that are failing to int, the
cast produces the value 0 (zero). On the other hand, the values that
are working as expected cast from, say, the string 22 to the int 22 as
expected.

Never seen anything like this before - can anyone give me a pointer??

 


--
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] Delimited file values behaving strangely...

2003-02-10 Thread Geoff Caplan
Hi folks,

A strange one - unless I am having a brainstorm...

I am reading in tab delimited files created in Excel on Windows and
uploaded to Linux.

Cell A1 contains a numeric id - I extract this into a variable, $id,
by exploding on \n and \t.

But for some files, the values of $id do not behave as expected. Say
the value should be "23".

If I echo, it prints as "23". But comparisons fail to match:

if( $id == 23 ) ...

It also fails if I try to find the value as a key in an
array:

if( isset( $my_array[$id] ) ) ...

On the other hand, values from some of the files work as expected.

One clue: if I try and cast the values that are failing to int, the
cast produces the value 0 (zero). On the other hand, the values that
are working as expected cast from, say, the string 22 to the int 22 as
expected.

Never seen anything like this before - can anyone give me a pointer??

-- 

Geoff Caplan
Advantae Ltd


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




RE: [PHP] $_POST index issues

2003-02-10 Thread James G Puckett
This indeed was the problem.  Case closed.

Thanks for the help.

James G Puckett
ECG, Inc.
 

> -Original Message-
> From: Ernest E Vogelsinger [mailto:[EMAIL PROTECTED]]
> Sent: Monday, February 10, 2003 10:55 AM
> To: James G Puckett
> Cc: [EMAIL PROTECTED]
> Subject: Re: [PHP] $_POST index issues
> 
> At 16:47 10.02.2003, James G Puckett spoke out and said:
> [snip]
> >   echo "\n";
> >   $query = "select username, active, password, clec_id from
users
> >where USERNAME=\"$_POST['username_given']\"";
> [snip]
> 
> I'm not sure if this is the source of your problems, but when
referencing
> an array from within a string you should put it in curly quotes:
> 
> echo "\n";
> $query = "select username, active, password, clec_id from
users
> where USERNAME=\"{$_POST['username_given']}\"";
> 
> 
> --
>>O Ernest E. Vogelsinger
>(\) ICQ #13394035
> ^ http://www.vogelsinger.at/



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




Re: [PHP] $_POST index issues

2003-02-10 Thread Ernest E Vogelsinger
At 16:47 10.02.2003, James G Puckett spoke out and said:
[snip]
>   echo "\n";
>   $query = "select username, active, password, clec_id from users
>where USERNAME=\"$_POST['username_given']\"";
[snip] 

I'm not sure if this is the source of your problems, but when referencing
an array from within a string you should put it in curly quotes:

echo "\n";
$query = "select username, active, password, clec_id from users
where USERNAME=\"{$_POST['username_given']}\"";


-- 
   >O Ernest E. Vogelsinger 
   (\) ICQ #13394035 
^ http://www.vogelsinger.at/


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




Re: [PHP] WYSIWIG CMS Part1

2003-02-10 Thread Hardik Doshi
I think XML and XSLT are the alternative of Smarty
template engine. But i dont know how i can sepeatate
my code using XML and XSL style sheets? If anyone can
give me more information then it would be nice. 

I know how to write XSL style sheet along with XML
document. But i really dont know what contents should
be in XML. If XML contains data (and it is true) then
what is the need of MySQL? At last i can say i don't
know application of XML and XSL for seperating PHP and
HTML code.

Please Clear my doubts.

Hardik 


--- Sascha Braun <[EMAIL PROTECTED]> wrote:
> Mh, I don't really know, but I think smarty is even
> better,
> because XSL Stylesheets have to be translatet by an
> extra
> Server Engine, so everything can be translatet into
> HTML,
> so far as I know. So it is not possible to just work
> with an
> standard Apache unless you install an extra XML
> Module
> or special Apache Version on the Server.
> 
> Smarty can be used without installing some extra
> things, I
> think. But really don't know either, because I never
> used
> smarty before, just read a little about it ;)).
> 
> XML should maybe be used to store Configurationfiles
> and
> Database Content into static files for exchanging
> the Content
> with other Applikations like Quark Xpress or
> Indesign or
> maybe to share it with with Cellphones (Which there
> is no
> need to, because PHP is able to write XHTML).
> 
> I don't know if there is an XML/XSL Browser Around
> or
> how the Data could be shown, if I would know I would
> start to write all my Websites in XML, if this is
> possible.
> 
> Maybe someone knows a litte more and want to tell
> some
> about.
> 
> Have a nice day!
> 
> Sascha
> 
> 
> - Original Message -
> From: "Hardik Doshi" <[EMAIL PROTECTED]>
> To: "Sascha Braun" <[EMAIL PROTECTED]>; "PHP
> General list"
> <[EMAIL PROTECTED]>; "Aaron"
> <[EMAIL PROTECTED]>
> Sent: Monday, February 10, 2003 3:55 PM
> Subject: Re: [PHP] WYSIWIG CMS Part1
> 
> 
> > I have a same question in my mind about XML.
> >
> > I have another question in my mind too.
> >
> > If we are using smarty template engine in our
> > development then what is need of XML and XSLT for
> > presentation layer? I think XML and XSLT work is
> > automatically done in smarty template engine. Am i
> > right? Please correct me if i am wrong. Let me
> know
> > which one is good to use smarty engine or XML,XSLT
> for
> > seperating interface and php code?
> >
> > thanks
> >
> > Hardik
> >
> > --- Sascha Braun <[EMAIL PROTECTED]> wrote:
> > > I know how XML works and how a wellformed
> document
> > > may look
> > > like, but I must say, I really dont know why I
> > > should use XML as long
> > > I store everything in a Database.
> > >
> > > I've read about all good CMS Systems use XML as
> a
> > > musthave, but I
> > > don't understand why.
> > >
> > > Would be nice, if you would explain me which
> data I
> > > should store in
> > > XML and why.
> > > Maybe its usefull together with big Customer
> > > Management Systems,
> > > or do you have other Ideas?
> > >
> > > Please discuss a little about it with me, I
> would
> > > find it very interesting
> > > :))
> > >
> > > CYA
> > >
> > > Sascha
> > >
> > > - Original Message -
> > > From: "Aaron" <[EMAIL PROTECTED]>
> > > To: "Sascha Braun" <[EMAIL PROTECTED]>
> > > Sent: Sunday, February 09, 2003 11:43 PM
> > > Subject: Re: [PHP] WYSIWIG CMS Part1
> > >
> > >
> > > > look into using XML if you havent already.
> > > >
> > > >
> > > > Sascha Braun wrote:
> > > >
> > > > >Ok,
> > > > >
> > > > >overspoken. I'm going to write my basic CMS
> > > Concept here, and let us see
> > > > >what happens then. My Multilanguage Frontend
> > > Engine has even finished,
> > > > >but still needs a nice Admin Frontend to do
> the
> > > translation of the
> > > Frontend.
> > > > >
> > > > >Ok, lets start. Later I will tell some about
> the
> > > things which I could not
> > > really
> > > > >understand yet, maybe somebody is able to
> help.
> > > > >
> > > > >Tasks of the CMS (I called it freecon, dont
> know
> > > if there is something
> > > similar):
> > > > >
> > > > >1. Template Engine
> > > > >2. Design Management
> > > > >3. Article Management
> > > > >4. Content Management
> > > > >5. User Management
> > > > >6. Customer Management
> > > > >7. Message Management
> > > > >
> > > > >1. The "Template Engine" should help
> developers
> > > to easy build Websites
> > > based
> > > > >on the CMS. The only Thing the Developer has
> to
> > > do, is to develop an
> > > static
> > > > >HTML Webpage Design and replace all the
> Visitor
> > > viewable and Admin
> > > viewable
> > > > >textparts with special "CMS Based Tags". As
> there
> > > is possibility to write
> > > parts
> > > > >of the CMS as Modules, it would be very nice
> if
> > > fx. the customer login
> > > could
> > > > >consist of a small code sniped and a border
> > > (Table and Images fx.) so the
> > > > >developer can easely change the design of the
> > > page, probabl

Re: [PHP] any windows php developers out here?

2003-02-10 Thread Sascha Braun
http://php.e-novative.de/ephp.php

Just look at this link, you will find a windows installer there,
it installs Apache, PHP, MySQL and phpMyAdmin just
from scratch, without you to know what you do ;)))

Sascha

- Original Message - 
From: "Victor" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, February 09, 2003 12:13 AM
Subject: [PHP] any windows php developers out here?


> Hello, I am wondering if any of you got a reliable php and MySQL
> installation (MySQL is easy) I am mostly wondering if there is a point
> in tying to use windows as a development platform for PHP. I have a nice
> and working red hat 8.0 installation, but I did an upgrade from 7.3 and
> now apache doesn't work cuz it wants me to switch form apache 1.X to 2.X
> and all I want is to erase the old apache and use the new one or erase
> the new one and use the old one, whichever works. But anyway... I also
> do design and I have people submit me illustrator and Photoshop files
> and word docs, so for now I might have to stick to windows for work. BUT
> what do u suggest? I it futile to try to get php to work in windows?
> With IIS preferably so that I can play with ASP and Cold Fusion once in
> a while. Please help if you are using windows with php and send me some
> instructions if you feel like it, much appreciated.
> 
> - Vic
> 
> __ 
> Post your free ad now! http://personals.yahoo.ca
> 
> -- 
> 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] $_POST index issues

2003-02-10 Thread James G Puckett


I have run into a problem with some of my code surrounding $_POST.


Below are excepts:

Sending PHP script (login.php)


Username

Password




Receiving script (verify_login.php)


foreach ($_POST as $key => $value ) {
echo "\n";
}

$db_connection = odbc_connect( $GLOBALS["db_dsn"],
$GLOBALS["db_username"], $GLOBALS["db_password"] );
echo "\n";
$query = "select username, active, password, clec_id from users
where USERNAME=\"$_POST['username_given']\"";


I get the following errors:

PHP Notice:  Undefined index:  'username_given' in
/var/www/e911.e-c-group.com/verify_login.php on line 19
PHP Notice:  Undefined index:  'username_given' in
/var/www/e911.e-c-group.com/verify_login.php on line 21

However, the for loop above produces the following output.





Any ideas what I am doing wrong?

James G Puckett
ECG, Inc.
 



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




[PHP] Why use XML?

2003-02-10 Thread Christian Calloway
Hi,

well Im out of a job so I am sitting around learning XML. It seems like a
great tool, but I am trying to figure out why I would actually use it? All
it does is seperate content and data, albeit on the client, but that is what
I have been doing with Smarty and MySQL for awhile now. Why would I choose
to parse XML documents with PHP and do transformations on the server, it
sounds terribly inefficient and complicated, as opposed to just pulling data
out of a database. I also realize that I can generate XML dynamically (ie
include PHP code in an actual XML template) by editing my Apache config, but
that is not always an option and what would be the point? It would just add
another layer of content/data seperation that would have to processed on the
other end. Thanks

Chris



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




Re: [PHP] Php 4.3

2003-02-10 Thread Francesco Leonetti
edit the php.ini file changing

register_globals = On

then restart httpd.

When register_globals is set to "Off" you cannot access post or get
variables in the usual way but you need to address the $_GET, $_POST array
(or the general $_REQUEST).

More details on the manual...


- Original Message -
From: "Todd Barr" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, February 10, 2003 7:39 PM
Subject: [PHP] Php 4.3


Hello,

I am having issues after I upgraded from 4.0.5 to 4.3

Alot of my link pages were based in www.something.com/phptest.php?foo=9323

Now that I have upgraded, I get foo errors.

It says that it no longer gets the foo value...

how can I fix this?

THanks

-T



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




[PHP] $_SESSION['user']['nickname'] = "Herbert"

2003-02-10 Thread Sascha Braun
Hi is something wrong with the above show argument?

Under Windows everything works fine under linux it just
shows me an 0 or 1, maybe for true or false, dont know.

Please help me, what did i do wrong???

Sascha

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




[PHP] Session Time

2003-02-10 Thread Stephen Craton
Got a quick and easy question that I'm not sure about. What I need to do is
calculate how long someone has been in a chatroom, then update a members
table to add some "money" to their account. Something like this:

For every hour they're in the chatroom: 5 cents

Thanks,
Stephen Craton
http://www.melchior.us



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




Re: [PHP] Php 4.3

2003-02-10 Thread bbonkosk
Check the archives about global variables in the php.ini file

> Hello,
> 
> I am having issues after I upgraded from 4.0.5 to 4.3
> 
> Alot of my link pages were based in
> www.something.com/phptest.php?foo=9323
> 
> Now that I have upgraded, I get foo errors.
> 
> It says that it no longer gets the foo value...
> 
> how can I fix this?
> 
> THanks
> 
> -T
> 






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




Re: [PHP] Shopping Cart

2003-02-10 Thread Sascha Braun
Shopping Carts are pretty easy to write.

Just make a new table in your mysql DB and
then write a session_id together with the sku
and name, color, size, quantity and maybe
customer_id into the the new shoppingcart table.

When you want to show the shopping carts
content just do an select from the carts table.

As I save the prices into an extra table I do a
SELECT * FROM basket, price, item
WHERE basket.sku = item.sku
AND item.price = price.key

Later i use a price.q1 field and multiply it with
the quantity of the item to get the full price.

Hope this helps you a little.

Sascha

- Original Message -
From: "Chris Cook" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, February 09, 2003 10:35 PM
Subject: [PHP] Shopping Cart


> Hello everybody,
>
> I am interested in designing a site with a shopping cart. I have several
> years of programming experience in php and perl, but I have never made a
> shopping cart.
>
> I was looking into some of the already made shopping carts and was
wondering
> what peoples' experiences have been with already made shopping carts.
> Ultimately, I am wondering whether I should code it from scratch or not.
>
> Thanks in advance for any help,
> Chris
>
>
> _
> STOP MORE SPAM with the new MSN 8 and get 2 months FREE*
> http://join.msn.com/?page=features/junkmail
>
>
> --
> 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] Php 4.3

2003-02-10 Thread Todd Barr
Hello,

I am having issues after I upgraded from 4.0.5 to 4.3

Alot of my link pages were based in www.something.com/phptest.php?foo=9323

Now that I have upgraded, I get foo errors.

It says that it no longer gets the foo value...

how can I fix this?

THanks

-T



[PHP] Code

2003-02-10 Thread Joe Njeru
Hi,

This is the code that creates the file

function writeln_to_file($str_txt)
/*
Definition:
   This function writes/appends $str_txt to the file
Parameters:
   $str_txt; String; The String to be written to file
ReturnType:
   NONE;
*/
{
 if (!file_exists($this->ao_file_name))  // if the file exists
 {
$this->create_file();
$this->writeln_to_file($str_txt);
 }
 else
 {
 $str_txt .= "\r\n";
 $this->ao_file_handle = fopen($this->ao_file_name,"ab");
 fwrite($this->ao_file_handle,$str_txt);
 }
}



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




Re: [PHP] WYSIWIG CMS Part1

2003-02-10 Thread Sascha Braun
Mh, I don't really know, but I think smarty is even better,
because XSL Stylesheets have to be translatet by an extra
Server Engine, so everything can be translatet into HTML,
so far as I know. So it is not possible to just work with an
standard Apache unless you install an extra XML Module
or special Apache Version on the Server.

Smarty can be used without installing some extra things, I
think. But really don't know either, because I never used
smarty before, just read a little about it ;)).

XML should maybe be used to store Configurationfiles and
Database Content into static files for exchanging the Content
with other Applikations like Quark Xpress or Indesign or
maybe to share it with with Cellphones (Which there is no
need to, because PHP is able to write XHTML).

I don't know if there is an XML/XSL Browser Around or
how the Data could be shown, if I would know I would
start to write all my Websites in XML, if this is possible.

Maybe someone knows a litte more and want to tell some
about.

Have a nice day!

Sascha


- Original Message -
From: "Hardik Doshi" <[EMAIL PROTECTED]>
To: "Sascha Braun" <[EMAIL PROTECTED]>; "PHP General list"
<[EMAIL PROTECTED]>; "Aaron" <[EMAIL PROTECTED]>
Sent: Monday, February 10, 2003 3:55 PM
Subject: Re: [PHP] WYSIWIG CMS Part1


> I have a same question in my mind about XML.
>
> I have another question in my mind too.
>
> If we are using smarty template engine in our
> development then what is need of XML and XSLT for
> presentation layer? I think XML and XSLT work is
> automatically done in smarty template engine. Am i
> right? Please correct me if i am wrong. Let me know
> which one is good to use smarty engine or XML,XSLT for
> seperating interface and php code?
>
> thanks
>
> Hardik
>
> --- Sascha Braun <[EMAIL PROTECTED]> wrote:
> > I know how XML works and how a wellformed document
> > may look
> > like, but I must say, I really dont know why I
> > should use XML as long
> > I store everything in a Database.
> >
> > I've read about all good CMS Systems use XML as a
> > musthave, but I
> > don't understand why.
> >
> > Would be nice, if you would explain me which data I
> > should store in
> > XML and why.
> > Maybe its usefull together with big Customer
> > Management Systems,
> > or do you have other Ideas?
> >
> > Please discuss a little about it with me, I would
> > find it very interesting
> > :))
> >
> > CYA
> >
> > Sascha
> >
> > - Original Message -
> > From: "Aaron" <[EMAIL PROTECTED]>
> > To: "Sascha Braun" <[EMAIL PROTECTED]>
> > Sent: Sunday, February 09, 2003 11:43 PM
> > Subject: Re: [PHP] WYSIWIG CMS Part1
> >
> >
> > > look into using XML if you havent already.
> > >
> > >
> > > Sascha Braun wrote:
> > >
> > > >Ok,
> > > >
> > > >overspoken. I'm going to write my basic CMS
> > Concept here, and let us see
> > > >what happens then. My Multilanguage Frontend
> > Engine has even finished,
> > > >but still needs a nice Admin Frontend to do the
> > translation of the
> > Frontend.
> > > >
> > > >Ok, lets start. Later I will tell some about the
> > things which I could not
> > really
> > > >understand yet, maybe somebody is able to help.
> > > >
> > > >Tasks of the CMS (I called it freecon, dont know
> > if there is something
> > similar):
> > > >
> > > >1. Template Engine
> > > >2. Design Management
> > > >3. Article Management
> > > >4. Content Management
> > > >5. User Management
> > > >6. Customer Management
> > > >7. Message Management
> > > >
> > > >1. The "Template Engine" should help developers
> > to easy build Websites
> > based
> > > >on the CMS. The only Thing the Developer has to
> > do, is to develop an
> > static
> > > >HTML Webpage Design and replace all the Visitor
> > viewable and Admin
> > viewable
> > > >textparts with special "CMS Based Tags". As there
> > is possibility to write
> > parts
> > > >of the CMS as Modules, it would be very nice if
> > fx. the customer login
> > could
> > > >consist of a small code sniped and a border
> > (Table and Images fx.) so the
> > > >developer can easely change the design of the
> > page, probably with the
> > "Design
> > > >Management".
> > > >
> > > >2. The Design Management is part of the
> > Administration Kit for the CMS.
> > With
> > > >this tool you should be able to change the Design
> > of the Templates and if
> > you
> > > >used the "CMS Based Tags" you should be able to
> > upload new parts of the
> > > >homepage design and change the hole page look,
> > with a few mouseclicks.
> > > >So there has be an Design Table in the Database
> > or an configuration file,
> > > >where all the Imageparts are stored and together
> > build the page look and
> > > >feel. The CSS Stylesheet should the be changeable
> > to a lot of forms, seen
> > > >in phpbb or other nice templated website tools.
> > > >
> > > >3. The Article Management should be part of the
> > Admin Interface where you
> > > >can deside, of which parts an article should be
> > consist. Fx. an Article
> > could
> > > 

Re: [PHP] PHP Script Encryption!!!!

2003-02-10 Thread Adam Voigt




Just incase you meant encrypt your php scripts and not encrypt with

your php scripts, check out:



http://www.ioncube.com/



Not free, but very cheap (they have a online encoder that charges

by the amount of code, a simple app is less then $5.00).



On Mon, 2003-02-10 at 10:04, Jason Sheets wrote:

Hello Pankaj,



With PHP you use libmcrypt and the PHP mcrypt functions to do

encryption.  Basically you need to install libmcrypt (you do not need

mcrypt, just libmcrypt) and then add --with-mcrypt=/path/to/install

(this is usually /usr/local) to your PHP configuration line.  You can

check to see if mcrypt support is already compiled into your PHP by

doing a phpinfo(): and looking for --with-mcrypt on the configure line

and an mcrypt section.



I've written a PHP Class the simplifies using mcrypt functions, its

called crypt class and is available on Freshmeat.net at:

http://freshmeat.net/projects/cryptclass/?topic_id=90



You do not need that script to do encryption with PHP but I've found for

me it makes many things easier. 



Take a look at the PHP manual at http://www.php.net/mcrypt as well, it

has examples of using mcrypt and a lot of good user contributed notes.



Jason

On Mon, 2003-02-10 at 07:20, Pankaj Naug wrote:

> hiii!!

> 

> 1.  can anyone help me out with php script encryption.. are there 

> any freeware which i can use to encrypt my php scripts.

> 

> 

> 2. have anybody has any ready made code which take's a directory 

> path and uses linux shell command to execute them???  actually i 

> want to use a shell command which takes a file name as input.. i 

> want to use the shell command for the whole directory.. thats it

> 

> get back to me as soon as possible

> 

> 

> 

> 

> -- 

> 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






-- 
Adam Voigt ([EMAIL PROTECTED])
The Cryptocomm Group
My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc








signature.asc
Description: This is a digitally signed message part


  1   2   >