[PHP] Session Variables Not Being Passed

2002-12-01 Thread Jami
The code that I have is as such:

//header.php
if(isset($_POST['login'])){
  $checkuser = mysql_query(SELECT * FROM mainacct WHERE username = 
'{$_POST['username']}' AND password = '{$_POST['password']}' , $connection) or die 
(Couldn't find user.);
  if (mysql_num_rows($checkuser)  0){
   while ($row = mysql_fetch_array($checkuser)){
$_SESSION['UN'] = $row['username'];
$_SESSION['UserLoggedIn'] = True;
   } 
  } else {
  header(Location:login.php);
   exit;
  }
}

This file is then used as an include in main.php. As long as the variables are used 
ONLY in the header.php file, it works. But when I try to call the session variables in 
main.php, it doesn't show the values of UN or UserLoggedIn. session_start() is called 
in main.php. Is this a quirk with sessions, or is there something more I am supposed 
to be doing? Running Apache 2 w/PHP 4.2.3 on WindowsXP.

Jami



Re: [PHP] Test links?

2002-12-01 Thread Jason Wong
On Sunday 01 December 2002 15:33, Hugh Danaher wrote:
 Not sure how to supress the warning message that PHP automatically does
 when you haven't got a valid URL though.

Error reporting options can be set in php.ini or by using ini_set().

 should be able to surpress errors by adding an * before the result variable

 *$fp = fopen($linkdata['linkurl'],r);

I think you mean '@':

  $fp = @fopen($linkdata['linkurl'],r);

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *

/*
Blessed is he who expects no gratitude, for he shall not be disappointed.
-- W.C. Bennett
*/


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




[PHP] Guestbook

2002-12-01 Thread Vicky
Hiya ^_^

I have a guestbook I coded myself using PHP. In the corner it keeps record
of the entry number, but when I delete and entry the entries posted after it
don't go back to catch up. So the entry numbers skip from 22 to 24, for
example.

Is there anyway to stop this happening, so if i delete an entry the next one
will follow on instead of being the number it would have been if i hadn't
deleted the entry?

Thanks ^_^


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




Re: [PHP] login_script_help needed.

2002-12-01 Thread Andrew Brampton
Well quickly looking at the code I can't see what line is causing the
Warning: Cannot add header information
but there have been many discussion explaining why this happens... as for
your
Unknown MySQL Server Host '$198.63.221.3'
the error for that is on the line:
if(!($link_id = mysql_connect($198.63.221.3, $Ultimatefootball,
$kjames1973))) die(mysql_erorr());
I think the line would look better like:
$link_id = mysql_connect('198.63.221.3', 'Ultimatefootball', 'kjames1973')
or die(mysql_erorr());

(might be a good idea to change your password now btw (since you have shown
everyone))

Hope that gets you started
Andrew
- Original Message -
From: Karl James [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Sunday, December 01, 2002 4:46 AM
Subject: [PHP] login_script_help needed.


 http://www.ultimatefootballleague.com/Create_Account.phps

 hey people

 I was wondering if anyone can tell me why I cant get this script to
 work.

 Or do you have an easier one I can use..

 Thanks
 Karl



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




[PHP] Re: Guestbook

2002-12-01 Thread Thomas Seifert
Hi,

you give less information.
How do you compute the entry number and how do you save the entries and so on.
Normally you will have to live with the gaps but sure, you can touch every entry
and change its number ;-).


Thomas

On Sun, 1 Dec 2002 10:33:45 - [EMAIL PROTECTED] (Vicky) wrote:

 Hiya ^_^
 
 I have a guestbook I coded myself using PHP. In the corner it keeps record
 of the entry number, but when I delete and entry the entries posted after it
 don't go back to catch up. So the entry numbers skip from 22 to 24, for
 example.
 
 Is there anyway to stop this happening, so if i delete an entry the next one
 will follow on instead of being the number it would have been if i hadn't
 deleted the entry?
 
 Thanks ^_^
 

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




Re: [PHP] Guestbook

2002-12-01 Thread Jason Wong
On Sunday 01 December 2002 18:33, Vicky wrote:
 Hiya ^_^

 I have a guestbook I coded myself using PHP. In the corner it keeps record
 of the entry number, but when I delete and entry the entries posted after
 it don't go back to catch up. So the entry numbers skip from 22 to 24, for
 example.

You're probably using some kind of 'autoincrement' field for your entry 
number. 

 Is there anyway to stop this happening, so if i delete an entry the next
 one will follow on instead of being the number it would have been if i
 hadn't deleted the entry?

The short answer is if you want that kind of behaviour then you shouldn't be 
using an autoincrement field.

The quick solution, if you intend to continue the autoincrement field, is to 
number the entries manually when you're displaying them: Something along the 
lines of:

  $count = 0;
  while ($row(mysql_fetch_array($result_id))) {
$count++;
echo Entry $count;
...
...
  }

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *

/*
If bankers can count, how come they have eight windows and only four tellers?
*/


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




[PHP] Re: Guestbook

2002-12-01 Thread sfasf saff
in mysql the autoincrement field will not go back to
fill gaps...

and this is for a good reason ...

suppose you had an entry (bogus1) in your guest book
with entry number 23 and you deleted it...

now a new entry comes and it is given the entry number
23 ... well this ambigus : did u delete the original
one or modified it ? also people pointing to that
particular entry in their sites will be confused by
the change... where as in the real life we usuallay
offer a record does not exist type of message ...

got it ?!
--- Thomas Seifert [EMAIL PROTECTED] wrote:
 Hi,
 
 you give less information.
 How do you compute the entry number and how do you
 save the entries and so on.
 Normally you will have to live with the gaps but
 sure, you can touch every entry
 and change its number ;-).
 
 
 Thomas
 
 On Sun, 1 Dec 2002 10:33:45 -
 [EMAIL PROTECTED] (Vicky) wrote:
 
  Hiya ^_^
  
  I have a guestbook I coded myself using PHP. In
 the corner it keeps record
  of the entry number, but when I delete and entry
 the entries posted after it
  don't go back to catch up. So the entry numbers
 skip from 22 to 24, for
  example.
  
  Is there anyway to stop this happening, so if i
 delete an entry the next one
  will follow on instead of being the number it
 would have been if i hadn't
  deleted the entry?
  
  Thanks ^_^
  
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 


=
+--+
|Wana Know what ISLAM is all about ? |
+--+

visit :   http://www.sultan.org/#int

__
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




[PHP] Inheritance problem

2002-12-01 Thread Bernard Chamberland
Hi,

I would like to post the following question related to an inheritance 
problem with PHP OO programming : 

With an object of a subclass, I call a method of the parentclass in order 
to modify an attribute of the parentclass. It does work correctly but later 
when I call the display method of the parentclass, I receive the previous 
value of the attribute !!!

The code below shows the problem :
The parentclass is Ressource
The subclass is Water
The attribute of the parentclass is $volume
The method to update $volume is increase
The method to display the parentclass is display

An explanation and a trick to fix the problem would be greatly appreciated.

Thanks !

Bernard


?php

define('_MAXX', 10);
define('_MAXY', 10);
define('_MAXENERGY', 20);
define('_MAXRESERVEWATER', 20);
define('_MAXVOLUMEWATER', 10);
define('_MAXVOLUMEPLANT', 10);

class Jungle
{
var $jungleobjects; // composition relation = array of $Jungleobject

function Jungle()
{
// Create eaux
for ($i=1; $i=2; $i++) { //
$this-jungleobjects[] = new Water($posx = mt_rand(1, _MAXX),
   $posy = mt_rand(1, _MAXY),
   $volume = mt_rand(1, 
_MAXVOLUMEWATER));
}
// Create plantes
for ($i=1; $i=1; $i++) { //
$this-jungleobjects[] = new Plant($posx = mt_rand(1, _MAXX),
   $posy = mt_rand(1, _MAXY),
   $volume = mt_rand(1, 
_MAXVOLUMEPLANT));
}

}

function display()
{
foreach ($this-jungleobjects as $jungleobject) {
$jungleobject-display();
}
}

function receiverain($density)
{
foreach ($this-jungleobjects as $jungleobject) {
$jungleobject-receiverain($density);
}
}


} // Jungle

class Jungleobject
{
var $posx;
var $posy;

function Jungleobject($posx, $posy)
{
$this-posx = $posx;
$this-posy = $posy;
}

function display()
{
echo br;
echo Class : .get_class($this).br;
echo Posx : .$this-posx.br;
echo Posy : .$this-posy.br;
}

function receiverain($density) // Abstract method : should be defined 
at sub-class level (not mandatory)
{
echo Class : .get_class($this). Nothing to do with rain.br;
}

function evoluer() {} // Abstract method : should be defined at 
sub-class level (not mandatory)

} // Jungleobject

class Ressource extends Jungleobject
{
var $volume;

function Ressource($posx, $posy, $size)
{
$this-Jungleobject($posx, $posy);
$this-volume = $size;
}

function increase($quantity)
{
echo Class : .get_class($this). method : increase 
($quantity).br;
echo Actual volume : $this-volume.br;
$this-volume += $quantity;
echo New volume : $this-volume.br;
}

function display()
{
jungleobject::display();
echo Volume (Ressource) : $this-volume.br;
}

} // Ressource

class Plant extends Ressource
{
function Plant($posx, $posy, $volume)
{
//$this-Ressource($posx, $posy, $volume);
Ressource::Ressource($posx, $posy, $volume);
}

} // Plant

class Water extends Ressource
{
function Water($posx, $posy, $volume)
{
$this-Ressource($posx, $posy, $volume);
}

function receiverain($density)
{
echo br;
echo Class : .get_class($this). Welcome the rain ($density) 
!.br;
$this-increase($density);
//Ressource::increase($density);
}

} // Water


class Rain
{
var $jungle;

function Rain($jungle)
{
$this-jungle = $jungle;
}

function fall($density)
{
$this-jungle-receiverain($density);
}


} // Rain

// Main

$myjungle = new Jungle();
$myrain = new Rain($myjungle);

$myjungle-display();
$myrain-fall(10);
$myjungle-display();


?




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




Re: [PHP] Inheritance problem

2002-12-01 Thread Tom Rogers
Hi,

Sunday, December 1, 2002, 10:05:53 PM, you wrote:
BC Hi,

BC I would like to post the following question related to an inheritance 
BC problem with PHP OO programming : 

BC With an object of a subclass, I call a method of the parentclass in order 
BC to modify an attribute of the parentclass. It does work correctly but later 
BC when I call the display method of the parentclass, I receive the previous 
BC value of the attribute !!!

Try this:

class Rain
{
var $jungle;

function Rain($jungle) //
{
$this-jungle = $jungle; //
}

function fall($density)
{
$this-jungle-receiverain($density);
}


} // Rain




-- 
regards,
Tom


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




[PHP] anyone askin for Page Breaks .... !

2002-12-01 Thread phpnew_bocket
there was a post here asking about creating page
breaks...

well ..

this page might be of great help :

http://www.west-wind.com/wckb/creatingpagebreaksinhtmldocuments.htm

=
+--+
|Wana Know what ISLAM is all about ? |
+--+

visit :   http://www.sultan.org/#int

__
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




php-general Digest 1 Dec 2002 13:25:08 -0000 Issue 1737

2002-12-01 Thread php-general-digest-help

php-general Digest 1 Dec 2002 13:25:08 - Issue 1737

Topics (messages 126581 through 126598):

Re: last updated ?
126581 by: Morgan Hughes

Re: Read Files
126582 by: Chris Wesley

login_script_help needed.
126583 by: Karl James
126585 by: Maxim Maletsky
126592 by: Andrew Brampton

Re: Page break
126584 by: Justin French

Re: Redirect opening in a new window
126586 by: Maxim Maletsky

Problem importing LARGE text file.
126587 by: CDitty

Re: Test links?
126588 by: Hugh Danaher
126590 by: Jason Wong

Session Variables Not Being Passed
126589 by: Jami

Guestbook
126591 by: Vicky
126593 by: Thomas Seifert
126594 by: Jason Wong
126595 by: sfasf saff

Inheritance problem
126596 by: Bernard Chamberland
126597 by: Tom Rogers

anyone askin for Page Breaks  !
126598 by: sfasf saff

Administrivia:

To subscribe to the digest, e-mail:
[EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]

To post to the list, e-mail:
[EMAIL PROTECTED]


--

---BeginMessage---
 Dumb question here but whats the general practice regarding putting a
 website last updated: entry on a web page? Does the web master manually
 enter in today's date in a database table entry and let PHP display. Is it
 statically added to the HTML page? Etc...
 If you want website last updated then from a database sounds OK but
 where I'm working its commonly a page last updated wanted. In this
 case its just a manually entered date in html in the page.

  Or use stat() to get the page's mtime, something like

  ?
$stat = stat($HTTP_SERVER_VARS['SCRIPT_FILENAME']);
$date = strftime(%c, $stat[9]);
print Last update: $date;
  ?

  Which will be automatically updated...

-- 
   Morgan Hughes
   C programmer and highly caffeinated mammal.
   [EMAIL PROTECTED]
   ICQ: 79293356



---End Message---
---BeginMessage---
On Sat, 30 Nov 2002, Randum Ian wrote:

 Ministry is the name of the club.
 Full is the type of the content.
 6122002 is the date - It is in the form ddmm so the example here is
 6th December 2002.
 Is there a simple way I can just grab the date and sort it by order?
 Should I change the format of the date to make it easier or something?

It'd be easier to sort if you changed your date format a bit ... what you
have is rather difficult to work with, unless you take the string apart.
(i.e. - How is '7102002' not greater than '6122002'?)
For simplicity  ease, I work with date strings formatted as MMDD.
If your files were named something-full-MMDD, you could get a sorted
array of your files easily.

$interestingFiles = array();
$dir = opendir( /path/to/directory ) or die( Could not open dir );
while( $dirEntry = readdir( $dir ) ){
  if( ereg( full-([0-9]{8}), $dirEntry, $MATCH ) ){
   $interestingFiles[$MATCH[1]] = $dirEntry;
  }
}
ksort( $interestingFiles );

g.luck,
~Chris


---End Message---
---BeginMessage---
http://www.ultimatefootballleague.com/Create_Account.phps
 
hey people
 
I was wondering if anyone can tell me why I cant get this script to
work.
 
Or do you have an easier one I can use..
 
Thanks
Karl

---End Message---
---BeginMessage---

what is on your line 22?

-- 
Maxim Maletsky
[EMAIL PROTECTED]


On Sat, 30 Nov 2002 20:46:12 -0800 Karl James [EMAIL PROTECTED] wrote:

 http://www.ultimatefootballleague.com/Create_Account.phps
  
 hey people
  
 I was wondering if anyone can tell me why I cant get this script to
 work.
  
 Or do you have an easier one I can use..
  
 Thanks
 Karl


---End Message---
---BeginMessage---
Well quickly looking at the code I can't see what line is causing the
Warning: Cannot add header information
but there have been many discussion explaining why this happens... as for
your
Unknown MySQL Server Host '$198.63.221.3'
the error for that is on the line:
if(!($link_id = mysql_connect($198.63.221.3, $Ultimatefootball,
$kjames1973))) die(mysql_erorr());
I think the line would look better like:
$link_id = mysql_connect('198.63.221.3', 'Ultimatefootball', 'kjames1973')
or die(mysql_erorr());

(might be a good idea to change your password now btw (since you have shown
everyone))

Hope that gets you started
Andrew
- Original Message -
From: Karl James [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Sunday, December 01, 2002 4:46 AM
Subject: [PHP] login_script_help needed.


 http://www.ultimatefootballleague.com/Create_Account.phps

 hey people

 I was wondering if anyone can tell me why I cant get this script to
 work.

 Or do you have an easier one I can use..

 Thanks
 Karl



---End Message---
---BeginMessage---
This is totally not PHP related.  There is a page-break: before; (or
similar) in CSS, so I suggest you go look around some CSS sites... like the
W3.org.

Justin


Re: [PHP] Inheritance problem

2002-12-01 Thread Ernest E Vogelsinger
At 13:05 01.12.2002, Bernard Chamberland said:
[snip]
Hi,
[snip] 

[...omitting long code post...]

Bernard,

couple of things:
a) Class Ressource uses instance data ($this-) in the constructor. You
shouldn't call this as a static method (see derived class Plant).

b) Class Plant: use the commented-out method in the constructor to access
the ressource's instance data. You should get an error otherwise ($this is
not defined for Ressource::Ressource).

c) Now to your original question: your problem is the class constructor for
Rain which receives a COPY of $jungle, not a HANDLE (PHP-speak: not a
REFERENCE) to the jungle object. You should code your Rain constructor like
this:
function Rain($jungle) {
$this-jungle = $jungle);
}

This should give you the correct results as far as I can see. If you miss
out passing a REFERENCE instead of a VARIABLE (which would be a COPY of the
jungle object), rain falls in the copied jungle, and your original jungle
remains dry.

Hope this gets you started. As a rule of thumb, always pass REFERENCES when
you're dealing with object handles.

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




[PHP] XTemplate

2002-12-01 Thread Henry
Hi All,

I'm looking for a way to seperate my HTML from my PHP and database access
code, I pointed in the direction of XTemplate. After having had a look at
XTemplate I'm not sure if it is current and stable under PHP 4 Is it and
if it isn't is there something better to use?

Henry




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




[PHP] Weblogs

2002-12-01 Thread Randum Ian
Can anybody recommend a good PHP weblog script?
 
Cheers in advance,
Randum Ian
[EMAIL PROTECTED]
DJ / Reviewer / Webmaster, DancePortal (UK) Limited 
DancePortal.co.uk - Global dance music media
 



Re: [PHP] Going Mad

2002-12-01 Thread Andy
OK, so I have located the httpd.config file but still no joy, I know it is
something very simple and silly.
I will explain in detail what I have done, I think this will give a better
idea of where I am going wrong.

Loaded Apache from the CD first in its default location c:/program
files/apachegroup/apache/htdocs.
Then loaded MySQL which as far as I can tell is OK.  Then I loaded PHP and
was told to configure the httpd file
Then in start/programs/apache it gave me the config file to edit, this i did
with the following as instructed in the book:
I found the ScriptAlias which gave a path to the apache folder and replaced
it with ScriptAlias /php/ c:/php/
Then i added Action application/x-httpd-php /php/php.exe under the Action
section followed by AddType application/xhttpd-php .php under the AddType
section.

According to the book i would now be ready to go!

I was then told to write the following code in my webspace, so i used
Dreamweaver MX, then tried Notepad:
html etc etc bodypThis is a HTML line /p
?php echo This is a PHP line; phpinfo(); ?
/body
I save the file and go to view it in Explorer but i see just the html text
not the php?
Now from what i can see everything looks ok other than that, when i run the
test on apache it says that the syntax is ok so i assume that it is set
correctly.
Now what i cannot understand is, am i saving the php files in the right
place (if there is one?) and should i be running the browser as localhost
which see's the apache page ok when i type http://localhost/ into the
address bar.
One other thing, i tried typing localhost/where the file is located on my
harddrive/ and was given a forbidden page contact administrator??

Is there something here that standsout?

Thank you for trying to help.

Andy

Chris Hewitt [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Phil Driscoll wrote:

 There's your problem.
 Assuming you haven't messed about too much with the apache config, your
php
 file needs to live inside apache's htdocs directory. Can't remember
exactly
 where that would be on a windows box - something like c:/program
files/apache
 group/apache/htdocs maybe.
 
 Yes, Phil has it. I'd assumed this, I should not have. The directory is
 given by the DocumentRoot line in httpd.conf. You did not say exectly
 what error you were getting, I'd assumed that you were just seeing the
 source of your file and that the only problem was php not parsing it.
 Presumably you were getting Document not found errors?

 Chris





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




Re: [PHP] Weblogs

2002-12-01 Thread Marco Tabini
b2, which you can find here:

http://cafelog.com/

Cheers,


Marco
-- 

php|architect - The magazine for PHP Professionals
The monthly worldwide magazine dedicated to PHP programmers

Come visit us at http://www.phparch.com!

On Sun, 2002-12-01 at 09:35, Randum Ian wrote:
 Can anybody recommend a good PHP weblog script?
  
 Cheers in advance,
 Randum Ian
 [EMAIL PROTECTED]
 DJ / Reviewer / Webmaster, DancePortal (UK) Limited 
 DancePortal.co.uk - Global dance music media
  



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




RE: [PHP] XTemplate

2002-12-01 Thread John W. Holmes
 I'm looking for a way to seperate my HTML from my PHP and database
access
 code, I pointed in the direction of XTemplate. After having had a look
at
 XTemplate I'm not sure if it is current and stable under PHP 4 Is
it
 and
 if it isn't is there something better to use?

I don't know how current XTemplate is, but Smarty is one of the most
popular template engines. 

http://smarty.php.net

---John Holmes...



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




RE: [PHP] Session Variables Not Being Passed

2002-12-01 Thread John W. Holmes


 -Original Message-
 From: Jami [mailto:[EMAIL PROTECTED]]
 Sent: Sunday, December 01, 2002 3:53 AM
 To: PHP General
 Subject: [PHP] Session Variables Not Being Passed
 
 The code that I have is as such:
 
 //header.php
 if(isset($_POST['login'])){
   $checkuser = mysql_query(SELECT * FROM mainacct WHERE username =
 '{$_POST['username']}' AND password = '{$_POST['password']}' ,
 $connection) or die (Couldn't find user.);
   if (mysql_num_rows($checkuser)  0){
while ($row = mysql_fetch_array($checkuser)){
 $_SESSION['UN'] = $row['username'];
 $_SESSION['UserLoggedIn'] = True;
}
   } else {
   header(Location:login.php);
exit;
   }
 }

You're only expecting one row to be returned, right? You could test like
this:

if($row = mysql_fetch_array($checkuser))
{
  $_SESSION['UN'] = $row['username'];
  $_SESSION['UserLoggedIn'] = TRUE;
}
else
{
  header(Location: http://yourdomain.com/login.php;);
  exit();
}

You should use an absolute URI for your header() call, not a relative
one. 

 This file is then used as an include in main.php. As long as the
variables
 are used ONLY in the header.php file, it works. But when I try to call
the
 session variables in main.php, it doesn't show the values of UN or
 UserLoggedIn. session_start() is called in main.php. Is this a quirk
with
 sessions, or is there something more I am supposed to be doing?
Running
 Apache 2 w/PHP 4.2.3 on WindowsXP.

Well, Apache 2 and PHP aren't stable together yet. It's not recommended
you use them together and that could be causing your problem.

Are you including this file before or after session_start()? If you call
session_start(), include the above code, and then $_SESSION['UN'] is not
available later in the main.php page, then it's a bug...

---John Holmes...



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




Re: [PHP] XTemplate

2002-12-01 Thread phpnew_bocket
try FastTemplate...

http://www.thewebmasters.net/php/FastTemplate.phtml

I use it alot...

--- Henry [EMAIL PROTECTED] wrote:
 Hi All,
 
 I'm looking for a way to seperate my HTML from my
 PHP and database access
 code, I pointed in the direction of XTemplate. After
 having had a look at
 XTemplate I'm not sure if it is current and stable
 under PHP 4 Is it and
 if it isn't is there something better to use?
 
 Henry
 
 
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 


=
+--+
|Wana Know what ISLAM is all about ? |
+--+

visit :   http://www.sultan.org/#int

__
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




[PHP] PHP Trouble-Ticket-Systems?

2002-12-01 Thread Thomas Seifert
Hi folks,

I already searched through the web but couldn't find any which provide the features I 
want.

What I would want to see in such a system:
- adding TroubleTickets through webinterface or sending an email to an support 
email-address
- adding answers to troubletickets to their parent 
- nice admininterface to answer support-requests and add comments (not sent to 
visitors)
- open/close/stalled/bogus ... and so on tags for the system
- ...


So the question is, does anyone know any good troubleticket/helpdesk-systems written 
in PHP?


Thanks,

Thomas

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




RE: [PHP] PHP Trouble-Ticket-Systems?

2002-12-01 Thread Tony Crockford
 
 So the question is, does anyone know any good 
 troubleticket/helpdesk-systems written in PHP?
 
 
 Thanks,
 
 Thomas


This would seem to fit the bill:

(I've used it and can recommend it)

http://helpdesk.oneorzero.com/

HTH

Tony 

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




Re: [PHP] PHP Trouble-Ticket-Systems?

2002-12-01 Thread Marco Tabini
http://www.inicrm.com

Offered as an ASP (my company produces it, so... shameless plug)


Marco

On Sun, 2002-12-01 at 10:59, Thomas Seifert wrote:
 Hi folks,
 
 I already searched through the web but couldn't find any which provide the features 
I want.
 
 What I would want to see in such a system:
 - adding TroubleTickets through webinterface or sending an email to an support 
email-address
 - adding answers to troubletickets to their parent 
 - nice admininterface to answer support-requests and add comments (not sent to 
visitors)
 - open/close/stalled/bogus ... and so on tags for the system
 - ...
 
 
 So the question is, does anyone know any good troubleticket/helpdesk-systems written 
in PHP?
 
 
 Thanks,
 
 Thomas
 
 -- 
 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] Test links?

2002-12-01 Thread Hugh Danaher
Yes I did.  Thanks.
- Original Message -
From: Jason Wong [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Sunday, December 01, 2002 2:30 AM
Subject: Re: [PHP] Test links?


 On Sunday 01 December 2002 15:33, Hugh Danaher wrote:
  Not sure how to supress the warning message that PHP automatically does
  when you haven't got a valid URL though.

 Error reporting options can be set in php.ini or by using ini_set().

  should be able to surpress errors by adding an * before the result
variable
 
  *$fp = fopen($linkdata['linkurl'],r);

 I think you mean '@':

   $fp = @fopen($linkdata['linkurl'],r);

 --
 Jason Wong - Gremlins Associates - www.gremlins.biz
 Open Source Software Systems Integrators
 * Web Design  Hosting * Internet  Intranet Applications Development *

 /*
 Blessed is he who expects no gratitude, for he shall not be disappointed.
 -- W.C. Bennett
 */


 --
 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] Going Mad

2002-12-01 Thread Jason Wong
On Sunday 01 December 2002 22:36, Andy wrote:
 OK, so I have located the httpd.config file but still no joy, I know it is
 something very simple and silly.
 I will explain in detail what I have done, I think this will give a better
 idea of where I am going wrong.

 Loaded Apache from the CD first in its default location c:/program
 files/apachegroup/apache/htdocs.

This looks like the location where the files for your website should be 
placed. As a previous poster commented below, this location is specified by 
the DocumentRoot directive in httpd.conf

 I was then told to write the following code in my webspace, 

Presumably by webspace they mean the above location.

 so i used
 Dreamweaver MX, then tried Notepad:
 html etc etc bodypThis is a HTML line /p
 ?php echo This is a PHP line; phpinfo(); ?
 /body
 I save the file and go to view it in Explorer but i see just the html text
 not the php?

Well move your file to the above location and try:

  http://localhost/name_of_your_file.php

 Now what i cannot understand is, am i saving the php files in the right
 place (if there is one?) and should i be running the browser as localhost
 which see's the apache page ok when i type http://localhost/ into the
 address bar.

That proves apache is running OK.

If you're still having trouble locating your DocumentRoot, try searching for 
these file:

  index.html.ca
  index.html.cz
  index.html.de
  index.html.dk
  index.html.ee
  index.html.el
  index.html.en

All these files (and more) are found in the DocumentRoot directory of a 
standard Apache installation. Those index.html.* are the Apache welcome page 
in various languages.

  Yes, Phil has it. I'd assumed this, I should not have. The directory is
  given by the DocumentRoot line in httpd.conf. You did not say exectly
  what error you were getting, I'd assumed that you were just seeing the
  source of your file and that the only problem was php not parsing it.
  Presumably you were getting Document not found errors?

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *

/*
The following statement is not true.  The previous statement is true.
*/


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




Re: [PHP] Going Mad

2002-12-01 Thread Ernest E Vogelsinger
At 15:36 01.12.2002, Andy said:
[snip] 
Then i added Action application/x-httpd-php /php/php.exe under the Action
section followed by AddType application/xhttpd-php .php under the AddType
section.

According to the book i would now be ready to go!
[snip] 

Sounds fine - did you restart Apache?


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




[PHP] Has anyone this script ??

2002-12-01 Thread Ray Healy \(Data Net Services\)
Dear All

I have been trying for ages to write a PHP calendar with a mySQL backend but cannot 
seem to get it working correctly.

I have visited many sites and downloaded various free scripts but they all seem to do 
more than I need although they are all excellent.

What I want to be able to do is enter a start_date and end_date from a form with a 
event. Once this is in the databse then the calender can be viewed and all those days 
that have an event, the days cell is coloured, say red. If there are no events for 
that day then it stays white. There is no need to see the event in the general user 
calendar. This way they can see which days are booked and which days are not.

Has anyone such a script that I could use or at lesat get an idea how to do it. I have 
alreday tried all the script archives and tutorials.

Any advice would be appreciated.

Thanks

Ray


Re: [PHP] Has anyone this script ??

2002-12-01 Thread Ernest E Vogelsinger
At 17:37 01.12.2002, Ray Healy \(Data Net Services\) said:
[snip]
I have visited many sites and downloaded various free scripts but they all 
seem to do more than I need although they are all excellent.
[snip] 

Ray,

isn't it always easier to omit some functionality you don't need than to
reinvent the wheel? You get the source code anyway, so why don't you just
use one of the solutions you found, learning how they did it, and learning
a lot of other useful stuff too?


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




[PHP] Date problem

2002-12-01 Thread Rosen

Hi,
I have one problem:
Date field in MySql database with value as 2002-31-12.
I want to increment or decrement this date and to put it again in table.
Can someone help me to increment or decrement date with some days?

Thanks,
Rosen



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




[PHP] strange parse error at EOF

2002-12-01 Thread Bård Magnus Fauske
Hello.

Get a strange parse error at End of File

Any suggestions what I do wrong? I use UNIX-formatted text-file written in 
windows-client and uploaded to server. Using PHPEDIT to check I get the 
same error as when I visit the page, and I can't find any error looking 
through the file (/,/; etc.).

I use
?php

?

as start/end tags in php

Address to webpage:
http://studorg.nlh.no/storband/wopen.php

Address where you can download the file
http://studorg.nlh.no/storband/docs/wopen_was_php

Bård Magnus 


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



RE: [PHP] Date problem

2002-12-01 Thread John W. Holmes
 I have one problem:
 Date field in MySql database with value as 2002-31-12.
 I want to increment or decrement this date and to put it again in
table.
 Can someone help me to increment or decrement date with some days?

UPDATE yourtable SET yourcolumn = yourcolumn + INTERVAL 1 DAY WHERE ...

http://www.mysql.com/documentation/mysql/bychapter/manual_Reference.html
#Date_and_time_functions

---John Holmes...



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




Re: [PHP] strange parse error at EOF

2002-12-01 Thread Jason Wong
On Monday 02 December 2002 01:24, Bård Magnus Fauske wrote:
 Hello.

 Get a strange parse error at End of File

 Any suggestions what I do wrong? I use UNIX-formatted text-file written in
 windows-client and uploaded to server. Using PHPEDIT to check I get the
 same error as when I visit the page, and I can't find any error looking
 through the file (/,/; etc.).

Check for matching ',, {, (, [ and missing ;

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *

/*
I did this 'cause Linux gives me a woody.  It doesn't generate revenue.
(Dave '-ddt-` Taylor, announcing DOOM for Linux)
*/


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




RE: [PHP] strange parse error at EOF

2002-12-01 Thread John W. Holmes
 Get a strange parse error at End of File

If you get a parse error on the very last line of the file, it's
generally because you missed a closing bracket somewhere. 

In your case, you're missing the closing bracket for this elseif

elseif ($SENDMAIL == 'true')

This is where proper indentation of your code will help you catch simple
mistakes like this...

---John Holmes...



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




Re: [PHP] Date problem

2002-12-01 Thread Rosen
Thanks,
But I need before to save date in database to do some checks with the
inc/dec date.
Cal you help me ?

Thanks,
Rosen


John W. Holmes [EMAIL PROTECTED] wrote in message
002301c29960$21d6a360$7c02a8c0@coconut">news:002301c29960$21d6a360$7c02a8c0@coconut...
  I have one problem:
  Date field in MySql database with value as 2002-31-12.
  I want to increment or decrement this date and to put it again in
 table.
  Can someone help me to increment or decrement date with some days?

 UPDATE yourtable SET yourcolumn = yourcolumn + INTERVAL 1 DAY WHERE ...

 http://www.mysql.com/documentation/mysql/bychapter/manual_Reference.html
 #Date_and_time_functions

 ---John Holmes...





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




[PHP] eregi_replace() function in a script

2002-12-01 Thread Anthony Ritter
Hi,
The following appliaction for the following html form and php script was
taken from Larry Ullman's book on PHP on page 130 - 131.

What it does is this:

1. the user is presented with a form with a few textboxes and a textarea
box.

2. the user fills in the boxes with a URL and a descripttion of the URL and
submits it.

3. the PHP takes the string which has three groupings and parses it uses the
eregi_replace() function.

4. The end result is that the URL input from the user becomes a active A
HREFlink.


The script works fine but I have a question with the following line:

$Pattern=(http://)([^[:space:]]+) ([[:alnum:]\.,-?/=]); // The variable
$Pattern is declared with three groupings.

My question:
If the user inadvertantly inputs a *space* _after_ the http:// grouping and
_before_ the www. grouping my understanding is that would not be valid from
the $Pattern match due to:

([^[:space:]]+)
..

Correct?

I tried the script by putting a space before the URL and the PHP still
processes the data with no error.

Please advise.
Thank you.
Tony Ritter








//this is the html form

HTML
HEAD
/HEAD
BODY
FORM METHOD=POST  ACTION=1201.php
First NameINPUT TYPE=TEXT NAME=Array[FirstName] SIZE=20BR
Last Name INPUT TYPE=TEXT NAME=Array[LastName] SIZE=40BR
URL INPUT TYPE=TEXT NAME=Array[URL] SIZE=60BR
DescriptionTEXTAREA NAME=Array[Description] ROWS=5
COLS=40/TEXTAREABR
INPUT TYPE=SUBMIT NAME=SUBMIT VALUE=Submit!
/FORM
/BODY
/HTML

..
 //this is the script called 1201.php which receives the data from the form.

HTML
HEAD
TITLEUsing Regular Expressions/TITLE
/HEAD
BODY
?php

if (($Array[FirstName]) AND ($Array[LastName]))
 {
   $Array[Name] = $Array[FirstName] .   . $Array[LastName];
 }

else
 {print (Please enter your first and last names.BR\n);
  }

$Pattern = (http://)?([^[:space:]]+)([[:alnum:]\.,-_?/=]);
$Replace = a href=\http://\\2\\3\; target=\_new\\\2\\3/a;
$Array[URL] = eregi_replace($Pattern, $Replace, $Array[URL]);

print (Your submission--$Array[URL]--has been received!BR\n);

?
/BODY
/HTML

--





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




[PHP] Going Mad Result

2002-12-01 Thread Andy
Well, I did it :o)

I am using IIS and got it right, thank you for all who helped me in my hour
of need.

The answer to the question was where i am placing the files (not in the root
folder), just did it on the PC with IIS and there it was in all its glory!

Now i am going to try it on the laptop with apache with all the original
installations and configurations i was having trouble with.

Don't suppose this will be the last you hear of me as i will need more help
no doubt.

Thank you

Andy



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




RE: [PHP] eregi_replace() function in a script

2002-12-01 Thread John W. Holmes
 The script works fine but I have a question with the following line:
 
 $Pattern=(http://)([^[:space:]]+) ([[:alnum:]\.,-?/=]); // The
variable
 $Pattern is declared with three groupings.
 
 My question:
 If the user inadvertantly inputs a *space* _after_ the http://
grouping
 and
 _before_ the www. grouping my understanding is that would not be valid
 from
 the $Pattern match due to:
 
 ([^[:space:]]+)
 ..
 
 Correct?

Yes, that's correct. That piece of the pattern matches anything that's
not a space, one or more times. 

 I tried the script by putting a space before the URL and the PHP still
 processes the data with no error.

A space before everything is fine, as the pattern will match the
remainder of the string. If you put a ^ at the very beginning of the
pattern, that'll mean the beginning of the string must be followed by
(http), so then a space will cause the patter match to fail. 

---John Holmes...



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




RE: [PHP] Date problem

2002-12-01 Thread John W. Holmes
What exactly do you want to do? I'm not a mind reader...

---John Holmes...

 -Original Message-
 From: Rosen [mailto:[EMAIL PROTECTED]]
 Sent: Sunday, December 01, 2002 12:54 PM
 To: [EMAIL PROTECTED]
 Subject: Re: [PHP] Date problem
 
 Thanks,
 But I need before to save date in database to do some checks with the
 inc/dec date.
 Cal you help me ?
 
 Thanks,
 Rosen
 
 
 John W. Holmes [EMAIL PROTECTED] wrote in message
 002301c29960$21d6a360$7c02a8c0@coconut">news:002301c29960$21d6a360$7c02a8c0@coconut...
   I have one problem:
   Date field in MySql database with value as 2002-31-12.
   I want to increment or decrement this date and to put it again in
  table.
   Can someone help me to increment or decrement date with some days?
 
  UPDATE yourtable SET yourcolumn = yourcolumn + INTERVAL 1 DAY WHERE
...
 
 
http://www.mysql.com/documentation/mysql/bychapter/manual_Reference.html
  #Date_and_time_functions
 
  ---John Holmes...
 
 
 
 
 
 --
 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] Call to undefined function: mysql_foo()...

2002-12-01 Thread Adam Atlas
I'm having a strange problem. If I run any MySQL function, I get the 
error message Call to undefined function: mysql_foo(). Why would I be 
getting this? I've checked php.ini to see if it has the 
extension=mysql.so line, and I've run a phpinfo() script which says PHP 
was compiled with MySQL and it does have a MySQL section. The strangest 
part is that I have a perfectly functional phpBB installation using a 
MySQL database. Am I missing something obvious?

--
Adam Atlas

During my service in the United States Congress, I took the initiative 
in creating the Internet. - Al Gore, March 9, 1999: On CNN's Late 
Edition


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



[PHP] MySQL Error

2002-12-01 Thread Stephen
Hello,

I just recently switched to IIS from Apache since IIS came with Windows XP
and I just love Microsoft. I installed PHP and MySQL with no problems but
when I tried accessing a table, I got this error:

No Database Selected

In my script, I have this:

$hostname_default = localhost;
$database_default = check;
$username_default = root;
$password_default =  **taken out for known reasons** ;
$default = mysql_pconnect($hostname_default, $username_default,
$password_default) or die(mysql_error());
mysql_select_db($database_default, $default);
$query_update = SELECT * FROM updates ORDER BY `date` DESC LIMIT 1;
$update = mysql_query($query_update, $default) or die(mysql_error());
$row_update = mysql_fetch_assoc($update);
$totalRows_update = mysql_num_rows($update);

I don't see where it's gone wrong! My database name is check and phpMyAdmin
can get to it just fine. Also, how can I set it up so MySQL allows the user
name root and no password acessable through localhost? I accidently changed
it to only allow username root, with password...

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

What is a dreamer that can not persevere? -- http://www.melchior.us


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


Re: [PHP] Call to undefined function: mysql_foo()...

2002-12-01 Thread Marco Tabini
Is it possible that phpBB is using a different copy of PHP?


On Sun, 2002-12-01 at 14:21, Adam Atlas wrote:
 I'm having a strange problem. If I run any MySQL function, I get the 
 error message Call to undefined function: mysql_foo(). Why would I be 
 getting this? I've checked php.ini to see if it has the 
 extension=mysql.so line, and I've run a phpinfo() script which says PHP 
 was compiled with MySQL and it does have a MySQL section. The strangest 
 part is that I have a perfectly functional phpBB installation using a 
 MySQL database. Am I missing something obvious?
 
 --
 Adam Atlas
 
 During my service in the United States Congress, I took the initiative 
 in creating the Internet. - Al Gore, March 9, 1999: On CNN's Late 
 Edition
 
 
 -- 
 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: PHP Trouble-Ticket-Systems?

2002-12-01 Thread Jonathan Chum
I actually spent all day last Wednesday for looking for such a tool to
integrate into a web hosting control panel we've built, but there really
isn't a good one out there. PerlDesk is a free one that is template based,
yet it's lacking a few features. At work, we use Response Tracker v2 (RT)
which is also Perl based, but the template engine is nightmare to give it a
new look. It has everything you mention below, but the interface and
installation is the drawbacks.

So, I spent my Thanksgiving weekend working on PHP port of RT2 which at the
moment is able to authenticate technicians, create a new ticket,
reply/comment to tickets, activity logging, queue stats, and a few other
things.

I haven't done the client side yet, but shouldn't be too hard since the DB
schema is complete and I can safely reuse templates in the technician screen
for the client area with a small bit of changing out the WHERE clauses in
the SQL querying.

The DB layer is ADODB so it can be ported over to PostGreSQL later on.
Smarty is the template class I'm using with custom error pages on all
errors, warning, or notices.

Until the web interface is hardened, then I'll work on email parser to pipe
it into database and parse MIME attachments. . . I'd like to see it evolve
into something like cyracle.com where there is a knowledge base in which the
visitor can rummage through before submitting in a ticket.

Thomas Seifert [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hi folks,

 I already searched through the web but couldn't find any which provide the
features I want.

 What I would want to see in such a system:
 - adding TroubleTickets through webinterface or sending an email to an
support email-address
 - adding answers to troubletickets to their parent
 - nice admininterface to answer support-requests and add comments (not
sent to visitors)
 - open/close/stalled/bogus ... and so on tags for the system
 - ...


 So the question is, does anyone know any good
troubleticket/helpdesk-systems written in PHP?


 Thanks,

 Thomas



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




Re: [PHP] MySQL Error

2002-12-01 Thread Brad Bonkoski
Perhaps you should try and do some error checking on the mysql_select_db()
function, like printing out mysql_error().

Also, for the permissions issues, mysql has a very comprehensive online
documentation on user permissions.  Check them out, you may also wish to try
and connect to the database with a different user?
http://www.mysql.com/documentation/mysql/bychapter/manual_MySQL_Database_Administration.html#Adding_users

HTH
-Brad

Stephen wrote:

 Hello,

 I just recently switched to IIS from Apache since IIS came with Windows XP
 and I just love Microsoft. I installed PHP and MySQL with no problems but
 when I tried accessing a table, I got this error:

 No Database Selected

 In my script, I have this:

 $hostname_default = localhost;
 $database_default = check;
 $username_default = root;
 $password_default =  **taken out for known reasons** ;
 $default = mysql_pconnect($hostname_default, $username_default,
 $password_default) or die(mysql_error());
 mysql_select_db($database_default, $default);
 $query_update = SELECT * FROM updates ORDER BY `date` DESC LIMIT 1;
 $update = mysql_query($query_update, $default) or die(mysql_error());
 $row_update = mysql_fetch_assoc($update);
 $totalRows_update = mysql_num_rows($update);

 I don't see where it's gone wrong! My database name is check and phpMyAdmin
 can get to it just fine. Also, how can I set it up so MySQL allows the user
 name root and no password acessable through localhost? I accidently changed
 it to only allow username root, with password...

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

 What is a dreamer that can not persevere? -- http://www.melchior.us

   
 --
 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] XML-RPC, is this the best approach for something like this?

2002-12-01 Thread Jonathan Chum
Hi guys!

I'm wrapping up a web hosting control panel written in PHP that fills up a
queue with commands such as create web hosting account, or change password.

A Perl based CRON job on each server will query the database trying to
determine what tasks it needs to execute. The problem however is that these
jobs will run every 60s which isn't fast enough for my boss. He'd like to
see things happen instantly.

There are a few ways this could be accomplish that I could think of.

1) Write a daemon that queries the database for tasks only when the infinite
while loop determines that the master server sent a request to begin
querying the master database for tasks.
2) The CRON job could be set to run at a lower interval, maybe every 30s.
3) Write a deamon that opens a port using sockets to listen for commands and
executes.
4) Using XML-RPC, construct an encrypted payload across a SSL connection to
the remote server.

Some of the problems I'm facing is getting a response back from the server
in case there are any issues with account creation. At the moment, there is
a disconnection between the master database and the web hosting servers in
which if an error is generated, the user does not know believing everything
is okay and an email is dispatched to the admin to check out the problem.

I'm also faced with tasks that running on top of each other. Perhaps it took
the server 60s to create the hosting account because the load was incredibly
high. Then the second job starts up, which would be to delete the catch all
account. The catch all account does not exist, but only in the database it
does.

I think method 1 will fix the instant change account maintenance problem,
but I still can't get any responses back from the server if account creation
was not successful.

Method 2 will not fix the instant change, only making it quicker.

Method 3 will fix the instant change and responds back if there are issues

Method 4 sounds like the best method, yet I'm afraid of the script timing
out and permissions issue. I don't want the remote machine running PHP
that's parsing the XML payload to run with high level permissions and I hate
to compile another instance of PHP and Apache.

So I'm left with Method 3 with probably the best choice. Before I dive into
the world of socket development, is there any recommendations or feedback?



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




Re: [PHP] XML-RPC, is this the best approach for something like this?

2002-12-01 Thread Matt Vos

- Original Message -
From: Jonathan Chum [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Sunday, December 01, 2002 3:27 PM
Subject: [PHP] XML-RPC, is this the best approach for something like this?


 Hi guys!

 I'm wrapping up a web hosting control panel written in PHP that fills up a
 queue with commands such as create web hosting account, or change
password.

 A Perl based CRON job on each server will query the database trying to
 determine what tasks it needs to execute. The problem however is that
these
 jobs will run every 60s which isn't fast enough for my boss. He'd like to
 see things happen instantly.

 There are a few ways this could be accomplish that I could think of.

 1) Write a daemon that queries the database for tasks only when the
infinite
 while loop determines that the master server sent a request to begin
 querying the master database for tasks.
 2) The CRON job could be set to run at a lower interval, maybe every 30s.
 3) Write a deamon that opens a port using sockets to listen for commands
and
 executes.
 4) Using XML-RPC, construct an encrypted payload across a SSL connection
to
 the remote server.

 Some of the problems I'm facing is getting a response back from the server
 in case there are any issues with account creation. At the moment, there
is
 a disconnection between the master database and the web hosting servers in
 which if an error is generated, the user does not know believing
everything
 is okay and an email is dispatched to the admin to check out the problem.

 I'm also faced with tasks that running on top of each other. Perhaps it
took
 the server 60s to create the hosting account because the load was
incredibly
 high. Then the second job starts up, which would be to delete the catch
all
 account. The catch all account does not exist, but only in the database it
 does.

 I think method 1 will fix the instant change account maintenance problem,
 but I still can't get any responses back from the server if account
creation
 was not successful.

 Method 2 will not fix the instant change, only making it quicker.

 Method 3 will fix the instant change and responds back if there are issues

 Method 4 sounds like the best method, yet I'm afraid of the script timing
 out and permissions issue. I don't want the remote machine running PHP
 that's parsing the XML payload to run with high level permissions and I
hate
 to compile another instance of PHP and Apache.

 So I'm left with Method 3 with probably the best choice. Before I dive
into
 the world of socket development, is there any recommendations or feedback?



 --
 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] XML-RPC, is this the best approach for something like this?

2002-12-01 Thread Ernest E Vogelsinger
At 21:27 01.12.2002, Jonathan Chum said:
[snip]
I'm wrapping up a web hosting control panel written in PHP that fills up a
queue with commands such as create web hosting account, or change password.

A Perl based CRON job on each server will query the database trying to
determine what tasks it needs to execute. The problem however is that these
jobs will run every 60s which isn't fast enough for my boss. He'd like to
see things happen instantly.
[snip] 

You should study the SOAP protocol (a.k.a. WebObjects) - this protocol is
intended to let servers - even remote ones - work cooperatively together.
It's good stuff IMHO, despite the fact that M$ is hooked on it with C# and
.net.


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




[PHP] phpMyAdmin : password and user (Help)

2002-12-01 Thread Iguider
Hi
Please I need a help, I used to work with asp and now I am migrating to php, my site 
web works perfectly on my PC (windows). I am runing phpMyAdmin 2.2.6,  and easyphp on 
local machine . 
when my host give me a username and password, I want to change the file 
phpMyAdmin/config.inc.php  from user=root to user=username and from password=  
 to password=password, the phpMyAdmin show me Host 'localhost' is not allowed to 
connect to this MySQL server even if i setup the default values.


the phpMyAdmin/config.inc.php is :
$cfgServers[$i]['host']  = 'localhost'; // MySQL hostname
$cfgServers[$i]['port']  = '';  // MySQL port - leave blank for 
default port
$cfgServers[$i]['socket']= '';  // Path to the socket - leave blank 
for default socket
$cfgServers[$i]['connect_type']  = 'tcp';   // How to connect to MySQL server 
('tcp' or 'socket')
$cfgServers[$i]['controluser']   = '';  // MySQL control user settings
// (this user must have read-only
$cfgServers[$i]['controlpass']   = '';  // access to the mysql/user
// and mysql/db tables)
$cfgServers[$i]['auth_type'] = 'config';// Authentication method (config, http 
or cookie based)?
$cfgServers[$i]['user']  = 'root';  // MySQL user
$cfgServers[$i]['password']  = '';  // MySQL password (only needed
// with 'config' auth_type)
$cfgServers[$i]['only_db']   = '';  // If set to a db-name, only
// this db is displayed
// at left frame
// It may also be an array
// of db-names
$cfgServers[$i]['verbose']   = '';  // Verbose name for this host - leave 
blank to show the hostname
$cfgServers[$i]['bookmarkdb']= '';  // Bookmark db - leave blank for no 
bookmark support
$cfgServers[$i]['bookmarktable'] = '';  // Bookmark table - leave blank for no 
bookmark support
$cfgServers[$i]['relation']  = '';  // table to describe the relation 
between links (see doc)
//   - leave blank for no 
relation-links support

$i++;
$cfgServers[$i]['host']  = '';
$cfgServers[$i]['port']  = '';
$cfgServers[$i]['socket']= '';
$cfgServers[$i]['connect_type']  = 'tcp';
$cfgServers[$i]['controluser']   = '';
$cfgServers[$i]['controlpass']   = '';
$cfgServers[$i]['auth_type'] = 'config';
$cfgServers[$i]['user']  = 'root';
$cfgServers[$i]['password']  = '';
$cfgServers[$i]['only_db']   = '';
$cfgServers[$i]['verbose']   = '';
$cfgServers[$i]['bookmarkdb']= '';
$cfgServers[$i]['bookmarktable'] = '';
$cfgServers[$i]['relation']  = '';

$i++;
$cfgServers[$i]['host']  = '';
$cfgServers[$i]['port']  = '';
$cfgServers[$i]['socket']= '';
$cfgServers[$i]['connect_type']  = 'tcp';
$cfgServers[$i]['controluser']   = '';
$cfgServers[$i]['controlpass']   = '';
$cfgServers[$i]['auth_type'] = 'config';
$cfgServers[$i]['user']  = 'root';
$cfgServers[$i]['password']  = '';
$cfgServers[$i]['only_db']   = '';
$cfgServers[$i]['verbose']   = '';
$cfgServers[$i]['bookmarkdb']= '';
$cfgServers[$i]['bookmarktable'] = '';
$cfgServers[$i]['relation']  = '';



[PHP] apache httpd-2.0.40-8 and scanning alternate extensions for php

2002-12-01 Thread Larry Brown
I just moved to a machine with RH8 that has their latest version of apache.
On prior versions httpd.conf had a section that I could set to have the
server scan .html extensions for php tags.  There is no longer such a
section even though the server does appropriately scan .php files.  Does
anyone know how I can have it scan different extensions?

Larry S. Brown
Dimension Networks, Inc.
(727) 723-8388




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




Re: [PHP] apache httpd-2.0.40-8 and scanning alternate extensions for php

2002-12-01 Thread Evan Nemerson
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Find the line that looks like AddType application/x-httpd-php .php, and 
change it to AddType application/x-httpd-php .php .html


On Sunday 01 December 2002 01:34 pm, Larry Brown wrote:
 I just moved to a machine with RH8 that has their latest version of apache.
 On prior versions httpd.conf had a section that I could set to have the
 server scan .html extensions for php tags.  There is no longer such a
 section even though the server does appropriately scan .php files.  Does
 anyone know how I can have it scan different extensions?

 Larry S. Brown
 Dimension Networks, Inc.
 (727) 723-8388
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE96oTZ/rncFku1MdIRAlXQAJ9lV5cmg2MLXnnSIVsFWW157+puBQCfTzya
TGBEeaXx+9XlBxHbzEtWwos=
=Ajqh
-END PGP SIGNATURE-


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




Re: [PHP] phpMyAdmin : password and user (Help)

2002-12-01 Thread Evan Nemerson
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Try changing the username from username to [EMAIL PROTECTED]


On Sunday 01 December 2002 01:21 pm, Iguider wrote:
 Hi
 Please I need a help, I used to work with asp and now I am migrating to
 php, my site web works perfectly on my PC (windows). I am runing phpMyAdmin
 2.2.6,  and easyphp on local machine . when my host give me a username and
 password, I want to change the file phpMyAdmin/config.inc.php  from
 user=root to user=username and from password=   to
 password=password, the phpMyAdmin show me Host 'localhost' is not
 allowed to connect to this MySQL server even if i setup the default
 values.


 the phpMyAdmin/config.inc.php is :
 $cfgServers[$i]['host']  = 'localhost'; // MySQL hostname
 $cfgServers[$i]['port']  = '';  // MySQL port - leave blank
 for default port $cfgServers[$i]['socket']= '';  // Path to
 the socket - leave blank for default socket $cfgServers[$i]['connect_type']
  = 'tcp';   // How to connect to MySQL server ('tcp' or 'socket')
 $cfgServers[$i]['controluser']   = '';  // MySQL control user
 settings // (this user must have read-only $cfgServers[$i]['controlpass']  
 = '';  // access to the mysql/user // and mysql/db tables)
 $cfgServers[$i]['auth_type'] = 'config';// Authentication method
 (config, http or cookie based)? $cfgServers[$i]['user']  = 'root'; 
 // MySQL user
 $cfgServers[$i]['password']  = '';  // MySQL password (only
 needed // with 'config' auth_type) $cfgServers[$i]['only_db']   = '';  
// If set to a db-name, only // this db is displayed // at left
 frame
 // It may also be an array
 // of db-names
 $cfgServers[$i]['verbose']   = '';  // Verbose name for this
 host - leave blank to show the hostname $cfgServers[$i]['bookmarkdb']=
 '';  // Bookmark db - leave blank for no bookmark support
 $cfgServers[$i]['bookmarktable'] = '';  // Bookmark table - leave
 blank for no bookmark support $cfgServers[$i]['relation']  = '';   
   // table to describe the relation between links (see doc) //   - leave
 blank for no relation-links support

 $i++;
 $cfgServers[$i]['host']  = '';
 $cfgServers[$i]['port']  = '';
 $cfgServers[$i]['socket']= '';
 $cfgServers[$i]['connect_type']  = 'tcp';
 $cfgServers[$i]['controluser']   = '';
 $cfgServers[$i]['controlpass']   = '';
 $cfgServers[$i]['auth_type'] = 'config';
 $cfgServers[$i]['user']  = 'root';
 $cfgServers[$i]['password']  = '';
 $cfgServers[$i]['only_db']   = '';
 $cfgServers[$i]['verbose']   = '';
 $cfgServers[$i]['bookmarkdb']= '';
 $cfgServers[$i]['bookmarktable'] = '';
 $cfgServers[$i]['relation']  = '';

 $i++;
 $cfgServers[$i]['host']  = '';
 $cfgServers[$i]['port']  = '';
 $cfgServers[$i]['socket']= '';
 $cfgServers[$i]['connect_type']  = 'tcp';
 $cfgServers[$i]['controluser']   = '';
 $cfgServers[$i]['controlpass']   = '';
 $cfgServers[$i]['auth_type'] = 'config';
 $cfgServers[$i]['user']  = 'root';
 $cfgServers[$i]['password']  = '';
 $cfgServers[$i]['only_db']   = '';
 $cfgServers[$i]['verbose']   = '';
 $cfgServers[$i]['bookmarkdb']= '';
 $cfgServers[$i]['bookmarktable'] = '';
 $cfgServers[$i]['relation']  = '';

- -- 
To assert that the earth revolves around the sun is as erroneous as to claim 
that Jesus was not born of a virgin.

- -Cardinal Bellarmino
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE96oVe/rncFku1MdIRAlGnAKCCeUAyjFNuM+2iPzxzbH8vgNwRVACfWchW
z5zyWAUzYF4UI89dVFmdv/o=
=AvD/
-END PGP SIGNATURE-


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




Re: [PHP] eregi_replace() function in a script

2002-12-01 Thread Anthony Ritter
John W. Holmes:

 Yes, that's correct. That piece of the pattern matches anything that's
 not a space, one or more times.

  I tried the script by putting a space before the URL and the PHP still
  processes the data with no error.

 A space before everything is fine, as the pattern will match the
 remainder of the string. If you put a ^ at the very beginning of the
 pattern, that'll mean the beginning of the string must be followed by
 (http), so then a space will cause the patter match to fail.
...
Thanks for the reply John.

I still don't understand the explanation.

For instance, let's say I put _absolutely nothing_ in the URL textbox and
then hit submit - the PHP still processes _without_ an error.

It says:
Your submission -- -- has been received!

I would've thought the eregi_replace() function would've validated an entry
with no characters.

If you get a chance would you please try it out.

Thanks again for your time.
TR




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




RE: [PHP] eregi_replace() function in a script

2002-12-01 Thread John W. Holmes
 For instance, let's say I put _absolutely nothing_ in the URL textbox
and
 then hit submit - the PHP still processes _without_ an error.
 
 It says:
 Your submission -- -- has been received!
 
 I would've thought the eregi_replace() function would've validated an
 entry
 with no characters.

Well, whether it causes an error not depends on your code. That's just
the pattern you showed. It may not match anything, so nothing gets
replaced with eregi_replace() and hence no active link is created, but
it may not necessarily cause an error. 

Can you show me some of the code in context, with the pattern you showed
earlier and how eregi_replace is being used? Thanks.

---John Holmes...



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




Re: [PHP] eregi_replace() function in a script

2002-12-01 Thread Anthony Ritter
 Well, whether it causes an error not depends on your code. That's just
 the pattern you showed. It may not match anything, so nothing gets
 replaced with eregi_replace() and hence no active link is created, but
 it may not necessarily cause an error.

 Can you show me some of the code in context, with the pattern you showed
 earlier and how eregi_replace is being used? Thanks.

 ---John Holmes...
..

Sure.

BTW, here's a screenshot of the form and the result at:
www.gonefishingguideservice.com/php.htm

For a test, I put in a few spaces and then s  and then more spaces and
then o and then more spaces and then s and then I hit submit and the
script processed without an error.

So, I don't see where the eregi_replace() pattern matching is coming into
play.

Thank you.
TR
...
Here is Larry Ullman's PHP script on page 130 -131:

//this is the html form

HTML
HEAD
/HEAD
BODY
FORM METHOD=POST  ACTION=1201.php
First NameINPUT TYPE=TEXT NAME=Array[FirstName] SIZE=20BR
Last Name INPUT TYPE=TEXT NAME=Array[LastName] SIZE=40BR
URL INPUT TYPE=TEXT NAME=Array[URL] SIZE=60BR
DescriptionTEXTAREA NAME=Array[Description] ROWS=5
COLS=40/TEXTAREABR
INPUT TYPE=SUBMIT NAME=SUBMIT VALUE=Submit!
/FORM
/BODY
/HTML

..
 //this is the script called 1201.php which receives the data from the form.

HTML
HEAD
TITLEUsing Regular Expressions/TITLE
/HEAD
BODY
?php

if (($Array[FirstName]) AND ($Array[LastName]))
 {
   $Array[Name] = $Array[FirstName] .   . $Array[LastName];
 }

else
 {print (Please enter your first and last names.BR\n);
  }

$Pattern = (http://)?([^[:space:]]+)([[:alnum:]\.,-_?/=]);
$Replace = a href=\http://\\2\\3\; target=\_new\\\2\\3/a;
$Array[URL] = eregi_replace($Pattern, $Replace, $Array[URL]);

print (Your submission--$Array[URL]--has been received!BR\n);

?
/BODY
/HTML





---
[This E-mail scanned for viruses by gonefishingguideservice.com]


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




Re: [PHP] MySQL Error

2002-12-01 Thread Stephen
I did that and it didn't output anything...


- Original Message -
From: Brad Bonkoski [EMAIL PROTECTED]
To: Stephen [EMAIL PROTECTED]
Cc: PHP List [EMAIL PROTECTED]
Sent: Sunday, December 01, 2002 2:55 PM
Subject: Re: [PHP] MySQL Error


 Perhaps you should try and do some error checking on the mysql_select_db()
 function, like printing out mysql_error().

 Also, for the permissions issues, mysql has a very comprehensive online
 documentation on user permissions.  Check them out, you may also wish to
try
 and connect to the database with a different user?

http://www.mysql.com/documentation/mysql/bychapter/manual_MySQL_Database_Adm
inistration.html#Adding_users

 HTH
 -Brad

 Stephen wrote:

  Hello,
 
  I just recently switched to IIS from Apache since IIS came with Windows
XP
  and I just love Microsoft. I installed PHP and MySQL with no problems
but
  when I tried accessing a table, I got this error:
 
  No Database Selected
 
  In my script, I have this:
 
  $hostname_default = localhost;
  $database_default = check;
  $username_default = root;
  $password_default =  **taken out for known reasons** ;
  $default = mysql_pconnect($hostname_default, $username_default,
  $password_default) or die(mysql_error());
  mysql_select_db($database_default, $default);
  $query_update = SELECT * FROM updates ORDER BY `date` DESC LIMIT 1;
  $update = mysql_query($query_update, $default) or die(mysql_error());
  $row_update = mysql_fetch_assoc($update);
  $totalRows_update = mysql_num_rows($update);
 
  I don't see where it's gone wrong! My database name is check and
phpMyAdmin
  can get to it just fine. Also, how can I set it up so MySQL allows the
user
  name root and no password acessable through localhost? I accidently
changed
  it to only allow username root, with password...
 
  Thanks,
  Stephen Craton
  http://www.melchior.us
 
  What is a dreamer that can not persevere? -- http://www.melchior.us
 

  
  --
  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] Date problem

2002-12-01 Thread Rosen

I want to get date from database, to increment ot decrement it with some
days, to show the date and after thath
if user confirm it to save it to database.

Can you help me ?

Thanks,
Rosen

John W. Holmes [EMAIL PROTECTED] wrote in message
002601c29965$7862e950$7c02a8c0@coconut">news:002601c29965$7862e950$7c02a8c0@coconut...
 What exactly do you want to do? I'm not a mind reader...

 ---John Holmes...

  -Original Message-
  From: Rosen [mailto:[EMAIL PROTECTED]]
  Sent: Sunday, December 01, 2002 12:54 PM
  To: [EMAIL PROTECTED]
  Subject: Re: [PHP] Date problem
 
  Thanks,
  But I need before to save date in database to do some checks with the
  inc/dec date.
  Cal you help me ?
 
  Thanks,
  Rosen
 
 
  John W. Holmes [EMAIL PROTECTED] wrote in message
  002301c29960$21d6a360$7c02a8c0@coconut">news:002301c29960$21d6a360$7c02a8c0@coconut...
I have one problem:
Date field in MySql database with value as 2002-31-12.
I want to increment or decrement this date and to put it again in
   table.
Can someone help me to increment or decrement date with some days?
  
   UPDATE yourtable SET yourcolumn = yourcolumn + INTERVAL 1 DAY WHERE
 ...
  
  
 http://www.mysql.com/documentation/mysql/bychapter/manual_Reference.html
   #Date_and_time_functions
  
   ---John Holmes...
  
  
 
 
 
  --
  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: PHP Trouble-Ticket-Systems?

2002-12-01 Thread Thomas Seifert
Sounds interesting.
I used RT at work but it was a nightmare to install and since my machine
is a pure PHP-Apache I don't want to install mod_perl-support as well.

Let me know if you need help on some parts.


Thomas

On Sun, 1 Dec 2002 14:33:02 -0500 [EMAIL PROTECTED] (Jonathan Chum) wrote:

 I actually spent all day last Wednesday for looking for such a tool to
 integrate into a web hosting control panel we've built, but there really
 isn't a good one out there. PerlDesk is a free one that is template based,
 yet it's lacking a few features. At work, we use Response Tracker v2 (RT)
 which is also Perl based, but the template engine is nightmare to give it a
 new look. It has everything you mention below, but the interface and
 installation is the drawbacks.
 
 So, I spent my Thanksgiving weekend working on PHP port of RT2 which at the
 moment is able to authenticate technicians, create a new ticket,
 reply/comment to tickets, activity logging, queue stats, and a few other
 things.
 
 I haven't done the client side yet, but shouldn't be too hard since the DB
 schema is complete and I can safely reuse templates in the technician screen
 for the client area with a small bit of changing out the WHERE clauses in
 the SQL querying.
 
 The DB layer is ADODB so it can be ported over to PostGreSQL later on.
 Smarty is the template class I'm using with custom error pages on all
 errors, warning, or notices.
 
 Until the web interface is hardened, then I'll work on email parser to pipe
 it into database and parse MIME attachments. . . I'd like to see it evolve
 into something like cyracle.com where there is a knowledge base in which the
 visitor can rummage through before submitting in a ticket.
 
 Thomas Seifert [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  Hi folks,
 
  I already searched through the web but couldn't find any which provide the
 features I want.
 
  What I would want to see in such a system:
  - adding TroubleTickets through webinterface or sending an email to an
 support email-address
  - adding answers to troubletickets to their parent
  - nice admininterface to answer support-requests and add comments (not
 sent to visitors)
  - open/close/stalled/bogus ... and so on tags for the system
  - ...
 
 
  So the question is, does anyone know any good
 troubleticket/helpdesk-systems written in PHP?
 
 
  Thanks,
 
  Thomas
 
 

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




[PHP] PHP Work Needed in Australia

2002-12-01 Thread Andrew McPherson
hello,

I am looking for a PHP developer in Australia. I  get occational contracts 
to do general web developement and need someone that can handle the work. 
Last month I contracted out about 150 hours.

If you are interested please send me an e-mail and I will supply further 
details.

Thanks,
Andy
[EMAIL PROTECTED]




_
Add photos to your messages with MSN 8. Get 2 months FREE*. 
http://join.msn.com/?page=features/featuredemail


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



Re: [PHP] Date problem

2002-12-01 Thread Justin French
on 02/12/02 9:59 AM, Rosen ([EMAIL PROTECTED]) wrote:

 I want to get date from database, to increment ot decrement it with some
 days, to show the date and after thath
 if user confirm it to save it to database.

And in what format is the date currently stored? -MM-DD?  MySQL
timestamp? Unix Timestamp?


Justin French

http://Indent.com.au
Web Development  
Graphic Design



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




Re: [PHP] Date problem

2002-12-01 Thread Rosen
It's in -MM-YY

Justin French [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 on 02/12/02 9:59 AM, Rosen ([EMAIL PROTECTED]) wrote:

  I want to get date from database, to increment ot decrement it with some
  days, to show the date and after thath
  if user confirm it to save it to database.

 And in what format is the date currently stored? -MM-DD?  MySQL
 timestamp? Unix Timestamp?


 Justin French
 
 http://Indent.com.au
 Web Development 
 Graphic Design
 




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




RE: [PHP] apache httpd-2.0.40-8 and scanning alternate extensions for php

2002-12-01 Thread Larry Brown
That's what I'm saying, there is absolutely no mention of php in httpd.conf.
That line does not exist.  It does in previous versions of RedHat / Apache.
Is it possible that this is some kind of RedHat modification?

Larry S. Brown
Dimension Networks, Inc.
(727) 723-8388

-Original Message-
From: Evan Nemerson [mailto:[EMAIL PROTECTED]]
Sent: Sunday, December 01, 2002 4:53 PM
To: Larry Brown; [EMAIL PROTECTED]
Subject: Re: [PHP] apache httpd-2.0.40-8 and scanning alternate extensions
for php

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Find the line that looks like AddType application/x-httpd-php .php, and
change it to AddType application/x-httpd-php .php .html


On Sunday 01 December 2002 01:34 pm, Larry Brown wrote:
 I just moved to a machine with RH8 that has their latest version of
apache.
 On prior versions httpd.conf had a section that I could set to have the
 server scan .html extensions for php tags.  There is no longer such a
 section even though the server does appropriately scan .php files.  Does
 anyone know how I can have it scan different extensions?

 Larry S. Brown
 Dimension Networks, Inc.
 (727) 723-8388
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE96oTZ/rncFku1MdIRAlXQAJ9lV5cmg2MLXnnSIVsFWW157+puBQCfTzya
TGBEeaXx+9XlBxHbzEtWwos=
=Ajqh
-END PGP SIGNATURE-



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




RE: [PHP] apache httpd-2.0.40-8 and scanning alternate extensions for php

2002-12-01 Thread Larry Brown
Perhaps the new version doesn't need the AddType for the default extension
of php because it worked without this declaration.  However, the declaration
works as I added it and restarted the server.  It now works as I needed.  I
thank you for your help.  I suppose I should have tried this before posting
the question.  Sorry to have wasted your time.  Hopefully someone else will
fail to test it first and find my question before posting and save everyone
time in the future.

Larry S. Brown
Dimension Networks, Inc.
(727) 723-8388

-Original Message-
From: Evan Nemerson [mailto:[EMAIL PROTECTED]]
Sent: Sunday, December 01, 2002 4:53 PM
To: Larry Brown; [EMAIL PROTECTED]
Subject: Re: [PHP] apache httpd-2.0.40-8 and scanning alternate extensions
for php

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Find the line that looks like AddType application/x-httpd-php .php, and
change it to AddType application/x-httpd-php .php .html


On Sunday 01 December 2002 01:34 pm, Larry Brown wrote:
 I just moved to a machine with RH8 that has their latest version of
apache.
 On prior versions httpd.conf had a section that I could set to have the
 server scan .html extensions for php tags.  There is no longer such a
 section even though the server does appropriately scan .php files.  Does
 anyone know how I can have it scan different extensions?

 Larry S. Brown
 Dimension Networks, Inc.
 (727) 723-8388
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE96oTZ/rncFku1MdIRAlXQAJ9lV5cmg2MLXnnSIVsFWW157+puBQCfTzya
TGBEeaXx+9XlBxHbzEtWwos=
=Ajqh
-END PGP SIGNATURE-


--
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] apache httpd-2.0.40-8 and scanning alternate extensions for php

2002-12-01 Thread Peter Houchin
if its not there add it

 -Original Message-
 From: Larry Brown [mailto:[EMAIL PROTECTED]]
 Sent: Monday, 2 December 2002 10:31 AM
 To: PHP List; Evan Nemerson
 Subject: RE: [PHP] apache httpd-2.0.40-8 and scanning alternate
 extensions for php


 That's what I'm saying, there is absolutely no mention of php in
 httpd.conf.
 That line does not exist.  It does in previous versions of RedHat
 / Apache.
 Is it possible that this is some kind of RedHat modification?

 Larry S. Brown
 Dimension Networks, Inc.
 (727) 723-8388

 -Original Message-
 From: Evan Nemerson [mailto:[EMAIL PROTECTED]]
 Sent: Sunday, December 01, 2002 4:53 PM
 To: Larry Brown; [EMAIL PROTECTED]
 Subject: Re: [PHP] apache httpd-2.0.40-8 and scanning alternate extensions
 for php

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 Find the line that looks like AddType application/x-httpd-php .php, and
 change it to AddType application/x-httpd-php .php .html


 On Sunday 01 December 2002 01:34 pm, Larry Brown wrote:
  I just moved to a machine with RH8 that has their latest version of
 apache.
  On prior versions httpd.conf had a section that I could set to have the
  server scan .html extensions for php tags.  There is no longer such a
  section even though the server does appropriately scan .php files.  Does
  anyone know how I can have it scan different extensions?
 
  Larry S. Brown
  Dimension Networks, Inc.
  (727) 723-8388
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1.0.7 (GNU/Linux)

 iD8DBQE96oTZ/rncFku1MdIRAlXQAJ9lV5cmg2MLXnnSIVsFWW157+puBQCfTzya
 TGBEeaXx+9XlBxHbzEtWwos=
 =Ajqh
 -END PGP SIGNATURE-



 --
 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] includes globals

2002-12-01 Thread Cesar Aracena
Hi all,

I'm making a site with a dynamic menu based on IF statements and DB
queries, but have this little problem which I can't understand the
reason. My programming method is based upon an application.php file
which controls the hole site and paths, template files for the header 
footer and main PHP files which includes all the needed files that I
mentioned before.

As an example of this, the header TITLE tag has a ?=$TITLE? variable
to take a different title for each page and after that, I put a
$LOCATION variable to tell the menu() function which page is being
displayed (different menus for products, about us, etc.) but the menu()
function (fetched from a library) is not recognizing this $LOCATION
variable. I'm declaring it as a GLOBAL inside the function, but nothing
happens. Here's part of my code:

This is part of my product's index.php file:

SNIP

?

require (../application.php);
$TITLE = Joyería Mara;
$LOCATION = ;
include ($CFG-templatedir/header.inc);

?
TR
TD VALIGN=top
P!--COMIENZO DE CUERPO--TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0
WIDTH=100% HEIGHT=100% TR TD VALIGN=top WIDTH=200 PTABLE
BORDER=0 CELLSPACING=0 CELLPADDING=15 WIDTH=100% TR TD ?

menu();

?

/SNIP

===

And this is the menu() function:

SNIP

function menu(){
GLOBAL $LOCATION;
if ($LOCATION = productos){
GLOBAL $MENU_NAME, $MENU_BACK, $MENU_LINK, $CFG;
$MENU_NAME = Nosotros;
$MENU_LINK = .$CFG-wwwroot./nosotros;
$MENU_BACK = 66;
menu_def();
unset($GLOBALS['MENU_BACK'], $GLOBALS['MENU_NAME'],
$GLOBALS['MENU_LINK']);

GLOBAL $MENU_NAME, $MENU_BACK, $MENU_LINK;
$MENU_NAME = Productos;
$MENU_LINK = .$CFG-wwwroot./productos;
$MENU_BACK = 99;
menu_def();
unset($GLOBALS['MENU_BACK'], $GLOBALS['MENU_NAME'],
$GLOBALS['MENU_LINK']);

GLOBAL $MENU_NAME, $MENU_BACK, $MENU_LINK;
$MENU_NAME = Regístrese;
$MENU_LINK = .$CFG-wwwroot./registrese;
$MENU_BACK = 66;
menu_def();
unset($GLOBALS['MENU_BACK'], $GLOBALS['MENU_NAME'],
$GLOBALS['MENU_LINK']);

GLOBAL $MENU_NAME, $MENU_BACK, $MENU_LINK;
$MENU_NAME = Contacto;
$MENU_LINK = .$CFG-wwwroot./contacto;
$MENU_BACK = 66;
menu_def();
unset($GLOBALS['MENU_BACK'], $GLOBALS['MENU_NAME'],
$GLOBALS['MENU_LINK']); } else if ($LOCATION = nosotros){ echo hi; }
else{ echo none; } }

/SNIP

==

Any thoughts? Thanks

Cesar L. Aracena
[EMAIL PROTECTED]
[EMAIL PROTECTED]
(0299) 156-356688
Neuquén (8300) Capital
Argentina




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




Re: [PHP] Function passed as argument to function

2002-12-01 Thread Jeffrey B. Ferland
  For reference, see http://autocracy.homelinux.org/template.php and
  http://autocracy.homelinux.org/error.php

 Unless you have a good reason to do otherwise please post your code here.
 People would be less inclined to help if they have to go about clicking on
 links to see what your problem is.

Noted

 1) Do you really mean list_writings(poetry), or did you in fact mean
 list_writings($poetry)?

list_writings(poetry); or more accurately std_layout(Recent Writings,
list_writings(poetry)); I've also tried that using various methods of
quoting for the list_writings(poetry) and also doing strange things like
making anonymous functions and defining the function as a variable and
what-not.

 2) How did you conclude that? Did you check that
 list_writings(poetry)/list_writings($poetry) gives the correct result? IE
 echo list_writings(poetry)/list_writings($poetry) ?

list_writings(poetry) simply spits out the output. 'echo
list_writings(poetry)' was not designed as the proper way to use the
command. Here is the current code for the function (in its half-complete but
working state with mysql_connect() and mysql_select_db replaced with generic
variables for public consumption), and also the std_layout function
following:

function list_writings($table) {
$db_link = mysql_connect($host, $user, $pw)
or die(DB connect failure);
mysql_select_db ($db_name) ;
$query = SELECT wid, title, description FROM $table ORDER BY wid DESC LIMIT
15;
$result = mysql_query($query, $db_link);
while ($row = mysql_fetch_row ($result))
{
print a href=\/poetry.php?wid=$row[0]\$row[1]/abr;
};
};

function std_layout($ltitle, $ltext) {
echo 
table width=\100%\ align=\top\
  tr
td valign=\top\
  table style=\border-top: 1px solid #00; border-right: 1px solid
#00\ width=\175\
tr
  td bgcolor=#B0C4DE valign=\top\
nbsp; $ltitle
  /td
/tr
tr
  td
$ltext
  /td
/tr
  /table
/td
td valign=\top\ ;
} ;

Basically, I want std_layout to be able to take either straight text as an
argument or the output of a function (even if it's through a mid-point such
as a variable). That failing I'm going to have to admit a design flaw to
myself and re-work the code...

-Jeff
SIG: HUP


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




RE: [PHP] Function passed as argument to function

2002-12-01 Thread John W. Holmes
[snip]
  2) How did you conclude that? Did you check that
  list_writings(poetry)/list_writings($poetry) gives the correct
result?
 IE
  echo list_writings(poetry)/list_writings($poetry) ?
 
 list_writings(poetry) simply spits out the output. 'echo
 list_writings(poetry)' was not designed as the proper way to use the
 command. Here is the current code for the function (in its
half-complete
 but
 working state with mysql_connect() and mysql_select_db replaced with
 generic
 variables for public consumption), and also the std_layout function
 following:
 
 function list_writings($table) {
 $db_link = mysql_connect($host, $user, $pw)
 or die(DB connect failure);
 mysql_select_db ($db_name) ;
 $query = SELECT wid, title, description FROM $table ORDER BY wid DESC
 LIMIT
 15;
 $result = mysql_query($query, $db_link);
 while ($row = mysql_fetch_row ($result))
 {
 print a href=\/poetry.php?wid=$row[0]\$row[1]/abr;
 };
 };

So if you want the result returned, take out that print call. Assign it
all to a variable and return it.

$retval .= a href=\/poetry.php?wid=$row[0]\$row[1]/abr;

and 

return($retval);

at the end of the function. Then you'll be able to do what you want. 

---John Holmes... 



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




RE: [PHP] Date problem

2002-12-01 Thread John W. Holmes
 I want to get date from database, to increment ot decrement it with
some
 days, to show the date and after thath
 if user confirm it to save it to database.

There are a ton of ways you can do it. You can select the date and it's
inc/dec value in the same statement:

SELECT datecol, datecol + INTERVAL 1 DAY FROM yourtable WHERE ...

Display whatever you need, if the user agrees to the new day, then issue
an update query:

UPDATE yourtable SET datecol = datecol + INTERVAL 1 DAY WHERE ...

To make those queries dynamic, you can replace the '1' with a variable
and assign it's value in PHP to either -1, 1, 2, 3, etc...

$inc = -1;

UPDATE yourtable SET datecol = datecol + INTERVAL $inc DAY WHERE ... 

Or...

You can select out the date you have now, use strtotime() to make it
into a unix timestamp (which PHP works with), and date() to format it
however you want. If the user approves the new date, you can reformat
the unix timestamp back to a -MM-DD format with date() or use
FROM_UNIXTIME() in your query to insert/update the new date into the
database...

---John Holmes...



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




RE: [PHP] eregi_replace() function in a script

2002-12-01 Thread John W. Holmes
 $Pattern = (http://)?([^[:space:]]+)([[:alnum:]\.,-_?/=]);
 $Replace = a href=\http://\\2\\3\; target=\_new\\\2\\3/a;
 $Array[URL] = eregi_replace($Pattern, $Replace, $Array[URL]);
 
 print (Your submission--$Array[URL]--has been received!BR\n);

That does no checking or validation at all. It simply tries to replace a
pattern with another one. If the pattern isn't matched, then the
original string is returned unchanged. 

If you want to validate the entry, then check to see if string has
changed at all.

$Pattern = (http://)?([^[:space:]]+)([[:alnum:]\.,-_?/=]);
$Replace = a href=\http://\\2\\3\; target=\_new\\\2\\3/a;
$temp = $Array[URL];
$Array[URL] = eregi_replace($Pattern, $Replace, $Array[URL]);
if(strcmp($temp,$Array[URL])==0)
{ echo You did not enter a good URL address.; }

---John Holmes...



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




Re: [PHP] eregi_replace() function in a script

2002-12-01 Thread Anthony Ritter
Holmes:
That's just the pattern you showed. It may not match anything, so nothing
gets
 replaced with eregi_replace() and hence no active link is created, but
 it may not necessarily cause an error.
.

Right.

The pattern does not match anything in the input string of
$Array[URL]

so the A HREF=/A never appears on output.

Thank you.
TR





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




Re: [PHP] Guestbook

2002-12-01 Thread Jeffrey B. Ferland
 The quick solution, if you intend to continue the autoincrement field, is
to
 number the entries manually when you're displaying them: Something along
the
 lines of:

   $count = 0;
   while ($row(mysql_fetch_array($result_id))) {
 $count++;
 echo Entry $count;
 ...
 ...
   }

The right solution (and not much slower) is to use a different table type
for your DB. Read up on what different tables types in your DB support. Note
that this won't make any difference if the one you're deleting isn't the
last one in the series... there basically isn't a work-around for that which
doesn't eat proc time.

-Jeff
SIG: HUP


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




[PHP] Disable refresh?

2002-12-01 Thread Larry Brown
Anyone know of a method of preventing a user from refreshing a page.  I get
multiple updates with the same information in my database...

Larry S. Brown
Dimension Networks, Inc.
(727) 723-8388




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




Re: [PHP] Method for displaying Downline

2002-12-01 Thread David T-G
Daren --

...and then Daren Cotter said...
% 
% I need to display an entire downline (info about all
% members referred by another member). The query to
...
% The output I need is something like:
% 
%  7
%10 11
%14  16 18  20
%  26  28  31  34 36  38  41  44
% 
% Where 7 referred 10 and 11, 10 referred 14 and 16, 14
...

% 
% I know some sort of looping (possibly recursion?)

That depends on how you have your tables structures.  This is a perfect
opportunity for a binary tree, which is also easy to traverse.  How is
the data stored?


% structure is needed, but I can't figure out how to
% display the output in tables as shown above.

See if you can live with something like

   7
  10  11
  14  16  18  20
  26  28  31  34  36  38  41  44

and then go from there.  That's trivial.

If that won't work, then you can calculate the number of cells you'll
have to have running across the table as 2n+1, where n is the referral
depth, and then calculate the position based on what level and what path.


% 
% Any help would be greatly appreciated!


HTH  HAND

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




msg87970/pgp0.pgp
Description: PGP signature


RE: [PHP] Disable refresh?

2002-12-01 Thread Larry Brown
If not, is there a variable that provides information that a refresh
occurred to load the page?

Larry S. Brown
Dimension Networks, Inc.
(727) 723-8388

-Original Message-
From: Larry Brown [mailto:[EMAIL PROTECTED]]
Sent: Sunday, December 01, 2002 8:23 PM
To: PHP List
Subject: [PHP] Disable refresh?

Anyone know of a method of preventing a user from refreshing a page.  I get
multiple updates with the same information in my database...

Larry S. Brown
Dimension Networks, Inc.
(727) 723-8388




--
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] Disable refresh?

2002-12-01 Thread Martin Towell
no, no way to disable and no variable to say a refresh happened

one way to get around it is to submit to the page that does the update, then
get that page to do a header(location...) to another page. When the user
refreshes, they'll only refresh the last page, and not the updating page.

HTH
Martin

-Original Message-
From: Larry Brown [mailto:[EMAIL PROTECTED]]
Sent: Monday, December 02, 2002 12:33 PM
To: PHP List
Subject: RE: [PHP] Disable refresh?


If not, is there a variable that provides information that a refresh
occurred to load the page?

Larry S. Brown
Dimension Networks, Inc.
(727) 723-8388

-Original Message-
From: Larry Brown [mailto:[EMAIL PROTECTED]]
Sent: Sunday, December 01, 2002 8:23 PM
To: PHP List
Subject: [PHP] Disable refresh?

Anyone know of a method of preventing a user from refreshing a page.  I get
multiple updates with the same information in my database...

Larry S. Brown
Dimension Networks, Inc.
(727) 723-8388




--
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] Disable refresh?

2002-12-01 Thread Larry Brown
Thanks guys this forum is going to get me in trouble.  It is so convenient I
keep asking questions too soon.  After submitting the amendment to the
original question I thought of the solution of setting a session variable
and then clearing it before and after the submittal page.  I'll work the
gray matter a little harder next time before asking.  Thanks again.


Larry S. Brown
Dimension Networks, Inc.
(727) 723-8388

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Sunday, December 01, 2002 8:58 PM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] Disable refresh?

 Anyone know of a method of preventing a user from refreshing a page.  I
 get multiple updates with the same information in my database...

Hello!

You can prevent it multiple ways. Two common solution:

 - When creating form, add a unique id to it in a hidden field.
   After succesful insert put that id into a container table,
   what stores used ids. Before inserting, check the presence of
   that id in that container. You can make unique ids with
   php's uniquid() function, or if mod_unique_id compiled into
   Apache, you can use $_SERVER['UNIQUE_ID'] too. Store expire
   dates too with that ids to be able delete old ids with a
   cronjob.

 - Another way: this is easier, but not too elegant. After
   inserting data, send a location header to browser to
   redirect it from that form-processor page to an another.
   After that, refreshing affects that page.

Heilig (Cece) Szabolcs
[EMAIL PROTECTED] - http://phphost.hu




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




[PHP] RE: XTemplate

2002-12-01 Thread Oleg Krogius
PHP is a templating system already, don't reinvent the wheel and create
a whole new scripting language (which basically smart is - it just
requires php to work).

Regards,
Oleg

-Original Message-
From: Henry [mailto:[EMAIL PROTECTED]] 
Sent: Sunday, December 01, 2002 9:02 AM
To: [EMAIL PROTECTED]
Subject: XTemplate

Hi All,

I'm looking for a way to seperate my HTML from my PHP and database
access
code, I pointed in the direction of XTemplate. After having had a look
at
XTemplate I'm not sure if it is current and stable under PHP 4 Is it
and
if it isn't is there something better to use?

Henry






smime.p7s
Description: application/pkcs7-signature


[PHP] Passing arguments to the same script

2002-12-01 Thread Troy May
Hello,

I'm sure this is easy, but I'm drawing a blank.  I need to have links at the
bottom of the page that passes arguments to the same script (itself) when it
gets reloaded.  How do we do this?

I have the links like this now:

a href=index.php?samples

How do I determine what is passed?  I need to do an if statement with
different outputs depending on the argument.

if ($samples) { do something }

??  But I can't get anything to work.  How do I do it in PHP? (I have no
forms, just links)


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




RE: [PHP] Passing arguments to the same script

2002-12-01 Thread John W. Holmes
 I'm sure this is easy, but I'm drawing a blank.  I need to have links
at
 the
 bottom of the page that passes arguments to the same script (itself)
when
 it
 gets reloaded.  How do we do this?
 
 I have the links like this now:
 
 a href=index.php?samples
 
 How do I determine what is passed?  I need to do an if statement
with
 different outputs depending on the argument.
 
 if ($samples) { do something }

if(isset($_GET['samples']))
{ do something }

---John Holmes...



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




RE: [PHP] Passing arguments to the same script

2002-12-01 Thread Troy May
Thanks for responding.  I think I'm still doing something wrong.  Take a
peek:

if(isset($_GET['questions'])) {
  echo Questions link content will go here;
   }
elseif(isset($_GET['samples'])) {
  echo Samples link content will go here;
   }
elseif(isset($_GET['rates'])) {
  echo Rates link content will be here;
   }
elseif(isset($_GET['contact'])) {
  echo Contact information will go here.;
} else {
echo Main content goes here.;
}

The only thing that EVER gets displayed is the final else. (Main content
goes here.)  What am I doing wrong?  Once again, the links are in this
format: a href=index.php?samples

Any ideas?


-Original Message-
From: John W. Holmes [mailto:[EMAIL PROTECTED]]
Sent: Sunday, December 01, 2002 7:39 PM
To: 'Troy May'; 'PHP List'
Subject: RE: [PHP] Passing arguments to the same script


 I'm sure this is easy, but I'm drawing a blank.  I need to have links
at
 the
 bottom of the page that passes arguments to the same script (itself)
when
 it
 gets reloaded.  How do we do this?

 I have the links like this now:

 a href=index.php?samples

 How do I determine what is passed?  I need to do an if statement
with
 different outputs depending on the argument.

 if ($samples) { do something }

if(isset($_GET['samples']))
{ do something }

---John Holmes...




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




Re: [PHP] Passing arguments to the same script

2002-12-01 Thread Kyle Gibson
Thanks for responding.  I think I'm still doing something wrong.  Take a
peek:

if(isset($_GET['questions'])) {
  echo Questions link content will go here;
		   }
elseif(isset($_GET['samples'])) {
  echo Samples link content will go here;
		   }
elseif(isset($_GET['rates'])) {
  echo Rates link content will be here;
		   }
elseif(isset($_GET['contact'])) {
  echo Contact information will go here.;
} else {
echo Main content goes here.;
}

The only thing that EVER gets displayed is the final else. (Main content
goes here.)  What am I doing wrong?  Once again, the links are in this
format: a href=index.php?samples



This string merely filles the $HTTP_SERVER_VARS[QUERY_STRING] variable.

So you should rather check to see if $HTTP_SERVER_VARS[QUERY_STRING] 
equals 'questions', 'samples', etc...

$_GET['var'] requires that the link look like this:

a href=index.php?page=samples

You could then call $_GET['page'], which would contain the value samples.

--
Kyle Gibson
admin(at)frozenonline.com
http://www.frozenonline.com/


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



RE: [PHP] Passing arguments to the same script

2002-12-01 Thread Chris Wesley
On Sun, 1 Dec 2002, Troy May wrote:

 The only thing that EVER gets displayed is the final else. (Main content
 goes here.)  What am I doing wrong?  Once again, the links are in this
 format: a href=index.php?samples

a href=index.php?samples=1

To get the desired results with the code you posted, you have to give your
query string parameter(s) a value (as above).  If you don't want to give
samples a value, then examine the query string as a whole:
$_SERVER[QUERY_STRING]

if( $_SERVER[QUERY_STRING] == samples ) ...

g.luck,
~Chris


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




RE: [PHP] Passing arguments to the same script

2002-12-01 Thread John W. Holmes
What PHP version are you using? Try $HTTP_GET_VARS['sample'] if it's an
older version. Also try index.php?sample=1, so that sample actually
has a value (although the method I gave you worked on IIS).

---John Holmes...

 -Original Message-
 From: Troy May [mailto:[EMAIL PROTECTED]]
 Sent: Sunday, December 01, 2002 11:02 PM
 To: [EMAIL PROTECTED]; 'PHP List'
 Subject: RE: [PHP] Passing arguments to the same script
 
 Thanks for responding.  I think I'm still doing something wrong.  Take
a
 peek:
 
 if(isset($_GET['questions'])) {
   echo Questions link content will go here;
  }
 elseif(isset($_GET['samples'])) {
   echo Samples link content will go here;
  }
 elseif(isset($_GET['rates'])) {
   echo Rates link content will be here;
  }
 elseif(isset($_GET['contact'])) {
   echo Contact information will go here.;
 } else {
 echo Main content goes here.;
 }
 
 The only thing that EVER gets displayed is the final else. (Main
content
 goes here.)  What am I doing wrong?  Once again, the links are in this
 format: a href=index.php?samples
 
 Any ideas?
 
 
 -Original Message-
 From: John W. Holmes [mailto:[EMAIL PROTECTED]]
 Sent: Sunday, December 01, 2002 7:39 PM
 To: 'Troy May'; 'PHP List'
 Subject: RE: [PHP] Passing arguments to the same script
 
 
  I'm sure this is easy, but I'm drawing a blank.  I need to have
links
 at
  the
  bottom of the page that passes arguments to the same script (itself)
 when
  it
  gets reloaded.  How do we do this?
 
  I have the links like this now:
 
  a href=index.php?samples
 
  How do I determine what is passed?  I need to do an if statement
 with
  different outputs depending on the argument.
 
  if ($samples) { do something }
 
 if(isset($_GET['samples']))
 { do something }
 
 ---John Holmes...
 
 




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




RE: [PHP] Passing arguments to the same script

2002-12-01 Thread Jonathan Sharp
I think you\'d want to use:
if ( $_SERVER[\'QUERY_STRING\'] == \'samples\')
{
// code
}

otherwise if you use , set your links as:
a href=\index.php?samples=1\

-js


On Sun, 1 Dec 2002 22:38:54 -0500 Holmes wrote:
 
 
  I\'m sure this is easy, but I\'m drawing a blank.  I need to have links
 at
  the
  bottom of the page that passes arguments to the same script (itself)
 when
  it
  gets reloaded.  How do we do this?
  
  I have the links like this now:
  
  a href=\index.php?samples\
  
  How do I determine what is passed?  I need to do an \if\ statement
 with
  different outputs depending on the argument.
  
  if ($samples) { do something }
 
 if(isset($_GET[\'samples\']))
 { do something }
 
 ---John Holmes...
 
 
 
 -- 
 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] Passing arguments to the same script

2002-12-01 Thread Jonathan Sharp
I think you\'d want to use:
if ( $_SERVER[\'QUERY_STRING\'] == \'samples\')
{
// code
}

otherwise if you use , set your links as:
a href=\index.php?samples=1\

-js


On Sun, 1 Dec 2002 22:38:54 -0500 Holmes wrote:
 
 
  I\'m sure this is easy, but I\'m drawing a blank.  I need to have links
 at
  the
  bottom of the page that passes arguments to the same script (itself)
 when
  it
  gets reloaded.  How do we do this?
  
  I have the links like this now:
  
  a href=\index.php?samples\
  
  How do I determine what is passed?  I need to do an \if\ statement
 with
  different outputs depending on the argument.
  
  if ($samples) { do something }
 
 if(isset($_GET[\'samples\']))
 { do something }
 
 ---John Holmes...
 
 
 
 -- 
 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] Passing arguments to the same script

2002-12-01 Thread Troy May
Not sure which version, it's my ISP.

Adding =1 to the URL worked though.  Thanks!


-Original Message-
From: John W. Holmes [mailto:[EMAIL PROTECTED]]
Sent: Sunday, December 01, 2002 8:08 PM
To: 'Troy May'; 'PHP List'
Subject: RE: [PHP] Passing arguments to the same script


What PHP version are you using? Try $HTTP_GET_VARS['sample'] if it's an
older version. Also try index.php?sample=1, so that sample actually
has a value (although the method I gave you worked on IIS).

---John Holmes...

 -Original Message-
 From: Troy May [mailto:[EMAIL PROTECTED]]
 Sent: Sunday, December 01, 2002 11:02 PM
 To: [EMAIL PROTECTED]; 'PHP List'
 Subject: RE: [PHP] Passing arguments to the same script
 
 Thanks for responding.  I think I'm still doing something wrong.  Take
a
 peek:
 
 if(isset($_GET['questions'])) {
   echo Questions link content will go here;
  }
 elseif(isset($_GET['samples'])) {
   echo Samples link content will go here;
  }
 elseif(isset($_GET['rates'])) {
   echo Rates link content will be here;
  }
 elseif(isset($_GET['contact'])) {
   echo Contact information will go here.;
 } else {
 echo Main content goes here.;
 }
 
 The only thing that EVER gets displayed is the final else. (Main
content
 goes here.)  What am I doing wrong?  Once again, the links are in this
 format: a href=index.php?samples
 
 Any ideas?
 
 
 -Original Message-
 From: John W. Holmes [mailto:[EMAIL PROTECTED]]
 Sent: Sunday, December 01, 2002 7:39 PM
 To: 'Troy May'; 'PHP List'
 Subject: RE: [PHP] Passing arguments to the same script
 
 
  I'm sure this is easy, but I'm drawing a blank.  I need to have
links
 at
  the
  bottom of the page that passes arguments to the same script (itself)
 when
  it
  gets reloaded.  How do we do this?
 
  I have the links like this now:
 
  a href=index.php?samples
 
  How do I determine what is passed?  I need to do an if statement
 with
  different outputs depending on the argument.
 
  if ($samples) { do something }
 
 if(isset($_GET['samples']))
 { do something }
 
 ---John Holmes...
 
 




-- 
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] Passing arguments to the same script

2002-12-01 Thread Troy May
Thanks, I got it working by adding =1



-Original Message-
From: Chris Wesley [mailto:[EMAIL PROTECTED]]
Sent: Sunday, December 01, 2002 8:08 PM
To: 'PHP List'
Cc: Troy May
Subject: RE: [PHP] Passing arguments to the same script


On Sun, 1 Dec 2002, Troy May wrote:

 The only thing that EVER gets displayed is the final else. (Main content
 goes here.)  What am I doing wrong?  Once again, the links are in this
 format: a href=index.php?samples

a href=index.php?samples=1

To get the desired results with the code you posted, you have to give your
query string parameter(s) a value (as above).  If you don't want to give
samples a value, then examine the query string as a whole:
$_SERVER[QUERY_STRING]

if( $_SERVER[QUERY_STRING] == samples ) ...

g.luck,
~Chris



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




[PHP] header() and target page

2002-12-01 Thread Jami
I am just full of them this weekend. Is it possible to direct a header like a html 
link (i.e. target=_top) ? I have a page that is in a frame, and I want the new page 
that is called to break the frame and load in the entire frame.

Thanks.

Jami



RE: [PHP] header() and target page

2002-12-01 Thread John W. Holmes
 I am just full of them this weekend. Is it possible to direct a header
 like a html link (i.e. target=_top) ? I have a page that is in a
frame,
 and I want the new page that is called to break the frame and load in
the
 entire frame.

Nope. Use JavaScript.

---John Holmes...



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




[PHP] RV: includes globals

2002-12-01 Thread Cesar Aracena
Hi all,

I'm making a site with a dynamic menu based on IF statements and DB
queries, but have this little problem which I can't understand the
reason. My programming method is based upon an application.php file
which controls the hole site and paths, template files for the header 
footer and main PHP files which includes all the needed files that I
mentioned before.

As an example of this, the header TITLE tag has a ?=$TITLE? variable
to take a different title for each page and after that, I put a
$LOCATION variable to tell the menu() function which page is being
displayed (different menus for products, about us, etc.) but the menu()
function (fetched from a library) is not recognizing this $LOCATION
variable. I'm declaring it as a GLOBAL inside the function, but nothing
happens. Here's part of my code:

This is part of my product's index.php file:

SNIP

?

require (../application.php);
$TITLE = Joyería Mara;
$LOCATION = ;
include ($CFG-templatedir/header.inc);

?
TR
TD VALIGN=top
P!--COMIENZO DE CUERPO--TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0
WIDTH=100% HEIGHT=100% TR TD VALIGN=top WIDTH=200 PTABLE
BORDER=0 CELLSPACING=0 CELLPADDING=15 WIDTH=100% TR TD ?

menu();

?

/SNIP

===

And this is the menu() function:

SNIP

function menu(){
GLOBAL $LOCATION;
if ($LOCATION = productos){
GLOBAL $MENU_NAME, $MENU_BACK, $MENU_LINK, $CFG;
$MENU_NAME = Nosotros;
$MENU_LINK = .$CFG-wwwroot./nosotros;
$MENU_BACK = 66;
menu_def();
unset($GLOBALS['MENU_BACK'], $GLOBALS['MENU_NAME'],
$GLOBALS['MENU_LINK']);

GLOBAL $MENU_NAME, $MENU_BACK, $MENU_LINK;
$MENU_NAME = Productos;
$MENU_LINK = .$CFG-wwwroot./productos;
$MENU_BACK = 99;
menu_def();
unset($GLOBALS['MENU_BACK'], $GLOBALS['MENU_NAME'],
$GLOBALS['MENU_LINK']);

GLOBAL $MENU_NAME, $MENU_BACK, $MENU_LINK;
$MENU_NAME = Regístrese;
$MENU_LINK = .$CFG-wwwroot./registrese;
$MENU_BACK = 66;
menu_def();
unset($GLOBALS['MENU_BACK'], $GLOBALS['MENU_NAME'],
$GLOBALS['MENU_LINK']);

GLOBAL $MENU_NAME, $MENU_BACK, $MENU_LINK;
$MENU_NAME = Contacto;
$MENU_LINK = .$CFG-wwwroot./contacto;
$MENU_BACK = 66;
menu_def();
unset($GLOBALS['MENU_BACK'], $GLOBALS['MENU_NAME'],
$GLOBALS['MENU_LINK']); } else if ($LOCATION = nosotros){ echo hi; }
else{ echo none; } }

/SNIP

==

Any thoughts? Thanks

Cesar L. Aracena
[EMAIL PROTECTED]
[EMAIL PROTECTED]
(0299) 156-356688
Neuquén (8300) Capital
Argentina




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




[PHP] Re: [PHP-INST] OS X and Curl Issues

2002-12-01 Thread Randall Perry
I've got curl 7.10 and am getting the same error on Mac OS 10.2.2 server.
Here's my config:

./configure --with-apxs=/usr/sbin/apxs --with-pgsql --with-xml
--with-openssl=/usr/local/ssl --with-pear --with-curl=/usr/lib/curl


Here's curl:

[systame:local/src/php-4.2.3] randy% /usr/bin/curl -V
curl 7.10 (powerpc-apple-darwin6.2) libcurl/7.10 ipv6 zlib/1.1.3


Here's the error:

checking for CURL support... yes
checking for CURL in default path... found in /usr/local
found in /usr
checking for cURL 7.9 or greater... configure: error: cURL version 7.9 or
later is required to compile php with cURL support

 
 I'm working on getting the following install working under OS 10.2.2:
 
 ./configure --prefix=/usr \
 --sysconfdir=/etc \
 --localstatedir=/var \
 --mandir=/usr/share/man \
 --with-apxs=/usr/sbin/apxs \
 --with-mysql \
 --with-gd=/usr/local \
 --with-png-dir=/usr/local \
 --with-zlib-dir=/usr/local \
 --with-jpg-dir=/usr/local \
 --with-freetype-dir=/usr/local \
 --enable-trans-sid \
 --enable-exif \
 --enable-ftp \
 --enable-calendar \
 --with-curl=/usr/lib \
 --with-flatfile \
 --with-ming=/Users/whoughto/src/ming-0.2a \
 --enable-sockets \
 --with-jave=/Library/Java/Home \
 --with-xml
 
 And Curl keeps throwing me the following error, but as you can see, I
 do indeed have 7.9.8 installed. Any ideas?
 
 checking for CURL support... yes
 checking for CURL in default path... found in /usr
 checking for cURL 7.9.8 or greater... configure: error: cURL version
 7.9.8 or later is required to compile php with cURL support
 [user/src/php4rc2] root# curl --help
 curl 7.9.8 (powerpc-apple-darwin5.5) libcurl 7.9.8
 
 Thanks,
 Wes
 

-- 
Randall Perry
sysTame

Xserve Web Hosting/Co-location
Website Development/Promotion
Mac Consulting/Sales

http://www.systame.com/



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




[PHP] Re: [PHP-INST] OS X and Curl Issues

2002-12-01 Thread Weston Houghton

I found two main things that were hampering my install.

1. While I thought I had updated cURL, I believe I may have only 
upgraded the executable itself the first time, while leaving the 
libraries themselves at an older version.

2. OS X install cURL with a prefix of /usr, whereas the standard cURL 
install uses /usr/local. /usr has a higher preference in the 
compiler/linker's environment path, so it continues to use the old 
version if you do not change the prefix of the new cURL.

The solution is just to grab the new cURL, then configure and make it. 
I used a configure of:
./configure --prefix=/usr --with-ssl

Then went ahead with my php install, and everything outside of 
phpMagick worked great, and that subject is a whole different story.

Good luck,
Wes


On Sunday, December 1, 2002, at 07:31  PM, Randall Perry wrote:

I've got curl 7.10 and am getting the same error on Mac OS 10.2.2 
server.
Here's my config:

./configure --with-apxs=/usr/sbin/apxs --with-pgsql --with-xml
--with-openssl=/usr/local/ssl --with-pear --with-curl=/usr/lib/curl


Here's curl:

[systame:local/src/php-4.2.3] randy% /usr/bin/curl -V
curl 7.10 (powerpc-apple-darwin6.2) libcurl/7.10 ipv6 zlib/1.1.3


Here's the error:

checking for CURL support... yes
checking for CURL in default path... found in /usr/local
found in /usr
checking for cURL 7.9 or greater... configure: error: cURL version 7.9 
or
later is required to compile php with cURL support


I'm working on getting the following install working under OS 10.2.2:

./configure --prefix=/usr \
--sysconfdir=/etc \
--localstatedir=/var \
--mandir=/usr/share/man \
--with-apxs=/usr/sbin/apxs \
--with-mysql \
--with-gd=/usr/local \
--with-png-dir=/usr/local \
--with-zlib-dir=/usr/local \
--with-jpg-dir=/usr/local \
--with-freetype-dir=/usr/local \
--enable-trans-sid \
--enable-exif \
--enable-ftp \
--enable-calendar \
--with-curl=/usr/lib \
--with-flatfile \
--with-ming=/Users/whoughto/src/ming-0.2a \
--enable-sockets \
--with-jave=/Library/Java/Home \
--with-xml

And Curl keeps throwing me the following error, but as you can see, I
do indeed have 7.9.8 installed. Any ideas?

checking for CURL support... yes
checking for CURL in default path... found in /usr
checking for cURL 7.9.8 or greater... configure: error: cURL version
7.9.8 or later is required to compile php with cURL support
[user/src/php4rc2] root# curl --help
curl 7.9.8 (powerpc-apple-darwin5.5) libcurl 7.9.8

Thanks,
Wes



--
Randall Perry
sysTame

Xserve Web Hosting/Co-location
Website Development/Promotion
Mac Consulting/Sales

http://www.systame.com/



--
PHP Install 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: [PHP-INST] OS X and Curl Issues

2002-12-01 Thread Randall Perry
Got it working. First I removed every curl binary and library I could find
(had 3 sets, 1 from apple's installation, 1 from my compile, and 1 from a
Fink compile I did).

Then I configured curl to use Apple's paths, made, and installed:

- cd curl-7.10
- ./configure --prefix=/usr
- make
- sudo make install


Then, configure, make php_4.2.3:

- ./configure --with-apxs=/usr/sbin/apxs --with-pgsql --with-xml
  --with-openssl=/usr/local/ssl --with-pear --with-curl=/usr/lib


 I've got curl 7.10 and am getting the same error on Mac OS 10.2.2 server.
 Here's my config:
 
 ./configure --with-apxs=/usr/sbin/apxs --with-pgsql --with-xml
 --with-openssl=/usr/local/ssl --with-pear --with-curl=/usr/lib/curl
 
 
 Here's curl:
 
 [systame:local/src/php-4.2.3] randy% /usr/bin/curl -V
 curl 7.10 (powerpc-apple-darwin6.2) libcurl/7.10 ipv6 zlib/1.1.3
 
 
 Here's the error:
 
 checking for CURL support... yes
 checking for CURL in default path... found in /usr/local
 found in /usr
 checking for cURL 7.9 or greater... configure: error: cURL version 7.9 or
 later is required to compile php with cURL support
 

-- 
Randall Perry
sysTame

Xserve Web Hosting/Co-location
Website Development/Promotion
Mac Consulting/Sales

http://www.systame.com/



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




Re: [PHP] RV: includes globals

2002-12-01 Thread Tom Rogers
Hi,

Monday, December 2, 2002, 4:06:54 PM, you wrote:
CA Hi all,

CA I'm making a site with a dynamic menu based on IF statements and DB
CA queries, but have this little problem which I can't understand the
CA reason. My programming method is based upon an application.php file
CA which controls the hole site and paths, template files for the header 
CA footer and main PHP files which includes all the needed files that I
CA mentioned before.

CA As an example of this, the header TITLE tag has a ?=$TITLE? variable
CA to take a different title for each page and after that, I put a
CA $LOCATION variable to tell the menu() function which page is being
CA displayed (different menus for products, about us, etc.) but the menu()
CA function (fetched from a library) is not recognizing this $LOCATION
CA variable. I'm declaring it as a GLOBAL inside the function, but nothing
CA happens. Here's part of my code:

CA This is part of my product's index.php file:

CA SNIP
 Your if statements should be like this:

 if ($LOCATION == productos) //needs the double '=' sign

 otherwise $LOCATION is always set to  productos


-- 
regards,
Tom


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




[PHP] Why all the returned emails from this list?

2002-12-01 Thread Troy May
I'm getting nailed with a bunch of returned emails like this:

[EMAIL PROTECTED] - no such user here.

There is no user by that name at this server.
: Message contains [1] file attachments


What's going on?  Each one has a different address, but the terminalgmb.ru
part is the same for each one.


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





[PHP] Dynamically Adding methods to an object

2002-12-01 Thread Brian Takita
Hello,

I want to add a method to an existing object. Any ideas how to?

I tried using

foreach($this-modules-$module_name-methods as $mod_method =
$method_name) {
$function = '$args = implode(,, func_get_args());';
$function .= 'return
mod_'.$module_name.'::'.$mod_method.'($args);';

$lambda = create_function('', $function);
$lambda(1);
$this-$method_name = $lambda;
}

The error I got was Fatal error: func_get_args(): Can't be used as a
function parameter in ...: runtime-created function on line 1 when I called
$lambda()

Is there a way I can know the arguments of a defined method without calling
the method?

Thank you,
Brian Takita



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




[PHP] some data output formatting and grouping question...

2002-12-01 Thread Victor
I just have a fucking mental block; I cannot at all conceive the
necessary syntax to or even the theoretical algorithm that I need, to do
the following:

Consider the following table:

U | X | Y 
--|---|--
me|001|0a
me|002|0a
me|003|0a
me|002|0b
me|003|0b
me|004|0b
..|...|..

then the code says:

SELECT * FROM Y WHERE U = me

So now what?
- remember I do not know the value of Y, so it has to be an automatic
thing; I can't just say ... WHERE U = me AND Y = a.

I want this output:

0a
001
002
003
___ (hr)

0b
002
003
004 

How the hell do I do that? I can't think of the goddamn' syntax!

__ 
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