Re: [PHP] Sorting files in a directory

2007-08-09 Thread Chad Robinson

Steve Marquez wrote:

I know this code does not work, but I was curious if someone can take a look
and tell me what is wrong? Thank you so much.
  

Re-indent your code properly. If you do it will look like:

";
   while (($file = readdir($dh)) !== false) {
   if (ereg($pattern, $file))
   if(strpos($file,'.')>0) {
   $file_array = array($file);
   sort ($file_array);

   foreach($file_array as $key => $value) {
   echo "".$value."";
   }
   }
   }
   echo "";
   closedir($dh);
   }
   }
?>

You have a number of things you need to look at here. First, you don't have a final 
closing brace for your opening if() statement. Second, you're outputting the 
 tags INSIDE the while loop that reads the directory, so for every file 
you read your options list will get bigger. Well, it would, but you're also not using 
the right array append method; it should be:
   $file_array[] = $file;

Next, you don't want to sort the array every time you add a file to it - just 
do it once when you're done.

Try this:
';
   while (($file = readdir($dh)) !== false) {
   if (!ereg($pattern, $file)) continue;
   if(strpos($file,'.')<1) continue;
   $file_array[] = $file;
   }

   sort ($file_array);
   foreach($file_array as $value) {
   echo '' . $value . '';
   }
   echo "";
   closedir($dh);
}
?>

Syntax check is left as an exe3rcise for the student. =)

Regards,
Chad

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



Re: [PHP] Premature Ajax-ulation

2007-08-03 Thread Chad Robinson

Jay Blanchard wrote:

One of my developers saw the following article;

http://arstechnica.com/news.ars/post/20070802-security-experts-warn-deve
lopers-about-the-risks-of-premature-ajax-ulation.html

How are you securing Ajax? I know that for the most part we send data to
a PHP script for processing, so all of the normal rules for sending that
data apply (mysql_real_escape_string(), etc.)
  
We secure AJAX the way we do anything that might take form input. We use 
intval() and floatval() on numeric fields to flat-out prevent text 
entry, we add slashes to strings where appropriate, check lengths and 
ranges, and do various other sanity checks. Other than being out of band 
and invisible to the user as a direct act, we don't see how AJAX is any 
different from normal form GET/POST work.


I do agree with the article that some programmers put too much logic in 
the client side, but that's always been an issue, with or without AJAX. 
Remember the days when early shopping carts would store item prices on 
the client side, and use that data during checkout? You could edit your 
local data and knock $20 off an item. That sort of thing. You NEVER 
trust the client. Ever. You assume it simply cannot ever be completely 
secured. Period. Seeing something like this just shows me a developer 
that trusted the client, and it doesn't particularly surprise me when 
they get burned.


Regards,
Chad

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



Re: [PHP] Includes eating up my time

2007-07-31 Thread Chad Robinson

Dave M G wrote:

Currently, my processes are taking under a second, but they can be
around half a second or more. Although it all happens too fast for me to
really notice as a person, it seems to me that a half second of
processing time might be kind of long and lead to scalability problems.
  
That's hardly the worst performance I've seen from a CMS, but you should 
know that nearly all CMS systems are slow, many slower than this, for 
similar reasons. The solution is usually to build a front-end cache, 
either in the CMS itself or using an external tool. For instance, MODx 
caches internally, while others rely on Apache/Enfold/etc.

My first question is: Is a half second too long? I'm pretty sure it is,
but maybe I'm just being paranoid. What do people consider to be
acceptable time frames for processing a web page similar to what
Wikipedia delivers?
  
When you quote Wikipedia, you do realize that they're not a CMS, right, 
that they're a Wiki? There are some subtle differences. I haven't looked 
at Wikipedia's Wiki code (I like TWiki) but the Wikis I've used don't 
actually use a database or a billion classes to get their work done. 
They're more focused on editing an entire page of static content, which 
is stored on disk (and thus directly accessible by the server).


If you want that kind of scalability you also MUST implement some sort 
of caching. PHP is a scripting language, and no scripting language will 
ever keep up with compiled code, no matter how good (and PHP is good). 
You might also consider looking at the Zend Optimizer - I've never tried 
it, but have heard good things.

My second question is: Is there a systematic way of determining how to
incrementally include files that people use? Or is it just a constant
process of testing and checking?
  
PHP does have an auto-include system called the autoloader. We use this 
heavily in Blackbird ESB to load classes on the fly when they're 
referenced. It only works for loading classes, but since you say that's 
what you have... Take a look here:

http://us.php.net/autoload

Regards,
Chad

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



Re: [PHP] Authentication

2007-07-27 Thread Chad Robinson

Dan Shirah wrote:

My application is only used within my company. I want to pull the NT
Authenticated user that is logged in, cross reference that user with what I
have pulled from ldap and verify the user's name is valid. If the username
is valid I will assign it to a variable and use that variable to store the
name of the user that submitted the requests.

Yes, I am trying to get a single sign on method if possible.

 $_SERVER['REMOTE_ADDR'] works in bringing back the IP Address of the
computer I'm kaing the request from, but $_SERVER['REMOTE_USER'] does not
return anything.
  
There's an ActiveX component floating around that will pull this 
information from the user's PC and make it available so Javascript can 
get it (and then pass it on to you). You have to instruct each user's 
browser to consider your site in the trusted zone, but it works fine 
after that. This is how Microsoft does SSO in their own browser.


I didn't actually read too much into this link, but it might get you going:
http://archives.devshed.com/forums/php-windows-119/newb-get-username-that-is-currently-logged-in-to-windows-1765301.html

Basically, having the user put your site into the 'Trusted' zone allows 
Javascript to call out to things, which it can't do with default 
security settings.


After you get it, then you have to pass it to the server. If you want to 
get this automatically, make the entry page (index/default/whatever) run 
this javascript work, then at the tail end of it redirect the user to 
the login page using a GET or POST query to pass in the username. If it 
fails to get the username the login page can then just ask for it.


At least, maybe it will give you enough to Google now.

Regards,
Chad

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



Re: [PHP] import spreadsheet

2007-07-27 Thread Chad Robinson

Angelo Zanetti wrote:

Hi guys

Does anyone have any resources or links as to how to import a
spreadsheet but it might have different number of columns and many
sheets (those tab things at the bottom).

What I thought of doing was creating a table that has 10 fields and if
the file thats being imported only has 4 fields then the remaining six
fields are blank.

So basically my script must dynamically take the format (which changes)
and try save it in the database in a semi standard format.
  

If you're trying to be completely generic, why not have a table like:
   cells {
  id,   - Auto increment, auto assign by DB
  file, - The file the sheet came from, if you're going to 
store more than one

  sheet, - The name of the sheet the cell is on
  column,   - The column the cell is in
  row, - The row the cell is in
  value  - The value or formula of the cell
  primary key(id), key (file, sheet, column, row), key(file, 
sheet), etc.

   }

Then you can write your importer to go through every sheet/row/column 
and add cells to your database for each. Obviously, you don't bother to 
add empty cells. Once this is done, you can do things like:

   Get a cell directly:
   select * from cells where file='f' and sheet='x' and column='y' and 
row=z


   Get an entire column:
   select * from cells where file='f' and sheet='x' and row=z

   Get an entire row:
   select * from cells where file='f' and sheet='x' and column='y'

   Get a list of the available columns in a sheet:
   select distinct column from cells where file='f' and sheet='x' order 
by column


   Get a list of the sheets in use:
   select distinct sheet from cells where file='f' and order by sheet

And so forth. The nice thing about this format is that it makes it 
really easy to do interesting things like write a Web front-end to 
spreadsheet data. You could have a little form that queries the list of 
files, and lets the user pick which they want. Then, for that file, you 
get the list of sheets. Once they select those, you get a list of all 
rows/columns in the sheet and use it to set up your table, and populate 
your grid with cells. With the above data structure, that's a few 
minutes' work.


Regards,
Chad


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



Re: [PHP] Smarty template for parent-child form

2007-07-24 Thread Chad Robinson
Man-wai Chang wrote:
> Is there a template that presents a parent-child
> forms, for example, an invoice object which has a header(invoice no,
> date, customer code, invoice total) and multiple items (item no, item
> name, quantity, price, amount)?
>   
Go to http://smarty.php.net/manual/en/language.function.foreach.php

What you do is assign the items to an array called, say, items. Then you
use "foreach" in the template to iterate the array, just like you would
in PHP itself. Example 7-8 (Contacts) is pretty close to what you're doing.

Regards,
Chad

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



[PHP] Problem Removing Text Updater Password

2004-08-04 Thread Chad Daniel
 am new to PHP and I am having a problem removing a password restriction
from a simple Text Updater script (below). I have a bunch of files that need
to be protected  and I am planning to use .htaccess, but this script calls
for the password to be input before allowing the update (redundant for my
purposes). Any help would be very much appreciated. Thank you. My e-mail
address is [EMAIL PROTECTED]

="4.1.0"){
  extract($_POST);
  extract($_GET);
  extract($_SERVER);
}
$lines = @file($logfile);
if ($action) {
 if ($REQUEST_METHOD != "POST") die("Invalid posting.");
 if (!$pass) die("Please input password.");
 if (isset($pass) && $pass != $password) die("Incorrect password.");
}
switch ($action) {
case 'prev':
if (empty($com)) $err="Please input text";
if (get_magic_quotes_gpc()) {
$com = stripslashes($com);
}
$com = str_replace("\r\n", "\r", $com);
$com = str_replace("\r", "\n", $com);
$com = str_replace("\n\n", "", $com);
$com = str_replace("\n", "", $com);
$com = str_replace("\t", "", $com);
echo $com;
echo <<$err
















EOB;
break;
### UPDATING LOG FILE ###
case 'update':
if (get_magic_quotes_gpc()) {
 $com = stripslashes($com);
}
$fp = fopen($logfile, "w");
flock($fp, LOCK_EX);
fputs($fp, $com);
fclose($fp);
echo <<
Successfully updated.




EOF;
break;
### UPDATING LOG FILE ###
case 'edit':
if (get_magic_quotes_gpc()) {
 $ecom = stripslashes($ecom);
 $ecom = str_replace("", "\n", $ecom);
 $ecom = str_replace("", "\n\n", $ecom);
}
case 'admin':
$ecom = $lines[0];
$tcom = $ecom;
if (get_magic_quotes_gpc()) {
 $ecom = str_replace("", "\n", $ecom);
 $ecom = str_replace("", "\n\n", $ecom);
}
// TEXT FORM
echo <<




TEXT FORM

$ecom



EOD;
break;
default:
$ecom = $lines[0];
$tcom = $ecom;
echo "
  
  
  ";
echo $tcom;
}
;
?>

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



[PHP] PHP Mailing list software..

2003-06-06 Thread Chad Day
Can anyone make a recommendation for me?  I'm looking to tie mailing lists
in to my existing site, which is coded in php/mysql.  I would be looking for
a script that has browseable archives, ability to restrict access to them to
subscribers only, and the ability to send mail to the list a web form, which
would require a u/p stored in mysql, preferably in md5 format.  I know I'll
have to do a lot of customization to get it to integrate into my site, but
I'm looking for a solid script that I need to tweak the least.  Any
suggestions?

Thanks,
Chad Day


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



Re: [PHP] Is the problem a server setting?

2003-03-10 Thread Chad Henderson
Thanks for the reply Mark,

allow_url_fopen is set to on
i did not see anything about --disable-url-fopen-wrapper

Here is the info file:
http://www.afgaonline.com/phpinfo.php




"Mark Heintz Php Mailing Lists" <[EMAIL PROTECTED]> wrote in
message news:[EMAIL PROTECTED]
It sounds like either allow_url_fopen is set to false or php was compiled
with --disable-url-fopen-wrapper.  Either way, checking the output of
phpinfo() should give you your answer.

mh.

On Mon, 10 Mar 2003, Chad Henderson wrote:

> Thanks for the reply. If they did upgrade PHP, which I am fairly sure they
> did, are there changes to the new PHP that would prevent the script from
> working?  Or is it a matter of them not setting up the upgrade the same as
> the previous installation?
>
>
>
> "Ray Hunter" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> You should contact the web hosting system administrator and verify that
> they upgraded php.  From what i can tell it seems that they did upgrade
> php.
>
> --
> Ray
>
> On Mon, 2003-03-10 at 10:58, Chad Henderson wrote:
> > I have a number of websites that are on a hosting company, that I have
> been
> > using for a year or so. Suddenly, this morning, all of the websites
began
> to
> > have PHP script errors on scripts that have run without fail for a long
> > period of time. I think the server setup must have been altered this
> weekend
> > but do not know how to look for or prove this. Any ideas would be
greatly
> > appreciated.
> >
> > Here is the error you get when you try to load http://www.afgaonline.com
> >
> > --paste--
> >
> > Warning: file(http://www.afgaonline.com/templates/tem4.tem)
> [function.file]:
> > failed to create stream: HTTP request failed! ¿¯wT in
> > /home/afgaonli/public_html/includes/Template.php on line 15
> >
> >  --end paste --
> >
> > The text that follows failed! above always changes.
> >
> > Here is the code that is failing:
> >
> > 12function Template ($template)
> > 13 {
> > 14   $this->template = $template;
> > 15   $this->html = implode ("",(file($this->template)));
> > 16 }
> >
> > What should I look for?
> > thanks!
> >
> > Chad



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



Re: [PHP] Is the problem a server setting?

2003-03-10 Thread Chad Henderson
I did not see the

"Mark Heintz Php Mailing Lists" <[EMAIL PROTECTED]> wrote in
message news:[EMAIL PROTECTED]
It sounds like either allow_url_fopen is set to false or php was compiled
with --disable-url-fopen-wrapper.  Either way, checking the output of
phpinfo() should give you your answer.

mh.

On Mon, 10 Mar 2003, Chad Henderson wrote:

> Thanks for the reply. If they did upgrade PHP, which I am fairly sure they
> did, are there changes to the new PHP that would prevent the script from
> working?  Or is it a matter of them not setting up the upgrade the same as
> the previous installation?
>
>
>
> "Ray Hunter" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> You should contact the web hosting system administrator and verify that
> they upgraded php.  From what i can tell it seems that they did upgrade
> php.
>
> --
> Ray
>
> On Mon, 2003-03-10 at 10:58, Chad Henderson wrote:
> > I have a number of websites that are on a hosting company, that I have
> been
> > using for a year or so. Suddenly, this morning, all of the websites
began
> to
> > have PHP script errors on scripts that have run without fail for a long
> > period of time. I think the server setup must have been altered this
> weekend
> > but do not know how to look for or prove this. Any ideas would be
greatly
> > appreciated.
> >
> > Here is the error you get when you try to load http://www.afgaonline.com
> >
> > --paste--
> >
> > Warning: file(http://www.afgaonline.com/templates/tem4.tem)
> [function.file]:
> > failed to create stream: HTTP request failed! ¿¯wT in
> > /home/afgaonli/public_html/includes/Template.php on line 15
> >
> >  --end paste --
> >
> > The text that follows failed! above always changes.
> >
> > Here is the code that is failing:
> >
> > 12function Template ($template)
> > 13 {
> > 14   $this->template = $template;
> > 15   $this->html = implode ("",(file($this->template)));
> > 16 }
> >
> > What should I look for?
> > thanks!
> >
> > Chad



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



Re: [PHP] Is the problem a server setting?

2003-03-10 Thread Chad Henderson
Thanks for the reply. If they did upgrade PHP, which I am fairly sure they
did, are there changes to the new PHP that would prevent the script from
working?  Or is it a matter of them not setting up the upgrade the same as
the previous installation?



"Ray Hunter" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
You should contact the web hosting system administrator and verify that
they upgraded php.  From what i can tell it seems that they did upgrade
php.

--
Ray

On Mon, 2003-03-10 at 10:58, Chad Henderson wrote:
> I have a number of websites that are on a hosting company, that I have
been
> using for a year or so. Suddenly, this morning, all of the websites began
to
> have PHP script errors on scripts that have run without fail for a long
> period of time. I think the server setup must have been altered this
weekend
> but do not know how to look for or prove this. Any ideas would be greatly
> appreciated.
>
> Here is the error you get when you try to load http://www.afgaonline.com
>
> --paste--
>
> Warning: file(http://www.afgaonline.com/templates/tem4.tem)
[function.file]:
> failed to create stream: HTTP request failed! ¿¯wT in
> /home/afgaonli/public_html/includes/Template.php on line 15
>
>  --end paste --
>
> The text that follows failed! above always changes.
>
> Here is the code that is failing:
>
> 12function Template ($template)
> 13 {
> 14   $this->template = $template;
> 15   $this->html = implode ("",(file($this->template)));
> 16 }
>
> What should I look for?
> thanks!
>
> Chad
>
>
>
>
> --
> 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] Is the problem a server setting?

2003-03-10 Thread Chad Henderson
I have a number of websites that are on a hosting company, that I have been
using for a year or so. Suddenly, this morning, all of the websites began to
have PHP script errors on scripts that have run without fail for a long
period of time. I think the server setup must have been altered this weekend
but do not know how to look for or prove this. Any ideas would be greatly
appreciated.

Here is the error you get when you try to load http://www.afgaonline.com

--paste--

Warning: file(http://www.afgaonline.com/templates/tem4.tem) [function.file]:
failed to create stream: HTTP request failed! ¿¯wT in
/home/afgaonli/public_html/includes/Template.php on line 15

 --end paste --

The text that follows failed! above always changes.

Here is the code that is failing:

12function Template ($template)
13 {
14   $this->template = $template;
15   $this->html = implode ("",(file($this->template)));
16 }

What should I look for?
thanks!

Chad




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



[PHP] Reading remote image into a file and displaying..

2003-02-20 Thread Chad Day
I'm trying to get weather channel information without using their form to
submit the zip code .. the url format is :

http://oap.weather.com/fcgi-bin/oap/generate_magnet?loc_id=$ZIP&code=689861&;
destination=$ZIP

so I tried:

$weatherfile =
readfile("http://oap.weather.com/fcgi-bin/oap/generate_magnet?loc_id=$_SESSI
ON[ZIP]&code=689861&destination=$_SESSION[ZIP]");
echo $weatherfile;

but of course it just outputs the raw image data .. I tried echoing it out
in a img src tag, same result.  Is there some function I'm unaware of that
will help me out here?

Thanks,
Chad


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




[PHP] problem with mysql / auto increment fields.. ?

2003-02-19 Thread Chad Day
On my website there are a couple places where people can sign up ..

The querys after the sign up process look like

$blahblah = query(insert firstname lastname) values (blah blah blah)
$userid = mysql_insert_id($blahblah);

$insertintoothertable = query(userid, blah blah blah) etc.

it then uses this userid var to insert them into a variety of other tables
for other things on the site, such as a phpBB account, etc.

if multiple people are signing up for accounts at different places, is there
the possibility that a duplicate userid could be assigned, or anything like
that?

Thanks,
Chad


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




RE: [PHP] setcookie() in various browsers.. 3rd followup.. anyone?

2003-02-11 Thread Chad Day
This is with PHP 4.2 and register_globals off.

I am setting cookies and starting a session in the following fashion:

setcookie("EMAILADDR", $row[EMAIL], time()+2592000, '/', ".$dn");

where $dn = mydomain.com

I want the cookies accessible sitewide .. at www.mydomain.com, mydomain.com,
forums.mydomain.com, etc.

in IE 5.5, IE 6.0, and NS 7.0, it seems this is being accomplished
correctly.

In NS 4.8 (and 4.7 I assume), the cookies are never even getting set.  Can
anyone tell me as to why?  I've been prodding around cookie docs and trying
to find something that works in all browsers, and a lot of people seem to
have the same question..

Thanks!
Chad



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




RE: [PHP] setcookie() in various browsers..

2003-02-10 Thread Chad Day
Following up from Friday.. no replies over the weekend.. can anyone help?

Thanks,
Chad

-Original Message-
From: Chad Day [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 07, 2003 3:02 PM
To: php general
Subject: [PHP] setcookie() in various browsers..


This is with PHP 4.2 and register_globals off.

I am setting cookies and starting a session in the following fashion:

setcookie("EMAILADDR", $row[EMAIL], time()+2592000, '/', ".$dn");

where $dn = mydomain.com

I want the cookies accessible sitewide .. at www.mydomain.com, mydomain.com,
forums.mydomain.com, etc.

in IE 6.0, and NS 7.0, it seems this is being accomplished correctly.

In NS 4.8, the cookies are never even getting set.  Can anyone tell me as to
why?  I've been prodding around cookie docs and trying to find something
that works in all browsers, and a lot of people seem to have the same
question..

Thanks!
Chad



--
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] Limit the amount of returns in a MySQL query

2003-02-07 Thread Chad Day
if (!isset($startlimit)) {
$startlimit = 0;
}

$endlimit = $startlimit + 10;

$yourquery = "your query data LIMIT $startlimit, $endlimit"

that should give you enough insight on how to work it.

Chad

-Original Message-
From: Daniel Page [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 07, 2003 3:53 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Limit the amount of returns in a MySQL query


Hi All,

Imagine I have a giant database table tracking email addresses (I don't but
it is the first example that jumps to mind after my recent antispam
campaign!).

If i do a
 select * from mailaddresses;
I will get all of the table.
If i do a
 select * from mailaddresses where id < 10;
I will get all the records where the id is less than 10...

The problem is that I want 10 records, period, so if id is not a primary
key, I could have 60 records that match... or if it is a P.K., but I delete
2 to 8, it will only return 2 records (1 and 9...)

How can I structure the query to only return only 10 records ? the idea
being able to construct a query where if there are more than 10 (or x)
results on a page, you click on a link 'page 2' and so on, and the next
query will return the next 10 (or x) records...


Cheers,
Daniel



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



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




[PHP] setcookie() in various browsers..

2003-02-07 Thread Chad Day
This is with PHP 4.2 and register_globals off.

I am setting cookies and starting a session in the following fashion:

setcookie("EMAILADDR", $row[EMAIL], time()+2592000, '/', ".$dn");

where $dn = mydomain.com

I want the cookies accessible sitewide .. at www.mydomain.com, mydomain.com,
forums.mydomain.com, etc.

in IE 6.0, and NS 7.0, it seems this is being accomplished correctly.

In NS 4.8, the cookies are never even getting set.  Can anyone tell me as to
why?  I've been prodding around cookie docs and trying to find something
that works in all browsers, and a lot of people seem to have the same
question..

Thanks!
Chad



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




[PHP] Sorting multidimensional arrays..

2003-01-30 Thread Chad Day
I'm struggling with array_multisort, was hoping someone could give me some
help.

I have a multidim array, such as:

$myarray[0][FIRSTNAME] = JOE
$myarray[1][FIRSTNAME] = TIM
$myarray[2][FIRSTNAME] = BOB

$myarray[0][LASTNAME] = SMITH
$myarray[1][LASTNAME] = BROWN
$myarray[2][LASTNAME] = JONES

$myarray[0][EXTENSION] = 2000
$myarray[1][EXTENSION] = 4000
$myarray[2][EXTENSION] = 1000

I was trying array_multisort($myarray[EXTENSION], SORT_NUMERIC, SORT_DESC),
but nothing seems to be happening to the array.  If anyone has any clues or
can point me in the right direction, I would appreciate it.

Thanks,
Chad


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




[PHP] security question regarding including files..

2003-01-21 Thread Chad Day
I want to give my users the ability to submit a URL to a database, then when
they pull up their page, their photo is included .. what I'm worried about
is them pointing the link to some malicious code or something..

Obviously I can validate the file extension (.gif or .jpg) .. and I'm going
to force the files to be stored offsite -  they dont get to upload anything
to the server.  I'm just a bit paranoid about this, so I'm hoping someone
more security-minded can tell me what to watch out for, what to check, if
I'm missing anything..

Thanks,
Chad


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




[PHP] array_sum, multidimensional arrays?

2003-01-21 Thread Chad Day
Is it possible to use array_sum to add up values in multidimensional arrays?
I have an array like:

$array[0]["VALUE"] = 10;
$array[1]["VALUE"] = 8;
$array[2]["VALUE"] = 5;

$array[0]["OTHERVALUE"] = 20;
$array[1]["OTHERVALUE"] = 15;
$array[2]["OTHERVALUE"] = 9;

Thanks,
Chad


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




[PHP] Template tutorials?

2003-01-10 Thread Chad Day
I'm googling around for template tutorials and such after seeing a link to
the Smarty template engine .. can anyone point me to any particularly good
ones?  I've always been going with the 'one-file' approach .. which I think
it's time I changed.

Thanks,
Chad


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




RE: [PHP] Recommend payment processors?

2003-01-03 Thread Chad Day
Paypal is not an option for reasons I won't begin to get into.  I'm sure
someone is using something solid out there ..

-Original Message-
From: Rick Emery [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 03, 2003 11:36 AM
To: php general
Subject: Re: [PHP] Recommend payment processors?


I use PayPal.  Does not require a merchant account.  PHP payment interface
and interaction is easy
to implement.  Via HTML in your webpage, you pass to PayPal the URL of the
PHP script to be executed
when a payment is received.

- Original Message -----
From: "Chad Day" <[EMAIL PROTECTED]>
To: "php general" <[EMAIL PROTECTED]>
Sent: Friday, January 03, 2003 10:14 AM
Subject: [PHP] Recommend payment processors?


Just wondering what people are using/recommend out there.. I'm going to be
getting a merchant account and let people purchase services through my
website on a secure server, all in PHP.  What concerns me is this archived
post I came across:

http://marc.theaimsgroup.com/?l=php-general&m=102165623600464&w=2

Reading that, it sounds like it's not possible to use Payment Pro, or
possibly other systems, with PHP .. is this correct?  Some of the other
posts in the archive sounded like people were using it, so I'm not really
sure what is possible at this point.

Thanks,
Chad


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




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



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




[PHP] Recommend payment processors?

2003-01-03 Thread Chad Day
Just wondering what people are using/recommend out there.. I'm going to be
getting a merchant account and let people purchase services through my
website on a secure server, all in PHP.  What concerns me is this archived
post I came across:

http://marc.theaimsgroup.com/?l=php-general&m=102165623600464&w=2

Reading that, it sounds like it's not possible to use Payment Pro, or
possibly other systems, with PHP .. is this correct?  Some of the other
posts in the archive sounded like people were using it, so I'm not really
sure what is possible at this point.

Thanks,
Chad


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




RE: [PHP] Round robin script revisited..

2002-12-30 Thread Chad Day
Nevermind, I found the bug.

End of the code should be:

# Now rotate the @teams array
# Save the last team as the pivot for the polygon
if ($even) {
$last_team_save = array_pop($teamarray);
}
$last_team = array_pop($teamarray);
array_unshift($teamarray, $last_team);
if ($even) {
array_push($teamarray, $last_team_save);
}


Hope this helps anyone else who needs it.

Chad

-Original Message-
From: Chad Day [mailto:[EMAIL PROTECTED]]
Sent: Monday, December 30, 2002 2:03 PM
To: php general
Subject: RE: [PHP] Round robin script revisited..


Ok, after some more fiddling, I'm really close to getting this to work.

The script seems to correctly generate a schedule if an odd number of teams
are specified:

Given an array of 5 teams, A through E, the following pairs are generated:

Round 1 - A/E, B/D
Round 2 - D/E, A/C
Round 3 - C/D, B/E
Round 4 - B/C, A/D
Round 5 - A/B, C/E

Looks good.. each team gets a bye, each team plays each other.  With an even
number of teams however, some pairings are repeated, and I'm sure this is a
bug I created when translating the code from perl to PHP.  The PHP code I
have is below, the link to the perl source is
(http://www.perlmonks.org/index.pl?parent=90132&title=Round%20Robin%20Schedu
ling&lastnode_id=90132&displaytype=display&type=superdoc&node=Comment%20on),
and the set of pairings I get with 6 teams, A through F is below.

6 teams, A/F

Round 1 - A/E, B/D, C/F
Round 2 - F/D, A/C, B/E
Round 3 - E/C, F/B, A/D
Round 4 - D/B, E/A, F/C (dupe of round 1)
Round 5 - C/A, D/F, E/B (dupe of round 2)

PHP code:

Array Order: ";
//  for ($z = 0; $z < sizeof($teamarray); $z++) {
//  echo $teamarray[$z];
//  }
/*  if ($even) {
array_push($teamarray, $last_team);
}
*/
}

// echo '';
print_r($games);

?>

-Original Message-
From: Chad Day [mailto:[EMAIL PROTECTED]]
Sent: Monday, December 30, 2002 10:57 AM
To: php general
Subject: [PHP] Round robin script revisited..


I was trying to find a script to do round robin pairings for a sports
schedule generator..  I was able to come across one in Perl, and am in the
process of trying to convert it to PHP, but since my perl knowledge is a bit
(well, a lot) lacking, I was hoping someone could help..

Perl script:

http://www.perlmonks.org/index.pl?parent=90132&title=Round%20Robin%20Schedul
ing&lastnode_id=90132&displaytype=display&type=superdoc&node=Comment%20on


The part I'm having trouble with:

for(1..($size-$even))
{
my @this_week;
# push the weeks worth of games onto @games
foreach my $sched_ref (@stripes)
{
push (@this_week, [$teams[$sched_ref->[0]], $teams[$sched_ref-
+>[1]]]);
}
push(@games, \@this_week);


I'm not sure how to rewrite that in PHP and be pushing the correct array
elements into the games array .. If anyone can help me out or point me in
the right direction, I'd appreciate it.

Thanks,
Chad


--
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] Round robin script revisited..

2002-12-30 Thread Chad Day
Ok, after some more fiddling, I'm really close to getting this to work.

The script seems to correctly generate a schedule if an odd number of teams
are specified:

Given an array of 5 teams, A through E, the following pairs are generated:

Round 1 - A/E, B/D
Round 2 - D/E, A/C
Round 3 - C/D, B/E
Round 4 - B/C, A/D
Round 5 - A/B, C/E

Looks good.. each team gets a bye, each team plays each other.  With an even
number of teams however, some pairings are repeated, and I'm sure this is a
bug I created when translating the code from perl to PHP.  The PHP code I
have is below, the link to the perl source is
(http://www.perlmonks.org/index.pl?parent=90132&title=Round%20Robin%20Schedu
ling&lastnode_id=90132&displaytype=display&type=superdoc&node=Comment%20on),
and the set of pairings I get with 6 teams, A through F is below.

6 teams, A/F

Round 1 - A/E, B/D, C/F
Round 2 - F/D, A/C, B/E
Round 3 - E/C, F/B, A/D
Round 4 - D/B, E/A, F/C (dupe of round 1)
Round 5 - C/A, D/F, E/B (dupe of round 2)

PHP code:

Array Order: ";
//  for ($z = 0; $z < sizeof($teamarray); $z++) {
//  echo $teamarray[$z];
//  }
/*  if ($even) {
array_push($teamarray, $last_team);
}
*/
}

// echo '';
print_r($games);

?>

-Original Message-
From: Chad Day [mailto:[EMAIL PROTECTED]]
Sent: Monday, December 30, 2002 10:57 AM
To: php general
Subject: [PHP] Round robin script revisited..


I was trying to find a script to do round robin pairings for a sports
schedule generator..  I was able to come across one in Perl, and am in the
process of trying to convert it to PHP, but since my perl knowledge is a bit
(well, a lot) lacking, I was hoping someone could help..

Perl script:

http://www.perlmonks.org/index.pl?parent=90132&title=Round%20Robin%20Schedul
ing&lastnode_id=90132&displaytype=display&type=superdoc&node=Comment%20on


The part I'm having trouble with:

for(1..($size-$even))
{
my @this_week;
# push the weeks worth of games onto @games
foreach my $sched_ref (@stripes)
{
push (@this_week, [$teams[$sched_ref->[0]], $teams[$sched_ref-
+>[1]]]);
}
push(@games, \@this_week);


I'm not sure how to rewrite that in PHP and be pushing the correct array
elements into the games array .. If anyone can help me out or point me in
the right direction, I'd appreciate it.

Thanks,
Chad


--
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] Warning?

2002-12-30 Thread Chad Day
You can't have any text output to the browser before a redirect.  Make sure
you have nothing abouve line 58 echoing out text (specifically whatever is
in line 2, judging by your error) .. I believe I've had the problem when
I've included a file where the 1st line was blank, so you may want to check
that as well..

Chad

-Original Message-
From: Doug Coning [mailto:[EMAIL PROTECTED]]
Sent: Monday, December 30, 2002 12:25 PM
To: php general
Subject: [PHP] Warning?


Hi everyone,

I'm using Dreamweaver to create an insert page and after the record is
inserted I receive this error:

Warning: Cannot add header information - headers already sent by (output
started at
/home/virtual/site8/fst/var/www/html/admin_gs/products_insert.php:2) in
/home/virtual/site8/fst/var/www/html/admin_gs/products_insert.php on line 62

Line 58 - 62 is as follows:

  if (isset($HTTP_SERVER_VARS['QUERY_STRING'])) {
$insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
$insertGoTo .= $HTTP_SERVER_VARS['QUERY_STRING'];
  }
  header(sprintf("Location: %s", $insertGoTo));

This same code works in my update page without an error.

If you can help, thank you

Doug




--
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] Round robin script revisited..

2002-12-30 Thread Chad Day
I was trying to find a script to do round robin pairings for a sports
schedule generator..  I was able to come across one in Perl, and am in the
process of trying to convert it to PHP, but since my perl knowledge is a bit
(well, a lot) lacking, I was hoping someone could help..

Perl script:

http://www.perlmonks.org/index.pl?parent=90132&title=Round%20Robin%20Schedul
ing&lastnode_id=90132&displaytype=display&type=superdoc&node=Comment%20on


The part I'm having trouble with:

for(1..($size-$even))
{
my @this_week;
# push the weeks worth of games onto @games
foreach my $sched_ref (@stripes)
{
push (@this_week, [$teams[$sched_ref->[0]], $teams[$sched_ref-
+>[1]]]);
}
push(@games, \@this_week);


I'm not sure how to rewrite that in PHP and be pushing the correct array
elements into the games array .. If anyone can help me out or point me in
the right direction, I'd appreciate it.

Thanks,
Chad


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




RE: [PHP] Finding # of weekdays between 2 dates..

2002-12-27 Thread Chad Day
I should have specified, those dates were in US form.. so:

$nowdate = mktime(0, 0, 0, 1, 4, 2002);
$futuredate = mktime(0, 0, 0, 2, 5, 2002);

$futuredate - $nowdate equals 2764800
((2764800 / 86400) / 7) = 4.57142

then when floored, comes out to 4.

The only thing I can think of possibly getting around it is setting
futuredate to mktime(23, 59, 59, $month, $day, $year), but I still come up
short .. those two timestamps, after all the math before the floor(), equals
4.71, which still results in a 4.  I've tried ceil and round, but with
similar inaccuracies in other dates (going 1 day too far in some cases with
ceil).

Perhaps this function I found is just not the right way to go about it, but
if anyone has any more insight, it's greatly appreciated.

Chad

-Original Message-
From: Marek Kilimajer [mailto:[EMAIL PROTECTED]]
Sent: Friday, December 27, 2002 2:48 AM
To: Chad Day
Cc: php general
Subject: Re: [PHP] Finding # of weekdays between 2 dates..


WFM:

$nowdate = mktime(0, 0, 0, 4, 1, 2002);
$futuredate = mktime(0, 0, 0, 5, 2, 2002);

echo weekdaysBetween ($nowdate,$futuredate,2);

I get 5

Chad Day wrote:

>I found this function in the list archives while searching on how to find
>the number of a weekday (say, Tuesdays) between 2 dates..
>
>  function weekdaysBetween ($timestamp1, $timestamp2, $weekday)
>  {
>return floor(intval(($timestamp2 - $timestamp1) / 86400) / 7)
>  + ((date('w', $timestamp1) <= $weekday) ? 1 : 0);
>  }
>
>Sometimes it works, but I've come across a date while testing this that
>doesn't work, which makes me think there is some bug in the function that
>I'm not seeing.
>
>The 2 dates I am trying are:
>
>01-04-2002
>and
>02-05-2002
>
>There should be 5 Tuesdays:
>
>01-08-2002
>01-15-2002
>01-22-2002
>01-29-2002
>02-05-2002
>
>Yet the script only returns 4, leaving off 02-05-2002.
>
>   $nowdate = mktime(0, 0, 0, $STARTMONTH, $STARTDAY, $STARTYEAR);
>   $futuredate = mktime(0, 0, 0, $ENDMONTH, $ENDDAY, $ENDYEAR);
>
>That's how I'm generating the time stamps to pass to the function, and I've
>confirmed the dates I've entered are correct..
>
>   echo weekdaysBetween($nowdate, $futuredate, 2);
>
>Returns 4 ..
>
>
>can anyone assist?
>
>Thanks,
>Chad
>
>
>
>



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




[PHP] Finding # of weekdays between 2 dates..

2002-12-26 Thread Chad Day
I found this function in the list archives while searching on how to find
the number of a weekday (say, Tuesdays) between 2 dates..

  function weekdaysBetween ($timestamp1, $timestamp2, $weekday)
  {
return floor(intval(($timestamp2 - $timestamp1) / 86400) / 7)
  + ((date('w', $timestamp1) <= $weekday) ? 1 : 0);
  }

Sometimes it works, but I've come across a date while testing this that
doesn't work, which makes me think there is some bug in the function that
I'm not seeing.

The 2 dates I am trying are:

01-04-2002
and
02-05-2002

There should be 5 Tuesdays:

01-08-2002
01-15-2002
01-22-2002
01-29-2002
02-05-2002

Yet the script only returns 4, leaving off 02-05-2002.

$nowdate = mktime(0, 0, 0, $STARTMONTH, $STARTDAY, $STARTYEAR);
$futuredate = mktime(0, 0, 0, $ENDMONTH, $ENDDAY, $ENDYEAR);

That's how I'm generating the time stamps to pass to the function, and I've
confirmed the dates I've entered are correct..

echo weekdaysBetween($nowdate, $futuredate, 2);

Returns 4 ..


can anyone assist?

Thanks,
Chad


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




[PHP] Creating access DB in PHP ..

2002-12-19 Thread Chad Day
Not sure if this is possible, and I haven't turned up what I'm looking for
in my searches yet..

I am running PHP on a FreeBSD box .. I need to create an Access database,
fill it in with some data, and have a client download it (as the software
the client is using only imports mdb files).  Is this possible in any way,
even if I have to go some route like creating it as a MySQL DB, doing a
conversion to mdb (I've seen conversion tools for vice versa), etc? ..

Thanks,
Chad


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




RE: [PHP] Cookie handling, NS 4.x?

2002-12-10 Thread Chad Day
I think I understand now .. I was purposely making all my login forms/etc go
to http://domain.com so that when the cookies were set, they would be
ensured to set in .domain.com so I could read them on other parts of
domain.com (www., my., calendar., forums.) .. It looks like dropping the
support for domain.com is the best bet, as bizarre of a solution as that
sounds.  But I guess according to the cookie standards, that's correct..
as long as I set the cookie path, I should be good.

Another bright part of setting the cookie this way is that it seems to no
longer rely on the meta refresh, and I can continue using Header:  calls ..
hmm.

Thanks for all the help, Jaime and Chris, much appreciated.

Chad

-Original Message-
From: Jaime Bozza [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, December 10, 2002 10:22 AM
To: 'Chad Day'
Cc: 'php general'
Subject: RE: [PHP] Cookie handling, NS 4.x?


Well, not quite.

Cookies won't work if you specify a domain and you don't use something
like http://www.domain.com

For instance, if you drop the support for http://domain.com and then set
your cookie with ".domain.com", everything will work fine.  (Perhaps
setup a virtual host for "domain.com" that redirects everything to
"www.domain.com"?)

Redirecting and cookies work fine with Apache.  We redirect with cookies
here quite a bit and it works fine in everything I've tested (Netscape,
IE, Opera, Mozilla, even IE Mac! )

There's a problem using IIS with cookies and redirects (IIS parses the
headers and removes most of them if you have a Location header.)

And yes, Netscape 4.x is the bane of all existence. :)  Now that
Netscape 7.0 and Mozilla 1.x are out, someone should remove all copies
of Netscape 4.x.  (Cookies aren't the only big issue for me there.  CSS
and Dynamic HTML support are horrible in NS4.x!)

Jaime


> -Original Message-
> From: Chad Day [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, December 10, 2002 9:11 AM
> To: Jaime Bozza
> Cc: 'php general'
> Subject: RE: [PHP] Cookie handling, NS 4.x?
>
>
> So, basically... cookies aren't going to work in NS 4.x if I specify a
> domain and need to do a redirect afterwards.  (I tried the
> dot at the end,
> also no go) ... wow, that sucks. :\
>
> Thanks,
> Chad
>
> -Original Message-
> From: Jaime Bozza [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, December 10, 2002 9:33 AM
> To: 'Chad Day'
> Cc: 'php general'
> Subject: RE: [PHP] Cookie handling, NS 4.x?
>
>
> The original cookie specifications required that the domain in the
> cookie has at least 2 (or 3 for domains not in the primary
> tlds) periods
> in it.  (So as to stop someone from using .com, .edu, etc...)
>
> So, you use .domain.com, right?  Well, Netscape 4.x is strict in that
> .domain.com does not match http://domain.com ...  Sounds like you're
> having this problem.
>
> I don't believe you're going to have any luck with cookies in Netscape
> 4.x with only one period.  (I had heard some references to using
> "domain.com.", but I just setup a primary domain webserver to
> test that
> and it doesn't work)
>
>
> Jaime
>
>
>
> > -Original Message-
> > From: Chad Day [mailto:[EMAIL PROTECTED]]
> > Sent: Tuesday, December 10, 2002 8:17 AM
> > To: Jaime Bozza
> > Cc: 'php general'
> > Subject: RE: [PHP] Cookie handling, NS 4.x?
> >
> >
> > domain.com, but www is pointed to it as well.  When I was
> setting the
> > cookies with Header calls and using ".domain.com", they
> > worked fine (I want
> > to be able to access these cookies from my.domain.com,
> > forums.domain.com,
> > etc, which is why they need to be set in .domain.com).  But
> > then the NS 4.x
> > Header problem popped up, and now the domain issue..
> >
> > In IE, the code I posted below:
> >
> > setcookie("NSUSERNAME", "cday", time()+2592000, "/", ".domain.com");
> > echo " > content="\"0;url=nscookie2.php\"">";
> >
> > works fine in regards to setting the cookie still.  NS 4.x is
> > a piece of
> > crap. >:(
> >
> > Chad
> >
> > -Original Message-
> > From: Jaime Bozza [mailto:[EMAIL PROTECTED]]
> > Sent: Tuesday, December 10, 2002 9:07 AM
> > To: 'Chad Day'
> > Cc: 'php general'
> > Subject: RE: [PHP] Cookie handling, NS 4.x?
> >
> >
> > Hello,
> >By any chance, is your website named http://domain.com or is it
> > http://www.domain.com ?
> >
> > Jaime Bozza
> >
> 

RE: [PHP] Cookie handling, NS 4.x?

2002-12-10 Thread Chad Day
So, basically... cookies aren't going to work in NS 4.x if I specify a
domain and need to do a redirect afterwards.  (I tried the dot at the end,
also no go) ... wow, that sucks. :\

Thanks,
Chad

-Original Message-
From: Jaime Bozza [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, December 10, 2002 9:33 AM
To: 'Chad Day'
Cc: 'php general'
Subject: RE: [PHP] Cookie handling, NS 4.x?


The original cookie specifications required that the domain in the
cookie has at least 2 (or 3 for domains not in the primary tlds) periods
in it.  (So as to stop someone from using .com, .edu, etc...)

So, you use .domain.com, right?  Well, Netscape 4.x is strict in that
.domain.com does not match http://domain.com ...  Sounds like you're
having this problem.

I don't believe you're going to have any luck with cookies in Netscape
4.x with only one period.  (I had heard some references to using
"domain.com.", but I just setup a primary domain webserver to test that
and it doesn't work)


Jaime



> -Original Message-
> From: Chad Day [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, December 10, 2002 8:17 AM
> To: Jaime Bozza
> Cc: 'php general'
> Subject: RE: [PHP] Cookie handling, NS 4.x?
>
>
> domain.com, but www is pointed to it as well.  When I was setting the
> cookies with Header calls and using ".domain.com", they
> worked fine (I want
> to be able to access these cookies from my.domain.com,
> forums.domain.com,
> etc, which is why they need to be set in .domain.com).  But
> then the NS 4.x
> Header problem popped up, and now the domain issue..
>
> In IE, the code I posted below:
>
> setcookie("NSUSERNAME", "cday", time()+2592000, "/", ".domain.com");
> echo " content="\"0;url=nscookie2.php\"">";
>
> works fine in regards to setting the cookie still.  NS 4.x is
> a piece of
> crap. >:(
>
> Chad
>
> -Original Message-
> From: Jaime Bozza [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, December 10, 2002 9:07 AM
> To: 'Chad Day'
> Cc: 'php general'
> Subject: RE: [PHP] Cookie handling, NS 4.x?
>
>
> Hello,
>By any chance, is your website named http://domain.com or is it
> http://www.domain.com ?
>
> Jaime Bozza
>
>
> > -Original Message-
> > From: Chad Day [mailto:[EMAIL PROTECTED]]
> > Sent: Tuesday, December 10, 2002 8:09 AM
> > To: [EMAIL PROTECTED]; php general
> > Subject: RE: [PHP] Cookie handling, NS 4.x?
> >
> >
> > Ok, I understand.  I was able to get NS to set the cookie,
> > but -only- if I
> > put nothing in the domain field.
> >
> >
> > setcookie("NSUSERNAME", "cday", time()+2592000, "/", ".domain.com");
> > echo " > content="\"0;url=nscookie2.php\"">";
> >
> > did not work.  domain.com also did not work . .  this is kind
> > of a pain, but
> > this is what I get for trying to make a site NS 4.x
> > compatible I guess.  Is
> > there any way to specify the domain of a cookie with NS 4.x
> > in this kind of
> > situation?
> >
> > Thanks,
> > Chad
> >
> > -Original Message-
> > From: Chris Shiflett [mailto:[EMAIL PROTECTED]]
> > Sent: Monday, December 09, 2002 5:30 PM
> > To: Chad Day; php general
> > Subject: RE: [PHP] Cookie handling, NS 4.x?
> >
> >
> > --- Chad Day <[EMAIL PROTECTED]> wrote:
> > > I'm not sure how this would matter since the cookie is
> > > never set at all.. it's not an issue of it reading the
> > > cookie, as it can't read what is never set. I'll give
> > > it a shot when I get home though anyway.
> >
> > Read my response again, and you'll see that what you are
> > saying here does not conflict. The cookie is indeed not
> > getting set, and that is likely because the browser does
> > not take action on the Set-Cookie header when it is
> > contained within a 302 response. If you use a meta redirect
> > rather than a header("Location: ...") call, the response
> > status will be 200 instead of 302, so the browser might
> > accept the cookie.
> >
> > Chris
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
> >
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
>




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




RE: [PHP] Cookie handling, NS 4.x?

2002-12-10 Thread Chad Day
domain.com, but www is pointed to it as well.  When I was setting the
cookies with Header calls and using ".domain.com", they worked fine (I want
to be able to access these cookies from my.domain.com, forums.domain.com,
etc, which is why they need to be set in .domain.com).  But then the NS 4.x
Header problem popped up, and now the domain issue..

In IE, the code I posted below:

setcookie("NSUSERNAME", "cday", time()+2592000, "/", ".domain.com");
echo "";

works fine in regards to setting the cookie still.  NS 4.x is a piece of
crap. >:(

Chad

-Original Message-
From: Jaime Bozza [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, December 10, 2002 9:07 AM
To: 'Chad Day'
Cc: 'php general'
Subject: RE: [PHP] Cookie handling, NS 4.x?


Hello,
   By any chance, is your website named http://domain.com or is it
http://www.domain.com ?

Jaime Bozza


> -Original Message-
> From: Chad Day [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, December 10, 2002 8:09 AM
> To: [EMAIL PROTECTED]; php general
> Subject: RE: [PHP] Cookie handling, NS 4.x?
>
>
> Ok, I understand.  I was able to get NS to set the cookie,
> but -only- if I
> put nothing in the domain field.
>
>
> setcookie("NSUSERNAME", "cday", time()+2592000, "/", ".domain.com");
> echo " content="\"0;url=nscookie2.php\"">";
>
> did not work.  domain.com also did not work . .  this is kind
> of a pain, but
> this is what I get for trying to make a site NS 4.x
> compatible I guess.  Is
> there any way to specify the domain of a cookie with NS 4.x
> in this kind of
> situation?
>
> Thanks,
> Chad
>
> -Original Message-
> From: Chris Shiflett [mailto:[EMAIL PROTECTED]]
> Sent: Monday, December 09, 2002 5:30 PM
> To: Chad Day; php general
> Subject: RE: [PHP] Cookie handling, NS 4.x?
>
>
> --- Chad Day <[EMAIL PROTECTED]> wrote:
> > I'm not sure how this would matter since the cookie is
> > never set at all.. it's not an issue of it reading the
> > cookie, as it can't read what is never set. I'll give
> > it a shot when I get home though anyway.
>
> Read my response again, and you'll see that what you are
> saying here does not conflict. The cookie is indeed not
> getting set, and that is likely because the browser does
> not take action on the Set-Cookie header when it is
> contained within a 302 response. If you use a meta redirect
> rather than a header("Location: ...") call, the response
> status will be 200 instead of 302, so the browser might
> accept the cookie.
>
> Chris
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>



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



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




RE: [PHP] Cookie handling, NS 4.x?

2002-12-10 Thread Chad Day
Ok, I understand.  I was able to get NS to set the cookie, but -only- if I
put nothing in the domain field.


setcookie("NSUSERNAME", "cday", time()+2592000, "/", ".domain.com");
echo "";

did not work.  domain.com also did not work . .  this is kind of a pain, but
this is what I get for trying to make a site NS 4.x compatible I guess.  Is
there any way to specify the domain of a cookie with NS 4.x in this kind of
situation?

Thanks,
Chad

-Original Message-
From: Chris Shiflett [mailto:[EMAIL PROTECTED]]
Sent: Monday, December 09, 2002 5:30 PM
To: Chad Day; php general
Subject: RE: [PHP] Cookie handling, NS 4.x?


--- Chad Day <[EMAIL PROTECTED]> wrote:
> I'm not sure how this would matter since the cookie is
> never set at all.. it's not an issue of it reading the
> cookie, as it can't read what is never set. I'll give
> it a shot when I get home though anyway.

Read my response again, and you'll see that what you are
saying here does not conflict. The cookie is indeed not
getting set, and that is likely because the browser does
not take action on the Set-Cookie header when it is
contained within a 302 response. If you use a meta redirect
rather than a header("Location: ...") call, the response
status will be 200 instead of 302, so the browser might
accept the cookie.

Chris

--
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] Cookie handling, NS 4.x?

2002-12-09 Thread Chad Day
I'm not sure how this would matter since the cookie is never set at all..
it's not an issue of it reading the cookie, as it can't read what is never
set.  I'll give it a shot when I get home though anyway.

-Original Message-
From: Chris Shiflett [mailto:[EMAIL PROTECTED]]
Sent: Monday, December 09, 2002 4:31 PM
To: Chad Day; php general
Subject: Re: [PHP] Cookie handling, NS 4.x?


--- Chad Day <[EMAIL PROTECTED]> wrote:
> I am having a fairly confusing problem with setcookie()
> in NS 4.x.
>
> My script:
>
> nscookie.php:
>
> setcookie("NSUSERNAME", 'cday', time()+2592000, '/',
> ".mydomain.com");
> Header("Location: nscookie2.php");
> exit();
>
> nscookie2.php:
>
> echo $_COOKIE[NSUSERNAME];
>
> In IE (all versions I have tested), this works fine.
>
> In NS 7, this works fine.
>
> In NS 4.7 and 4.8 .. nothing is returned.  No cookie is
> set in the
> cookies.txt file at all.
>
> Can anyone tell me why?

I believe this has something to do with the fact that the
HTTP response status code is no longer a 200 when you send
a Location header, as PHP will automatically change it to a
302 for you. Thus, in some browsers, the result is that the
browser will submit a GET request for the URL identified in
the Location header, but it will ignore the HTTP headers
sent in the 302 response.

To see if this is in fact the trouble with Netscape 4.x,
try using a meta tag redirect instead. Even though the W3C
dislikes this use of http-equiv, it is very consistently
supported, and I know many Web sites that use it
(SourceForge, for example).

Good luck.

Chris


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




[PHP] Cookie handling, NS 4.x?

2002-12-09 Thread Chad Day
I am having a fairly confusing problem with setcookie() in NS 4.x.

My script:

nscookie.php:

setcookie("NSUSERNAME", 'cday', time()+2592000, '/', ".mydomain.com");
Header("Location: nscookie2.php");
exit();


nscookie2.php:

echo $_COOKIE[NSUSERNAME];




In IE (all versions I have tested), this works fine.

In NS 7, this works fine.

In NS 4.7 and 4.8 .. nothing is returned.  No cookie is set in the
cookies.txt file at all.

Can anyone tell me why?  I've been poking around the PHP manual pages but
haven't come across anything let.

Thanks,
Chad


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




[PHP] Confused about $_SESSION and $_COOKIE scope..

2002-12-06 Thread Chad Day
I'm not sure why this isn't working, been banging my head at it for a couple
hours now.

I have a file (index.php), which calls a function that draws the header to
my page.

Inside that function (site_header), is an include to a file (menu.php) which
draws dynamic javascript menus based on
cookie or session values.

I can't seem to access ANY variables, be them $_SESSION, $_COOKIE, or
anything else, inside this menu.php file.  I've tried even passing simple
variables, globalizing them, etc, all the way down to see if I can access
them in that menu.php file.  I still can't.. the closest I get is being able
to access them in the site_header function, but when the include("menu.php")
is called, everything seems to vanish.

And yes, I have session_start(); at the top of my menu.php file as well..

Can anyone help me out on this?  I was under the impression that the
superglobals would be available from basically anything.. apparently I was
wrong.

Thanks,
Chad


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




[PHP] Re: upload files

2002-10-26 Thread Chad Cotton
I just wrote a file upload script and all the information that I needed was
here in the manual:

http://www.php.net/manual/en/features.file-upload.php

There were a couple of "common pitfalls" that it points out, which you
should check.  Make sure you've defined the various configuration variables
'correctly'  some are:
upload_files
upload_tmp_dir
upload_max_filesize
and post_max_filesize

also check your form to make sure you have an input defined for
MAX_FILE_SIZE and that in the  tag you have the proper encoding.
My form used '' and this made a
difference.  Something worth checking.

Chadly


"Cyrille Andres" <[EMAIL PROTECTED]> wrote in message
news:FA432D4D6C2EC1498940A59C494F1538035E2860@;stca207a.bus.sc.rolm.com...
>
>
>
>  Hello everybody,
>
>
> I want to allow the client to upload a text file on my web server, so I
use
> this code :
>
> 
> 
> 
> Uploaded files details
>
>  printf("Name : %s ", $HTTP_POST_FILES["userfile"]["name"]);
> printf("Temporary Name : %s ",
> $HTTP_POST_FILES["userfile"]["tmp_name"]);
> printf("Size : %s ", $HTTP_POST_FILES["userfile"]["size"]);
> printf("Type : %s ", $HTTP_POST_FILES["userfile"]["type"]);
>
> if (copy
>
($HTTP_POST_FILES["userfile"]["tmp_name"],"temp/".$HTTP_POST_FILES["userfile
> "]["name"]))
> {
> printf("File successfully copied");}
> else{
> printf("Error: failed to copy file");}
>
>
> ?>
>
> 
> 
>
> the $http_post_files doesn't return me anything, anybody would have a clue
> ?? ( roughly speaking I am not able to retrieve the field the client try
to
> send me).
>
> Thanks a lot.



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




[PHP] Re: Commenting out characters?

2002-09-21 Thread Chad Winger

I figured it out...was the single quotes

Disregard





Chad Winger <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Simple question for the newbie...I hope...
>
> The following line is returning an error, and I can't figure out what and
> how to comment out. I assumed I had to \ the parentheses...but it doesnt
> work... any suggestion?
>
> echo '
onClick="MM_showHideLayers('Layer5','','show','Layer4','','hide')">'."\n
> ";
>
>
> Thanks
> -Tree
>
>



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




[PHP] Commenting out characters?

2002-09-21 Thread Chad Winger

Simple question for the newbie...I hope...

The following line is returning an error, and I can't figure out what and
how to comment out. I assumed I had to \ the parentheses...but it doesnt
work... any suggestion?

echo ''."\n
";


Thanks
-Tree



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




[PHP] New problem - preg_match?

2002-09-18 Thread Chad Winger

Yes, I'm STILL a newbie :) I've gotten pretty far in a few days thanks to
you all. I have a new question for you, maybe this is a bit easier than my
last issue.

Still using my text file example, which has lines such as:

0706010102|01.01.02|16:00|Serie C2|02|Forlì|Florentia Viola|
0610010102|01.07.02|16:00|Serie C2|05|Florentia Viola|Gubbio|
1806190702|19.07.02|16:00|Serie C2|05|Savona|Florentia Viola|

I am able to with a form, create a new addition to the file. What I'd like
to do now however, is before writing to the file, check the second field
(the date in this case) and if it is the same as what is being submitted,
then I want to buy using an if...else statement stop it from being written.

What I tried was to create an array called $getdate by exploding the file
that has the text above. Then, I also created a variable called $datetest
which was from the form such as: $datetest = ("$day.$month.$year");

so Now i wanted to compare $getdate[1] to $datetest and if any of the
exploded arrays from $getdate[1] matched up with $getdate, i.e. what is
being submitted from the form, then it would not go to write the file.

I tried it like so:

$fd = fopen ($schedule, "r");
while (!feof ($fd))
{
$currentlines = fgets($fd, 4096);
$getdate = explode("|", $currentlines);
$datetest = ("$day.$month.$year");
if (preg_match ($getdate[1] , $datetest)) {
echo 'date already listed';
} else {
$fp = fopen($schedule, "w");
fwrite($fp,
"$current\n$homename[0]$awayname[0]$day$month$year|$day.$month.$year|$matcht
ime|$competition|$round|$homename[1]|$awayname[1]|");
fclose($fp);
echo 'success';
}

I am not even sure if this is the function i need to use, but if it is, my
syntaxt must be wrong, because I have tried all combinaions and I keep
getting errors.

Any suggestions?

Thanks as always

-Tree



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




[PHP] Help.....still stuck after 3 days :/

2002-09-17 Thread Chad Winger

Hello Rudolf,
Thank you for responding to my post, I really appreciate it.

I ran the script you sent me, and then I tried looking up the syntax to try
to figure out what it means. As it would be pointless for me just to take
suggestions that people send me and then not learn what they mean. The
resulkt of your code does in fact alphabatize the teams in the select list,
however there is a little problem with the end result.

your code:

'.$alphabetical[$i].''."\n";
   }
   fclose ($fd);


?>

returns the follwoing html:
Aglianese
Brescello
Casteldisangro
Castelnuovo
Fano
Florentia Viola
Forlì
Grosseto
Gualdo


It is returning the first letter of $squads[1]. so the "id variable is
getting lost.That variable is $squads[0]. So in effect that vairable is
getting "lost" because when i modify the line

echo ''.$alphabetical[$i].''."\n";

to read

echo ''.$alphabetical[$i].''."\n";

then the HTML output becomes

Aglianese
Brescello
Casteldisangro
Castelnuovo
Fano
Florentia Viola
Forlì
Grosseto
Gualdo

In other words what I am trying to do is something to the effect of
$alphabetical = $squads[1][0]. Then I want to sort that only by $squads[1].
When the html is returned, I want to be able to echo the $squads[0] as the
Value of the select dropdown.

Thanks again,
-Tree



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




[PHP] Re: alphabetical order?

2002-09-17 Thread Chad Winger

Hello Rudolf,
Thank you for responding to my post, I really appreciate it.

I ran the script you sent me, and then I tried looking up the syntax to try
to figure out what it means. As it would be pointless for me just to take
suggestions that people send me and then not learn what they mean. The
resulkt of your code does in fact alphabatize the teams in the select list,
however there is a little problem with the end result.

your code:

'.$alphabetical[$i].''."\n";
   }
   fclose ($fd);


?>

returns the follwoing html:
Aglianese
Brescello
Casteldisangro
Castelnuovo
Fano
Florentia Viola
Forlì
Grosseto
Gualdo


It is returning the first letter of $squads[1]. so the "id variable is
getting lost.That variable is $squads[0]. So in effect that vairable is
getting "lost" because when i modify the line

echo ''.$alphabetical[$i].''."\n";

to read

echo ''.$alphabetical[$i].''."\n";

then the HTML output becomes

Aglianese
Brescello
Casteldisangro
Castelnuovo
Fano
Florentia Viola
Forlì
Grosseto
Gualdo

In other words what I am trying to do is something to the effect of
$alphabetical = $squads[1][0]. Then I want to sort that only by $squads[1].
When the html is returned, I want to be able to echo the $squads[0] as the
Value of the select dropdown.

Thanks again,
-Tree




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




Re: [PHP] Re: Cry for help

2002-09-12 Thread Chad Winger

Html is something i do in my sleep :P thankfully I've been good enough with
it to make a decent living with it. What you mention is quite logical, as i
would find myself correcting the ppl coding the databases and/or scripts by
saying, stuff like "you realize that when the info is returned like that you
are going to need four colums in the html, not 3..." and they'd be like,
geez..your right...and then they'd have to go back and code again...

So i am hoping that the html part that i know helps me gets me thru the
scripting phase a little easier, although the languages are apples and
oranges

iom looking thru the tuts now :P

cheers

-Tree


Will Steffen <[EMAIL PROTECTED]> wrote in message
000c01c25a63$e616a0e0$8000a8c0@william">news:000c01c25a63$e616a0e0$8000a8c0@william...
> Heh - I know how you feel.
>
> I'm an ex network tecchie fighting my way through a career change to web
> developer - spent some time messing with various scripting tools and so
> forth, but never really had any formal coding experience until I hit php
> - if you want some advice on learning php mine is spend the next few
> weeks/months just soaking up every tutorial you can lay your hands on -
> the best libraries are on phpbuilder, devshed and zend imho - altho
> webmonkey also has a couple of really 'beginner' ones (hello world
> country) you might want to start out with.
>
> Also one thing no-one ever really tells you about this is that one of
> the most important things to learn if you plan on building sites with
> php is not php - its html.  I know this is a bit duh!, but seriously -
> php is about logical structures - and slapping together a few variables
> - it aint that hard once you get in the groove, but if you don't know
> your html well enough to handcode it and to deconstruct a fat mess of
> tags in your head and visualize what its going to end up looking like on
> screen - you're going to have a hard time coding scripts to generate the
> stuff.
>
>
> 0.02 - actual mileage may vary - insert coin to generate more bs
>
> Cheers
> Will
>
> > -Original Message-
> > From: Chad Winger [mailto:[EMAIL PROTECTED]]
> > Sent: 12 September 2002 03:34 PM
> > To: [EMAIL PROTECTED]
> > Subject: Re: [PHP] Re: Cry for help
> >
> >
> > I have no idea what that means, sorry :)
> >
> > My point for wanting to do this isnt because I really want to
> > make a list of the home teams or whatnot. But obviously, at
> > some point, I am going to have to learn how to split
> > different bits of information, how organize them in certain
> > ways, in certain orders etc. So if i can figure out how to
> > get PHP to select the certain bits of info, and then organize
> > them, say, alphabetically, that will teach me how to write
> > some syntax, to use a few different functions and to begin
> > how to set variables.
> >
> > in 85 when i had the old Apple IIe I was able to do stuff
> > like this with the if A$=whatever then goto ...  type stuff
> > and it was easy back then. Now i realize PHP is not BASIC,
> > nor am I a little kid anymore, but the basic idea of what i'd
> > like to learn to do is there. So if i can just get used to
> > working with it, then it will come
> >
> > -Tree
> >
> > Adam Williams <[EMAIL PROTECTED]> wrote in message
> > news:[EMAIL PROTECTED]
> > te.ms.us...
> > > You can use PHP and file() to do with, along with the str
> > functions,
> > > but if I were you and you already know what the filename of
> > the file
> > > is you are working on (or can submit it via a form) I would use the
> > > unix command cut to do the operations on the file.  Use
> > another exec()
> > > or system() and have it run cut -d | -f 4 yourfile.txt and
> > then return
> > > you the output.
> > >
> > > Adam
> > >
> > > On Thu, 12 Sep 2002, Chad Winger wrote:
> > >
> > > > Thanks for the reply :P
> > > >
> > > > I found it actually. Now I have the apache and php
> > running, and am
> > > > able
> > to
> > > > run my aforementioned test script locally. I am still looking
> > > > through
> > the
> > > > manual now for the syntaxes and such. I am also looking
> > on the web
> > > > for
> > some
> > > > simple prewritten scripts to run and then try to dissect and
> > deconstruct.
> > > >
> > > > With my little test "script" I've written, there are a few things
> > > > I'd
> > like
> &

Re: [PHP] Re: Cry for help

2002-09-12 Thread Chad Winger

I have no idea what that means, sorry :)

My point for wanting to do this isnt because I really want to make a list of
the home teams or whatnot. But obviously, at some point, I am going to have
to learn how to split different bits of information, how organize them in
certain ways, in certain orders etc. So if i can figure out how to get PHP
to select the certain bits of info, and then organize them, say,
alphabetically, that will teach me how to write some syntax, to use a few
different functions and to begin how to set variables.

in 85 when i had the old Apple IIe I was able to do stuff like this with the
if A$=whatever then goto ...  type stuff and it was easy back then. Now i
realize PHP is not BASIC, nor am I a little kid anymore, but the basic idea
of what i'd like to learn to do is there. So if i can just get used to
working with it, then it will come

-Tree

Adam Williams <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> You can use PHP and file() to do with, along with the str functions, but
> if I were you and you already know what the filename of the file is you
> are working on (or can submit it via a form) I would use the unix command
> cut to do the operations on the file.  Use another exec() or system() and
> have it run cut -d | -f 4 yourfile.txt and then return you the output.
>
> Adam
>
> On Thu, 12 Sep 2002, Chad Winger wrote:
>
> > Thanks for the reply :P
> >
> > I found it actually. Now I have the apache and php running, and am able
to
> > run my aforementioned test script locally. I am still looking through
the
> > manual now for the syntaxes and such. I am also looking on the web for
some
> > simple prewritten scripts to run and then try to dissect and
deconstruct.
> >
> > With my little test "script" I've written, there are a few things I'd
like
> > to be able to try to do with it that I think would help my learning
process
> > go on more smoothly, but i cant seem to figure out, what functions to
even
> > begin to try to use.
> >
> > I'll give an example.
> >
> > This is the result of my little "test" script as printed into a txt
file.
> >
> > |Serie C2 Round 2|09.09.02|20.45|Sangiovannese|Florentia Viola
> >
> > So if i fill out the form again, and resubmit, i might get something
like
> > this:
> >
> > |Serie C2 Round 2|09.09.02|20.45|Sangiovannese|Florentia Viola
> > |Serie C2 Round 2|09.09.02|20.45|Gualdo|Florentia Viola
> >
> > So for example, lets say I wanted to make another html form that has a
form
> > field for List team by: and and select either "home" or "away" ... by
> > selecting "home", the browser would print out the following:
> >
> > Sangiovannese
> > Gualdo
> >
> > so now I need to figure out how to get PHP to do the following:
> >
> > #1 look at each line in the text file and treat it individually
> > #2 select the data after the 4th | from each line
> > #3 print it back to the browser
> >
> > It's simple things like this that will get me going. I know for guys
like
> > you, it would take about 3 minutes to type that up but to me its a
little
> > tough trying to figure out how and where to use what. This manual isnt
the
> > most well put together in my opinion, its tough to locate things. So if
> > someone or something would say to me"well for that operation, you need
to
> > create function_whatever, then run a so_and_so then I could go to the
> > manual, and then learn how to write it. So this is my problem right now,
> > basically not knowing WHAT to learn first.
> >
> > Thoughts?
> >
> > Thanks again
> >
> > -Tree
> > - Original Message -
> > From: Jay Blanchard <[EMAIL PROTECTED]>
> > Newsgroups: php.general
> > To: 'Chad Winger' <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
> > Sent: Thursday, September 12, 2002 3:01 PM
> > Subject: RE: [PHP] Re: Cry for help
> >
> >
> > > [snip]
> > > As far as Apache is concerned, I looked at the website, yet couldnt
find
> > the
> > > exact server software, so if you could provide me with a direct link
I'd
> > > appreciate it. It would be to my benefit however, if I could not only
> > serve
> > > myself html pages as http:// but also as file:// as internet costs
here
> > are
> > > ridiculously high (no unilimited $24.99 2/7 packages here yet)
> > > [/snip]
> > >
> > > When you install apache locally (on your own system) you will be
serving
> > > pages as http:// locally

Re: [PHP] Re: Cry for help

2002-09-12 Thread Chad Winger

Thanks for the reply :P

I found it actually. Now I have the apache and php running, and am able to
run my aforementioned test script locally. I am still looking through the
manual now for the syntaxes and such. I am also looking on the web for some
simple prewritten scripts to run and then try to dissect and deconstruct.

With my little test "script" I've written, there are a few things I'd like
to be able to try to do with it that I think would help my learning process
go on more smoothly, but i cant seem to figure out, what functions to even
begin to try to use.

I'll give an example.

This is the result of my little "test" script as printed into a txt file.

|Serie C2 Round 2|09.09.02|20.45|Sangiovannese|Florentia Viola

So if i fill out the form again, and resubmit, i might get something like
this:

|Serie C2 Round 2|09.09.02|20.45|Sangiovannese|Florentia Viola
|Serie C2 Round 2|09.09.02|20.45|Gualdo|Florentia Viola

So for example, lets say I wanted to make another html form that has a form
field for List team by: and and select either "home" or "away" ... by
selecting "home", the browser would print out the following:

Sangiovannese
Gualdo

so now I need to figure out how to get PHP to do the following:

#1 look at each line in the text file and treat it individually
#2 select the data after the 4th | from each line
#3 print it back to the browser

It's simple things like this that will get me going. I know for guys like
you, it would take about 3 minutes to type that up but to me its a little
tough trying to figure out how and where to use what. This manual isnt the
most well put together in my opinion, its tough to locate things. So if
someone or something would say to me"well for that operation, you need to
create function_whatever, then run a so_and_so then I could go to the
manual, and then learn how to write it. So this is my problem right now,
basically not knowing WHAT to learn first.

Thoughts?

Thanks again

-Tree
- Original Message -
From: Jay Blanchard <[EMAIL PROTECTED]>
Newsgroups: php.general
To: 'Chad Winger' <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Thursday, September 12, 2002 3:01 PM
Subject: RE: [PHP] Re: Cry for help


> [snip]
> As far as Apache is concerned, I looked at the website, yet couldnt find
the
> exact server software, so if you could provide me with a direct link I'd
> appreciate it. It would be to my benefit however, if I could not only
serve
> myself html pages as http:// but also as file:// as internet costs here
are
> ridiculously high (no unilimited $24.99 2/7 packages here yet)
> [/snip]
>
> When you install apache locally (on your own system) you will be serving
> pages as http:// locally. Should help you to cut down on those unreal
> internet costs.
>
> What OS are you running now? Give us that and we can point you to a link.
>
> HTH! Peace ...
>
> Jay
>
>
Jay Blanchard <[EMAIL PROTECTED]> wrote in message
001901c25a5c$797161c0$8102a8c0@000347D72515">news:001901c25a5c$797161c0$8102a8c0@000347D72515...
> [snip]
> As far as Apache is concerned, I looked at the website, yet couldnt find
the
> exact server software, so if you could provide me with a direct link I'd
> appreciate it. It would be to my benefit however, if I could not only
serve
> myself html pages as http:// but also as file:// as internet costs here
are
> ridiculously high (no unilimited $24.99 2/7 packages here yet)
> [/snip]
>
> When you install apache locally (on your own system) you will be serving
> pages as http:// locally. Should help you to cut down on those unreal
> internet costs.
>
> What OS are you running now? Give us that and we can point you to a link.
>
> HTH! Peace ...
>
> Jay
>
>



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




[PHP] Re: Cry for help

2002-09-12 Thread Chad Winger

Justin,
Thanks for the reply. Funny seeing the word "dude" again. Havent heard that
in quite a while, since moving over here to Italy. :)

I hope I didnt come across as thinking I can just learn this in a week or
two. I'm bright, but I'm not a genius. I know, and realize that it is a long
a frustrating process. What I don't have is the real opportunity here to
learn this like I could back in the states. There isn't a lot of info here
on the topic in English, no classes to take, etc. I can't just walk into the
local bookstore and buy a PHP book. While I am fluent in Italian, it would
be that much easier if I can get my start in English obviously.

As far as Apache is concerned, I looked at the website, yet couldnt find the
exact server software, so if you could provide me with a direct link I'd
appreciate it. It would be to my benefit however, if I could not only serve
myself html pages as http:// but also as file:// as internet costs here are
ridiculously high (no unilimited $24.99 2/7 packages here yet)

I have read many docs and downloaded many scripts to try to familiarize
myself with the language, and while I grasp many of the concepts, I still
have lingering questions that I havent been able to resolve. So I have been
trying to just have some of my fellow netizens to just point me to the right
door in the HUGE hallway of doors that will get me into the proper room in
which to learn. So thanks again

-Tree

Chad Winger <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I need to learn PHP and databases. If I had those skills, I would be so
much
> more succesful with my web designs. What I usually do, is make the html
> templates, and then hire someone, usually expensively, to do the PHP and
> MySQL bankend.
>
> Unfortunately, my programming skill is ZERO. Ok, maybe not zero, I do have
a
> little bit of PERL experience, but it mainly comes in the form of
> downloading prewritten scripts, and lots of trial and error in editing
them
> using common sense and drawing on my experience of BASIC which I learned
> when I was 6 years old!
>
> I have browsed hours on the net looking for help in this sort of thing. I
> have downloaded programs, I have read hours of documents and "manuals",
and
> still, I am no further along than where I started. Programming and
databases
> are more of a mystery to me than women are. I'm absolutely CLUELESS.
>
> So basically, I need to learn this stuff as soon as humanly possible, but
I
> have NO IDEA where to start. Let me tell you first what I have done
thusfar.
>
> First thing I did was download something called mySQL Max version 3.23.49
> directly from the website of mysql. I was under the impression that this
> program would be something along the lines of MS Access in the standpoint
of
> user interface, and it would allow you to create tables etc. (I do know
how
> to create some rudimentary tables in MS Access). So after I installed this
> program, I clicked on the icon to start it, and to my surprise, the only
> thing that happened was the an MS-Dos box popped up for about 2/10ths of a
> second and then disappeared. So to me it was a waste of 2 hours of
> downloading.
>
> After a bit more of prodding I saw that there was some configuring to do.
> For the life of me, I have no idea where to look, and even if I did, I
> wouldnt have any idea what I need to configure anyways. Basically I want
to
> have this installed so that during my learning process of PHP, I can test
> and run things on my local machine, and not have to connect to the
internet,
> upload files etc.
>
>
> Secondly, I downloaded something similar, called Easy PHP. The website
said
> it would install this and that and then something else that would allow
you
> to run PHP scripts on your local machine as well as being an editor to
help
> you write scripts. So I downloaded this as well. So 27 MB and 3 hours
later
> I have yet another useless program with no interfaces nothing. Just
> something that runs in the background.
>
> So now I talked with my roommate and explained these issues to him. He
> pointed me to a software called CodeCharge. So I downloaded that and spent
> hours looking through the "templates" and what not, and although I can see
> this is a step in the right direction, it still leaves me with more
> questions than answers. It wants me to specify DNS or ODBC or ASPI etc etc
> and I have no clue what that is, what it means or what is does.
>
> Furthermore I see no way to use existing html files that I have created as
> templates. Just existing ugly templates that come with the software. I'm
> sure there is a way to do that, but I haven't figured it out.
>
> So what are my questions? Basically want to do i

[PHP] Cry for help

2002-09-12 Thread Chad Winger
re do I start?

Ok, so hopefully you've read with me so far. And I do appreciate it as
always. So now, let me pose my actual questions.

Creating a mysql database:
#1 What do I have to install on my machine to be able to eventually run the
scripts on my local machine? Where can I find it?
#2 How do I set it up?
#3 Is there a software that has a user interface such as MS Access that
creates the actual database? If so, where can I find it? If not, how do you
actually create the database?

PHP scripting
I have downloaded various "manuals". The one I've seen most mentioned is the
one at PHP.net, so that is the one I have. I can understand certian parts of
it. But it's all in PHP speak. What I need to learn first, is knowing when
to use what. Look at this code below:

class news
{
var $entries;
function news($disp)
{
global $news, $news;
$tp = fopen($news['template'], 'r');
$loop_code = fread($tp, 4096);
fclose($tp);
$count = 0;
$this->entries = '';
foreach ($news as $entry) {
$data = explode('||', $entry);
$data[1] = date($news['tformat'], $data[1] + $news['toffset'] * 3600);
$this->entries .= $loop_code;
$this->entries = str_replace('{timestamp}', $data[1], $this->entries);
$this->entries = str_replace('{author}', $data[2], $this->entries);
$this->entries = str_replace('{authoremail}', $data[3], $this->entries);
$this->entries = str_replace('{subject}', $data[4], $this->entries);
$this->entries = str_replace('{body}', $data[5], $this->entries);
$count++;
if ($disp != 'all') {
if ($count == $disp) {
break;
}
}
}
}
}


To me it's just a jumble of characters. Why are things indented? Why are
some things inside quotes and others not. What is a global variable? What
does parse mean? etc etc. Some many questions...

I do know what a variable is, and I know that the above coding is just
basically manipulating them. I have managed to "write" one simple script,
borrowing some code from a prewritten script that will take the contents of
a 5 field html form and print them in a text file like so:

|match date|match time|Home team|Away team|match result

So I managed to figure out what fopen(), fread(), fwrite() and fclose() are.
So now that I have this text file on the server, I want to be able to
manipulate the info between the | character. If I can figure out how to do
that, I can learn the syntaxes and coding functions fairly quickly.

I know using an editor is "cheating" in a sense, but I also know that I can
learn the same way I learned BASIC when I was 6. By deconstructing the code.
I really need to learn this stuff. I have no idea where to start and it's
really making me lose time and money. I don't want anyone to hold my hand
and do it for me, I need to know where to start. I have no idea what to do,
but downloading MB after MB of software that doesn't teach me anything isn't
going to help me get to where I need to be. Honestly I think I can learn
this fairly quickly with just a little bit of guidance. It's tough when you
go to a PHP channel on IRC and all they tell you is "read the F*G
manual!". I just don't want to be fiddling with SSI and text replacers for
the rest of my life, if you know what I mean.

Anyone who has any thoughts, please reply via email or this forum. I
sincerely appreciate it.


Cheers,
Chad in Florence, Italy [EMAIL PROTECTED]





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




RE: [PHP] How to handle multiple value checkboxes

2002-08-29 Thread Short, Chad

Use the [] along with the type of input you are using. 

Example:


This will send php an array of $thing with whatever is selected.

Hope this helps.

Chad.

-Original Message-
From: Lon Lentz [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, August 29, 2002 4:07 PM
To: Php-General@Lists. Php. Net
Subject: [PHP] How to handle multiple value checkboxes




  If I have a form with multiple checkboxes with different values but the
same name, and someone selects a couple of them, how do I reference all of
the values? Right now I am only getting the last one selected.



__
Lon Lentz
Applications Developer
EXImpact.com



-- 
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] Pairing algorithm?

2002-08-12 Thread Chad Day

I found a pairing algorithm finally via Google in C that I've been trying to
translate over into PHP, with no success (seemingly creates an infinite
loop).  I'm also surprised I haven't seen it in PHP yet.. thought someone
would have done it by now.

http://www.devenezia.com/downloads/round-robin/

And the source for that:

http://www.devenezia.com/downloads/round-robin/schedule-source.html

I'm still mucking around with it, but I don't know C very well, so I'm sure
there's a few bugs in my translation of it that's causing the infinite loop
in PHP, I'm just still trying to track it down..

Here's the code I very quickly tried to translate over, surely to be
littered with errors:

 $combinations) {
$c = $startC;
while (($c <= $combinations) && ($round_set & (1 << 
$clist[$c][one])) ||
($round_set & (1 << $clist[$c][two])) || ($cused[$c])) 
{
$c++;
}

if ($c > $combinations) {
do {
$mlist[$matchcount] = 0;
$matchcount--;
$index--;

$round_set &= ~(1 << 
$cList[$mList[$matchCount]][one]);
$round_set &= ~(1 << 
$cList[$mList[$matchCount]][two]);

$cUsed[$mList[$matchCount]] = FALSE;

$tourn[$index][one] = 0;
$tourn[$index][two] = 0;

} while ($clist[$mlist[$matchcount]][one] !=
$clist[$mlist[$matchcount]+1][one]);

$startc = $mlist[$matchcount] + 1;
}

}
$tourn[$index] = $clist[$c];
$totalchecks++;
if (($totalchecks % 1000) == 0) {
}

$cused[$c] = TRUE;
$mlist[$matchcount] = $c;

$startc = 1;

$round_set |= (1 << $clist[$c][one]);
$round_set |= (1 << $clist[$c][two]);

$index++;
$matchcount++;
}
$roundcount++;
}

?>



-Original Message-
From: Bas Jobsen [mailto:[EMAIL PROTECTED]]
Sent: Monday, August 12, 2002 12:19 PM
To: Chad Day
Subject: Re: [PHP] Pairing algorithm?


Hi

Never Seen it in php. There are many variants, mostly depending on your
needs.
Do you have the algorithm you want in pseudo code?




Op maandag 12 augustus 2002 16:24, schreef Chad Day:
> Has anyone written any sort of pairing algorithm for a round robin sports
> schedule, or something similar?  I couldn't find anything in the archives
> surprisingly, and I'm looking around google and not turning up much except
> some PDFs and white papers addressing the mathmatical complications of it.
>
> Thanks,
> Chad


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




[PHP] Pairing algorithm?

2002-08-12 Thread Chad Day

Has anyone written any sort of pairing algorithm for a round robin sports
schedule, or something similar?  I couldn't find anything in the archives
surprisingly, and I'm looking around google and not turning up much except
some PDFs and white papers addressing the mathmatical complications of it.

Thanks,
Chad


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




RE: [PHP] ldap_modify parameters?

2002-08-01 Thread Chad Day

Also tried that, no success, unless I am missing something.

...
$info["st"]="stchanged!";
...

ldap_modify($ds, 'uid=testing,cn=online-leagues.com', $info);

Fatal error: LDAP: Unknown Attribute in the data in
/usr/local/www/sites/online-leagues.com/htdocs/ldapform.php on line 31

Chad

-Original Message-
From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]]
Sent: Thursday, August 01, 2002 9:41 AM
To: Chad Day
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] ldap_modify parameters?


I think your problem is that you are passing the output of
ldap_get_entries() directly back into ldap_modify().  ldap_get_entries()
returns an array of result elements whereas ldap_modify() is expecting a
single element.

So, to change the 'st' attribute for the uid=testing record, you should
simply do:

$data['st'] = 'stchanged';
ldap_modify($ds, 'uid=testing,cn=online-leagues.com', $data);

If st takes multiple values, use:

$data['st'][0] = 'stchanged';
$data['st'][1] = '2nd value';
ldap_modify($ds, 'uid=testing,cn=online-leagues.com', $data);

-Rasmus

On Thu, 1 Aug 2002, Chad Day wrote:

> I think something is wrong with the way I am calling ldap_modify, but I'm
> not sure exactly what, from the scripts and tutorials I've been looking
> at/experimenting with:
>
>   $ds=ldap_connect("online-leagues.com");
>   if ($ds) {
>   $r=ldap_bind($ds, 'username', 'password');
>   // Search surname entry
>   $sr=ldap_search($ds, 'cn=online-leagues.com', 'uid=testing');
>   echo "Search result is ".$sr."";
>   $info = ldap_get_entries($ds, $sr);
>echo "dn is: ". $info[0]["dn"] ."";
> echo "first cn entry is: ". $info[0]["cn"][0] ."";
> echo "first email entry is: ". $info[0]["mail"][0] ."";
>   echo "st = ". $info[0]["st"][0] ."";
>
>   $info[0]["st"][0]="stchanged!";
>
>   ldap_modify($ds, 'uid=testing,cn=online-leagues.com', $info);
>   echo "Closing connection";
>   ldap_close($ds);
>
>   } else {
>   echo "Unable to connect to LDAP server";
>   }
>
> The error returned is:
>
> Fatal error: LDAP: Unknown Attribute in the data in
> /usr/local/www/sites/online-leagues.com/htdocs/ldapform.php on line 31
>
> I looked up the error on google but didn't find anything..
>
>
> Running ldapsearch from the command line on my box, the record looks like:
>
>
> #
> # filter: (objectclass=*)
> # requesting: ALL
> #
>
> # online-leagues.com
> dn: cn=online-leagues.com
> objectclass: top
> objectclass: organization
> objectclass: CommuniGateDomain
> cn: online-leagues.com
> o: www.online-leagues.com
>
>
> # testing, online-leagues.com
> dn: uid=testing,cn=online-leagues.com
> objectclass: top
> objectclass: person
> objectclass: organizationalPerson
> objectclass: inetOrgPerson
> objectclass: CommuniGateAccount
> cn: rn
> hostServer: online-leagues.com
> sn:
> st: st
> street: str
> telephoneNumber: tn
> uid: testing
> mail: [EMAIL PROTECTED]
>
>
> so I think the dn is right, but I'm not 100% sure now.  Any ideas?
>
> Thanks,
> Chad
>
>
> --
> 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] ldap_modify parameters?

2002-08-01 Thread Chad Day

I think something is wrong with the way I am calling ldap_modify, but I'm
not sure exactly what, from the scripts and tutorials I've been looking
at/experimenting with:

$ds=ldap_connect("online-leagues.com");
if ($ds) {
$r=ldap_bind($ds, 'username', 'password');
// Search surname entry
$sr=ldap_search($ds, 'cn=online-leagues.com', 'uid=testing');
echo "Search result is ".$sr."";
$info = ldap_get_entries($ds, $sr);
   echo "dn is: ". $info[0]["dn"] ."";
echo "first cn entry is: ". $info[0]["cn"][0] ."";
echo "first email entry is: ". $info[0]["mail"][0] ."";
echo "st = ". $info[0]["st"][0] ."";

$info[0]["st"][0]="stchanged!";

ldap_modify($ds, 'uid=testing,cn=online-leagues.com', $info);
echo "Closing connection";
ldap_close($ds);

} else {
echo "Unable to connect to LDAP server";
}

The error returned is:

Fatal error: LDAP: Unknown Attribute in the data in
/usr/local/www/sites/online-leagues.com/htdocs/ldapform.php on line 31

I looked up the error on google but didn't find anything..


Running ldapsearch from the command line on my box, the record looks like:


#
# filter: (objectclass=*)
# requesting: ALL
#

# online-leagues.com
dn: cn=online-leagues.com
objectclass: top
objectclass: organization
objectclass: CommuniGateDomain
cn: online-leagues.com
o: www.online-leagues.com


# testing, online-leagues.com
dn: uid=testing,cn=online-leagues.com
objectclass: top
objectclass: person
objectclass: organizationalPerson
objectclass: inetOrgPerson
objectclass: CommuniGateAccount
cn: rn
hostServer: online-leagues.com
sn:
st: st
street: str
telephoneNumber: tn
uid: testing
mail: [EMAIL PROTECTED]


so I think the dn is right, but I'm not 100% sure now.  Any ideas?

Thanks,
Chad


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




RE: [PHP] FreeBSD 4.6 / PHP 4.2.2 / Apache 2.0.39 install trouble

2002-07-25 Thread Chad Day

The apache configure line was a vanilla configure, only turning on
mod_rewrite and enabling so.

It's really as basic of a configure as I could do.. I don't understand why
it failed. :(

So I did what someone else suggested, tried the ports.. installed apache2,
fine, tried to install mod_php4, selected zlip, mysql, + openldap2.x
support.  Got the packages, then when installing them and it got to apxs, it
was looking for --with-apxs2 since apache 2.x is being used.  apparently the
script used --with-apxs.  I don't see where I can change this.

Unreal that this is this difficult to get working. :\

Chad

-Original Message-
From: Tech Support [mailto:[EMAIL PROTECTED]]
Sent: Thursday, July 25, 2002 2:49 PM
To: Chad Day
Subject: Re: [PHP] FreeBSD 4.6 / PHP 4.2.2 / Apache 2.0.39 install
trouble


Without seeing exactly what steps you took in building both apache and php
it would be next to impossible to guess.

Jim Grill
Support
Web-1 Hosting
http://www.web-1hosting.net
- Original Message -----
From: "Chad Day" <[EMAIL PROTECTED]>
To: "Tech Support" <[EMAIL PROTECTED]>
Sent: Thursday, July 25, 2002 12:53 PM
Subject: RE: [PHP] FreeBSD 4.6 / PHP 4.2.2 / Apache 2.0.39 install trouble


> Ok, I decided to revert back to 1.3.26.
>
> PHP builds fine..
>
> When I go to start Apache:
>
> Syntax error on line 205 of /usr/local/www/conf/httpd.conf:
> Cannot load /usr/local/www/libexec/libphp4.so into server:
> /usr/local/www/libexec/libphp.so: Undefined symbol "core_globals"
>
> What does that mean?  Google turned up 4 results, none relevant, php.net
> search turned up 0.
>
> Thanks,
> Chad
>
> -Original Message-
> From: Tech Support [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, July 25, 2002 1:16 PM
> To: Chad Day; [EMAIL PROTECTED]
> Subject: Re: [PHP] FreeBSD 4.6 / PHP 4.2.2 / Apache 2.0.39 install
> trouble
>
>
> 4.2.2 will not work with apache 2.X from what I've read. However, I have
> heard that if you get the latest CVS of both php and apache it will work.
I
> have not, and probably will not, go down that road just yet :-)
>
> Jim Grill
> Support
> Web-1 Hosting
> http://www.web-1hosting.net
> - Original Message -
> From: "Chad Day" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Thursday, July 25, 2002 11:38 AM
> Subject: [PHP] FreeBSD 4.6 / PHP 4.2.2 / Apache 2.0.39 install trouble
>
>
> > Simple build, no real complicated configure options
> > (--with-mysql, --with-apxs2..) ..
> >
> > During make:
> >
> > php_functions.c:93: syntax error
> > *** Error code 1
> >
> > Stop in /usr/local/php-4.2.2/sapi/apache2filter.
> >
> > etc
> > etc
> >
> >
> > Any idea what the problem would be?  I googled around for a little and
> heard
> > there might be problems getting the latest php to work with apache
2.0.39,
> > but that was a couple weeks ago.. I thought the new 4.2.2 build might
> > address it, but I guess if it's only a security fix like the site says,
> > maybe not.. does 4.2.* just not work with Apache 2.0.39, or is something
> > else amiss?
> >
> > Thanks,
> > Chad
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
> >
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
>




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




[PHP] FreeBSD 4.6 / PHP 4.2.2 / Apache 2.0.39 install trouble

2002-07-25 Thread Chad Day

Simple build, no real complicated configure options
(--with-mysql, --with-apxs2..) ..

During make:

php_functions.c:93: syntax error
*** Error code 1

Stop in /usr/local/php-4.2.2/sapi/apache2filter.

etc
etc


Any idea what the problem would be?  I googled around for a little and heard
there might be problems getting the latest php to work with apache 2.0.39,
but that was a couple weeks ago.. I thought the new 4.2.2 build might
address it, but I guess if it's only a security fix like the site says,
maybe not.. does 4.2.* just not work with Apache 2.0.39, or is something
else amiss?

Thanks,
Chad


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




RE: [PHP] Sessions / logins / cookies / security

2002-07-16 Thread Chad Day

Anyone?  Can someone at least point me to some web article for
recommendations?  I saw some examples where a password variable was stored,
but is that really safe (as long as I MD5 it first?)

Chad

-Original Message-
From: Chad Day [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, July 16, 2002 12:30 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Sessions / logins / cookies / security


I asked something similar a little while ago, but didn't do a good job
clarifying.

What I'm looking to do is when a user logs in, I start up the session.. I
then have the registered session var to verify they are authenticated as
they move throughout the site.

Now, when they close the browser and come back, I want them to still be
authenticated.  Obviously, I have to set a cookie.  But what do I set?  Do I
set just their user ID?  The MD5 of their password?  What's the most secure
way, that's not easily spoofed?  I don't know that much about cookies, but
if I just use a user ID, couldn't someone just change that ID value and
'become' another user?

Thanks for any advice,
Chad


--
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] Sessions / logins / cookies / security

2002-07-16 Thread Chad Day

I asked something similar a little while ago, but didn't do a good job
clarifying.

What I'm looking to do is when a user logs in, I start up the session.. I
then have the registered session var to verify they are authenticated as
they move throughout the site.

Now, when they close the browser and come back, I want them to still be
authenticated.  Obviously, I have to set a cookie.  But what do I set?  Do I
set just their user ID?  The MD5 of their password?  What's the most secure
way, that's not easily spoofed?  I don't know that much about cookies, but
if I just use a user ID, couldn't someone just change that ID value and
'become' another user?

Thanks for any advice,
Chad


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




[PHP] Dumb session / cookie / password questions

2002-07-10 Thread Chad Day

I am a little confused about storing stuff in cookies/sessions and how to
prevent spoofing of them.

A user logs in, his e-mail address or user id and password(md5'ed) is
checked against my database.

Assuming it matches, I then set a cookie with the users id + email.

What is to stop someone from spoofing that cookie?  I obviously don't want
to put the password in a cookie .. can someone point me in the direction of
an article about this?  I've searched around, but I'm not finding stuff
about in a preventing spoofing / security aspect.

Thanks,
Chad


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




[PHP] multi dimensional arrays / radio buttons / mass confusion on my part

2002-07-09 Thread Chad Day

Ok.. what I have is a database of first names and last names, and some other
columns that don't matter here.

A form is presented to a user, lets them enter a bunch of names, attributes
of the person, etc.

After submission, each record is checked against the current database to see
if the name currently exists, or names similar to it exist.

If so, it gives the option of either:

a) entering the new record
or
b) selecting one of the existing records


Example:

Enter your names, positions:
Joe Schmoe, LW
Random Guy, RW

(submit button)

After DB check for existing users:

Found:

()  Joey Schmoe   Click radio button to se this record
()  Create New Record


No matches found for Random Guy, must be a new user.

(submit button)


My problem is keeping this data consistent form by form, and updating the
data when an existing record is selected instead of creating a new one (the
existing data needs to go into another table, so I need to grab the user id
# of the existing record, etc)

Any thoughts on how to approach this?  After the first form, should I make a
multi-dimensional array, and have the second form update/change the elements
of it?  I haven't used any PHP arrays in this yet, just been messing with
the HTML form array stuff..

Sorry if this is confusing.. if any part needs clarification, please let me
know.

Thanks,
Chad


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




RE: [PHP] PHP to Excel?

2002-06-18 Thread Chad Day

Annoying doesn't begin to describe it.

I'm going with the HTML/Excel Header bit, since Biffwriter costs way too
much for a for-profit business to use.  Thanks anyway.. looks pretty neat,
and I'll probably use it for some other projects I do.

Thanks,
Chad

-Original Message-
From: 1LT John W. Holmes [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, June 18, 2002 11:47 AM
To: Martin Lucas; 'Chad Day'; [EMAIL PROTECTED]
Subject: Re: [PHP] PHP to Excel?


The layout on that site is so annoying. Yeah, it looks pretty, but it's
annoying. It's PHP2Excel BiffWriter that your looking for on that site.
Should be one of the topics when you expand the central "dot" (after you
close the "news' popup). annoying...

Like someone else said, I just use HTML and send an Excel header(). Works
great and it's perfect for simple stuff. I'll probably move to PHP2Excel
BiffWriter eventually, though.

---John Holmes...
- Original Message -
From: "Martin Lucas" <[EMAIL PROTECTED]>
To: "'Chad Day'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Tuesday, June 18, 2002 11:24 AM
Subject: AW: [PHP] PHP to Excel?


hi chad,

on http://www.cnovak.com/ you'll find a php-class that generates native
excel-files, even with cell formatings and other more or less useful things.


greetings

martin

> -Ursprüngliche Nachricht-
> Von: Chad Day [mailto:[EMAIL PROTECTED]]
> Gesendet: Dienstag, 18. Juni 2002 16:52
> An: [EMAIL PROTECTED]
> Betreff: [PHP] PHP to Excel?
>
>
> I'm trying to get data from my MySQL database into Excel
> using PHP.  I know
> and I am doing it right now by generating a CSV file, but is
> there any way I
> can do formatting, like make certain cells bold, etc etc?  Is
> there a list
> of codes somewhere I can use to put before my field output to
> make a field
> bold, stuff like that?
>
> Thanks,
> Chad
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

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




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




[PHP] PHP to Excel?

2002-06-18 Thread Chad Day

I'm trying to get data from my MySQL database into Excel using PHP.  I know
and I am doing it right now by generating a CSV file, but is there any way I
can do formatting, like make certain cells bold, etc etc?  Is there a list
of codes somewhere I can use to put before my field output to make a field
bold, stuff like that?

Thanks,
Chad


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




[PHP] Mailing list software recommendation?

2002-05-23 Thread Chad Day

I'm looking for PHP/MySQL based mailing list software for a project I'm
doing.. I plan on hosting a bunch of virtual domains and having to set up
mailing lists for all of them, and I don't want to go installing a new copy
of the software for each virtual domain.  The rest of the site is in PHP and
uses a MySQL back-end for user-authentication and authentication to other
software (tying in a bulletin board/forum login, and some other custom
things), so I definetly want MySQL involved for the authentication.

Any suggestions?  I've been poking around for a little while and I haven't
really seen anything addressing the virtual domain issue.. I'm sure there's
something out there, ISPs and such have to be using something, I just don't
know what it is..

Thanks,
Chad


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




RE: [PHP] Problems upgrading PHP..

2002-05-02 Thread Chad Day

Well, that worked for variable tracking, but MySQL seems to have been broken
in the process.. or rather, PHP accessing it..

Warning: MySQL: Unable to save result set in
/usr/local/www/vhosts/bangable.com/htdocs/forums/admin/db_mysql.php on line
92

If I do a phpinfo();, my PHP configure line reads:

'./configure' '--with-mysql' '--with-apxs'

but I know I did
./configure --with-mysql=/usr/local --with-apxs=/mypathtoapxs etc etc ..

Still really confused..

Chad

-----Original Message-
From: Chad Day [mailto:[EMAIL PROTECTED]]
Sent: Thursday, May 02, 2002 2:52 PM
To: Rasmus Lerdorf
Cc: [EMAIL PROTECTED]
Subject: RE: [PHP] Problems upgrading PHP..


php.ini didn't exist before apparently on this server I'm on.. or rather, it
was a 0 byte file.

Thanks, Rasmus.

Chad

-Original Message-
From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]]
Sent: Thursday, May 02, 2002 2:58 PM
To: Chad Day
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] Problems upgrading PHP..


Turn on register_globals in your php.ini file.

This shouldn't have changed in a simple upgrade, unless you didn't have a
php.ini file before, or you forgot to compile PHP to find your existing
php.ini file.

-Rasmus

On Thu, 2 May 2002, Chad Day wrote:

> So I'm trying to upgrade PHP from 4.0.1 to 4.2.0 on a box I have that had
> Apache 1.3.12 preinstalled, the source isn't on the box.
>
> mod_so is installed, so I just grabbed the new PHP tarball, unzipped it in
> /usr/local, and started compiling with the options I want, successfully
> built it, overwrote the old libphp4.so with the new one created, copied
over
> the php.ini file with the new one, and restarted.
>
> It loads up fine, but sessions don't seem to work -at all-.
>
> Even variables I tack onto the end of URLs seem to get lost, which renders
> just about everything I've done in PHP inoperable, it just seems to lose
> these variables or not keep track of them to begin with.
>
> What did I do wrong?
>
> Chad
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


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



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



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




RE: [PHP] Problems upgrading PHP..

2002-05-02 Thread Chad Day

php.ini didn't exist before apparently on this server I'm on.. or rather, it
was a 0 byte file.

Thanks, Rasmus.

Chad

-Original Message-
From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]]
Sent: Thursday, May 02, 2002 2:58 PM
To: Chad Day
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] Problems upgrading PHP..


Turn on register_globals in your php.ini file.

This shouldn't have changed in a simple upgrade, unless you didn't have a
php.ini file before, or you forgot to compile PHP to find your existing
php.ini file.

-Rasmus

On Thu, 2 May 2002, Chad Day wrote:

> So I'm trying to upgrade PHP from 4.0.1 to 4.2.0 on a box I have that had
> Apache 1.3.12 preinstalled, the source isn't on the box.
>
> mod_so is installed, so I just grabbed the new PHP tarball, unzipped it in
> /usr/local, and started compiling with the options I want, successfully
> built it, overwrote the old libphp4.so with the new one created, copied
over
> the php.ini file with the new one, and restarted.
>
> It loads up fine, but sessions don't seem to work -at all-.
>
> Even variables I tack onto the end of URLs seem to get lost, which renders
> just about everything I've done in PHP inoperable, it just seems to lose
> these variables or not keep track of them to begin with.
>
> What did I do wrong?
>
> Chad
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


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



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




[PHP] Problem reading in and displaying an image...

2002-04-02 Thread Chad Day

I'm trying to read in a 1x1 pixel file and display it, basically to assist
in setting 3rd party cookies (our other affiliated sites that don't follow
under the same domain.. it's really sloppily set up, but thats another
story)..  The problem I have is the script is just hanging, sits there and
does nothing, constantly trying to load..


setcookie("$cookieName", $u, $expire, "/");
setcookie("$cookieName"."logon", $t, $expire, "/");

$fd = fopen("http://www.armytimes.com/images/spacer.gif";, "r");
$image = fread($fd, 5024);
fclose($fd);
Header("Content-type: image/gif");
echo $image;

exit();


now, if I comment out the Header and echo $image; lines, the script works
fine, it reads in the file with no problem it seems.  But when I turn those
2 lines back on, it totally hangs.  does anyone have any ideas?  I am
totally stumped.

Thanks,
Chad


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




[PHP] Session Variables

2002-03-25 Thread Chad Gilmer

Hi There,

I am a beginner to PHP and I am tring to use session variables on my site.

I am trying to use Session Variables in PHP on the iPLANIT.tv site

When I use the following code:



I get the following error

Warning: Cannot send session cookie - headers already sent by (output
started at /home/iplanit/public_html/php/login.php:8) in
/home/iplanit/public_html/php/login.php on line 11

Warning: Cannot send session cache limiter - headers already sent (output
started at /home/iplanit/public_html/php/login.php:8) in
/home/iplanit/public_html/php/login.php on line 11

Any Ideas???

Cheers

Chad



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




[PHP] exec()

2002-02-18 Thread Chad

Does anyone know if I can exec a perl script from a php script even if my isp doesn't 
allow me to run perl scripts from the command line?




[PHP] Multi-dimensional nested arrays in Smarty

2001-10-27 Thread Chad Guilette

I've asked a few questions before on Smarty here and I've worked through
them but this one really has me.

I checked the Smarty lists for answers and couldn't find a clear answer.
Here is my problem.

i want to do something to this effect

{section name=loop_index   loop=$DATA_ARRAY}
{$DATA_ARRAY[loop_index].somevalue}
{section name=loop_index2   loop=$INNER_ARRAY[loop_index]}
{$INNER_ARRAY[loop_index][loop_index2].SOMEVALUE}
{/section}
{/section}

I basically have an associative array $DATA_ARRAY and I want a second two
dimensional array where the first array index is the subscript of the first
so I basically iterate through the second array within a specific row.

but for the life of me I can't get this properly.

how would I set this up properly during assignment and output?

I believe the above is right for output but what about assignment?

$templ_var->append("INNER_ARRAY", ?);

I've tried a lot of things but none seem to work...

If anyone of you have any insight it would be greatly appreciated.

[EMAIL PROTECTED]




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Multi-dimensional nested arrays in Smarty

2001-10-27 Thread Chad Guilette

I've asked a few questions before on Smarty here and I've worked through them but this 
one really has me.

I checked the Smarty lists for answers and couldn't find a clear answer.  Here is my 
problem.

i want to do something to this effect

{section name=loop_index   loop=$DATA_ARRAY}
{$DATA_ARRAY[loop_index].somevalue}
{section name=loop_index2   loop=$INNER_ARRAY[loop_index]}
{$INNER_ARRAY[loop_index][loop_index2].SOMEVALUE}
{/section}
{/section}

I basically have an associative array $DATA_ARRAY and I want a second two dimensional 
array where the first array index is the subscript of the first so I basically iterate 
through the second array within a specific row.

but for the life of me I can't get this properly.

how would I set this up properly during assignment and output?

I believe the above is right for output but what about assignment?

$templ_var->append("INNER_ARRAY", ?);

I've tried a lot of things but none seem to work...

If anyone of you have any insight it would be greatly appreciated.

[EMAIL PROTECTED]





[PHP] Multi-dimensional nested arrays in Smarty

2001-10-26 Thread Chad Guilette

I've asked a few questions before on Smarty here and I've worked through them but this 
one really has me.

I checked the Smarty lists for answers and couldn't find a clear answer.  Here is my 
problem.

i want to do something to this effect

{section name=loop_index   loop=$DATA_ARRAY}
{$DATA_ARRAY[loop_index].somevalue}
{section name=loop_index2   loop=$INNER_ARRAY[loop_index]}
{$INNER_ARRAY[loop_index][loop_index2].SOMEVALUE}
{/section}
{/section}

I basically have an associative array $DATA_ARRAY and I want a second two dimensional 
array where the first array index is the subscript of the first so I basically iterate 
through the second array within a specific row.

but for the life of me I can't get this properly.

how would I set this up properly during assignment and output?

I believe the above is right for output but what about assignment?

$templ_var->append("INNER_ARRAY", ?);

I've tried a lot of things but none seem to work...

If anyone of you have any insight it would be greatly appreciated.

[EMAIL PROTECTED]



[PHP] php or perl bug when execing php scripts?

2001-10-21 Thread Chad Cunningham


I saw another post on this that got no response, I figure I should try
again before filing another bug report. I've got some perl cgi scripts
that I have to keep, and I need them to do some things in php that are
already done in php, it's not really practical to rewrite either of these
so it's all in the same language.

So I need to execute a php script from the perl cgi. The php script works
fine from a command line. It works fine from a command line as the
webserver user. But it won't work from a perl cgi script. Here's what I've
tried and the result of each.

1) put #!/usr/local/bin/php at the top of the php file
   call from perl with `/path/to/script arg1 arg2`

Result: php returns "No input file specified"

2) left out #! in file
   call from perl with `/path/to/php /path/to/script arg1 arg2`

Result: no arguments get passed to script

3) left out #! in file
   call from perl with `/path/to/php "/path/to/script arg1 arg2"`

Result: php returns "No input file specified"

4) left out #! in file
   call from perl with `/path/to/php -f /path/to/script arg1 arg2`

Result: php returns "No input file specified"

Is this a bug? Am I doing something wrong here? This should work...

-- 

Chad Cunningham
[EMAIL PROTECTED]

"Well, once again my friend, we find that science is a two-headed beast. One
head is nice, it gives us aspirin and other modern conveniences,...but the
other head of science is bad! Oh beware the other head of science, Arthur, it
bites!"


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] include error with no includes

2001-09-05 Thread Chad Cunningham


> I could be way off, but it sounds like a permissions problem.  The user
> that your webserver runs as probably no longer has access to the page.

Allright, how did I not think of that :) Seems someone has been messing
around with permissions on the server, thanks!

-- 

Chad Cunningham
[EMAIL PROTECTED]

"Well, once again my friend, we find that science is a two-headed beast. One
head is nice, it gives us aspirin and other modern conveniences,...but the
other head of science is bad! Oh beware the other head of science, Arthur, it
bites!"


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] include error with no includes

2001-09-05 Thread Chad Cunningham


I've got a few php pages that a while back started giving the following
include error:

Warning: Failed opening '/home/ccunning/WWW/probability.php3' for
inclusion (include_path='.:/web/php/include:/web/php/phplib') in Unknown
on line 0

There are no includes in this page, there is no auto-prepend file defined.
Why is it trying to include the page from an Unknown file? Why aren't all
the pages doing this? I have seen this on two different machines, both
Linux, both were running php 4.0.4p1 and updating both to 4.0.6 didn't fix
it...

-- 

Chad Cunningham
[EMAIL PROTECTED]

"Well, once again my friend, we find that science is a two-headed beast. One
head is nice, it gives us aspirin and other modern conveniences,...but the
other head of science is bad! Oh beware the other head of science, Arthur, it
bites!"


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Session problem

2001-08-08 Thread Chad Day

What it looks like it is doing to me, if you hit the script and reload it a
bunch, is it creates a session, sticks with it for a while, then dumps it ..
it then creates another session, starts over at 1, and begins counting up..
then sometimes it will see the old session, and go back to it ..

Like, this will happen:

You've seen this page 1 times  (not gonna repeat the text)
2
3
4
5
1 // lost 1st session here
2
6 // regain 1st session
3 // switch
7
8
9
4 // switch

no matter how many times I reload that page, it seems to generate a max of 2
sessions.  wtf is going on?

Chad

-Original Message-
From: Chad Day [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, August 08, 2001 2:36 PM
To: Johnson, Kirk; [EMAIL PROTECTED]
Subject: RE: [PHP] Session problem


Still not working.  My script is -exactly- as you have it below, and I
believe I've tried that before.

(begins pulling out hair)

Chad

-Original Message-
From: Johnson, Kirk [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, August 08, 2001 2:31 PM
To: [EMAIL PROTECTED]
Subject: RE: [PHP] Session problem


> > >  > > session_start();
> > > global $count;
> > > session_register ("count");
> > > $count++;
> > > ?>
> > >
> > > Hello visitor, you have seen this page  > > $HTTP_SESSION_VARS["count"]; ?> times.

There was a bug in PHP in versions prior to 4.0.6: $count and
$HTTP_SESSION_VARS["count"] did not reference the same value while on the
*current* page. Try this:


Hello visitor, you have seen this page  times.

Kirk

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Session problem

2001-08-08 Thread Chad Day

Still not working.  My script is -exactly- as you have it below, and I
believe I've tried that before.

(begins pulling out hair)

Chad

-Original Message-
From: Johnson, Kirk [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, August 08, 2001 2:31 PM
To: [EMAIL PROTECTED]
Subject: RE: [PHP] Session problem


> > >  > > session_start();
> > > global $count;
> > > session_register ("count");
> > > $count++;
> > > ?>
> > >
> > > Hello visitor, you have seen this page  > > $HTTP_SESSION_VARS["count"]; ?> times.

There was a bug in PHP in versions prior to 4.0.6: $count and
$HTTP_SESSION_VARS["count"] did not reference the same value while on the
*current* page. Try this:


Hello visitor, you have seen this page  times.

Kirk

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Session problem

2001-08-08 Thread Chad Day

No, as the way I'm getting around this right now is I'm -using- cookies.
Plus, I gave the URL, so you guys could see what is happening .. it's not a
client-side issue.

Sorry if I sound frustrated, but I really am at this point. :)

The URL again is: http://www.militarycity.com/classified/realtors/count.php

Chad

-Original Message-
From: Bjorn Van Simaeys [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, August 08, 2001 1:09 PM
To: [EMAIL PROTECTED]
Subject: RE: [PHP] Session problem


Maybe you have your cookies turned off in your
browser? Something that is easily forgotten..


Greetz,
Bjorn Van Simaeys
www.bvsenterprises.com



--- Chad Day <[EMAIL PROTECTED]> wrote:
> Nope.  Same problem.  I'm seriously thinking there's
> a bug in the version of
> PHP I am running at this point, but I searched
> php.net and found no mention
> of anything ..
>
> Chad
>
> -Original Message-
> From: Brian Dunworth
> [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, August 08, 2001 10:37 AM
> To: [EMAIL PROTECTED]
> Cc: 'Chad Day'
> Subject: RE: [PHP] Session problem
>
>
>
> On Wednesday, August 08, 2001 at 9:16 AM, Chad Day
> said:
> > I wish it did.
> >
> > Still the same problem.
> >
> >  > session_start();
> > global $count;
> > session_register ("count");
> > $count++;
> > ?>
> >
> > Hello visitor, you have seen this page  > $HTTP_SESSION_VARS["count"]; ?> times.
>
>
>   You're asking the session to remember a value (
> session_register() ), then
> changing that value ( $count++ ) and not
> re-registering it, then complaining
> when the session returns the value you asked it to
> remember.
>
>   What if you did:
>
>  session_start();
> $count++;
> session_register ("count");
> ?>
>
>
>  - Brian
>
>  ---
>   Brian S. Dunworth
>   Sr. Software Development Engineer
>   Oracle Database Administrator
>   The Printing House, Ltd.
>   (850) 875-1500 x225
>  ---
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> To contact the list administrators, e-mail:
> [EMAIL PROTECTED]
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> To contact the list administrators, e-mail:
> [EMAIL PROTECTED]
>


__
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Session problem

2001-08-08 Thread Chad Day

Nope.  Same problem.  I'm seriously thinking there's a bug in the version of
PHP I am running at this point, but I searched php.net and found no mention
of anything ..

Chad

-Original Message-
From: Brian Dunworth [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, August 08, 2001 10:37 AM
To: [EMAIL PROTECTED]
Cc: 'Chad Day'
Subject: RE: [PHP] Session problem



On Wednesday, August 08, 2001 at 9:16 AM, Chad Day said:
> I wish it did.
>
> Still the same problem.
>
>  session_start();
> global $count;
> session_register ("count");
> $count++;
> ?>
>
> Hello visitor, you have seen this page  $HTTP_SESSION_VARS["count"]; ?> times.


  You're asking the session to remember a value ( session_register() ), then
changing that value ( $count++ ) and not re-registering it, then complaining
when the session returns the value you asked it to remember.

  What if you did:




 - Brian

 ---
  Brian S. Dunworth
  Sr. Software Development Engineer
  Oracle Database Administrator
  The Printing House, Ltd.
  (850) 875-1500 x225
 ---



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Session problem

2001-08-08 Thread Chad Day

I wish it did.

Still the same problem.



Hello visitor, you have seen this page  times.

http://www.militarycity.com/classified/realtors/count.php

Chad

-Original Message-
From: karthik [mailto:[EMAIL PROTECTED]]
Sent: Sunday, July 08, 2001 1:08 AM
To: Chad Day
Subject: Re: [PHP] Session problem


Hi,

Have u tried $HTTP_SESSION_VARS["NAME"] ?

Try it. I am sure it will work.

Karthik


- Original Message -----
From: "Chad Day" <[EMAIL PROTECTED]>
To: "mike cullerton" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Tuesday, August 07, 2001 6:46 PM
Subject: RE: [PHP] Session problem


> I tried this, I still have the same problem.  Is this a bug in the version
> of PHP I am running?
>
> Chad
>
> -Original Message-
> From: mike cullerton [mailto:[EMAIL PROTECTED]]
> Sent: Monday, August 06, 2001 4:58 PM
> To: Chad Day; [EMAIL PROTECTED]
> Subject: Re: [PHP] Session problem
>
>
> i would try
>
> session_start();
> session_register("NAME");
>
> $res = mysql_query("SELECT NAME FROM dbhere where EMAIL = '$EMAIL' AND
> PASSWORD = '$PASSWORD'");
>
> if ($row = mysql_fetch_array($res)) {
>  $NAME = $row[NAME];
> }
>
> notice that $NAME is registered before being assigned to.
>
> on 8/6/01 2:23 PM, Chad Day at [EMAIL PROTECTED] wrote:
>
> > PHP 4.0.2 ..
> >
> > I have a very basic script, gets the user's name, registers it, then
> > displays "Welcome, $NAME."   $NAME is the session registered name.
> >
> > If I constantly reload that page that says Welcome, sometimes $NAME
> appears,
> > sometimes not.  Completely random.  It just loses track of the variable.
> >
> > My code:
> >
> > auth.php:
> >
> > session_start();
> >
> > ...
> >
> > $res = mysql_query("SELECT NAME FROM dbhere where EMAIL = '$EMAIL' AND
> > PASSWORD = '$PASSWORD'");
> >
> > if ($row = mysql_fetch_array($res)) {
> > $NAME = $row[NAME];
> > session_register("NAME");
> > }
> >
> > ...
> >
> > Header("Location: menu.php");
> >
> >
> >
> > menu.php:
> >
> > session_start();
> >
> > echo "Welcome, $NAME";
> >
> >
> >
> > So like, what the hell.  Why would it keep losing track of $NAME?
> >
> > Thanks,
> > Chad
> >
>
>
> -- mike cullerton
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Session problem

2001-08-07 Thread Chad Day

Done, still not working.   I know that usually has to be there, I was just
going to copy the example from the manual directly, since the session should
automatically kickoff when it hits the session_register bit.  This truly has
me baffled.

Chad

-Original Message-
From: hassan el forkani [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, August 07, 2001 9:37 AM
To: Chad Day
Cc: [EMAIL PROTECTED]
Subject: RE: [PHP] Session problem


oh i forgot!!!
you have to put this at the beginning of your page


indeed it's not working properly,
first of all please make sur the pages are not cashed send a header
(Cache-control: NO cache) i'm not sure about the syntax so check the manual
then try to modify your code like this and tell us what happens:


might seem a little overloaded but it's to make sur there is no confusion
between count as a session var and the other var;
if this is not working then the problem is else whrere and w'll continue
lokkin :))

regards



At 15:41 07/08/01, you wrote:
>Still loses it .. check this out:
>
>http://www.militarycity.com/classified/realtors/count.php
>
>The entire code for that page, taken from an example on zend:
>
>session_register ("count");
>$count++;
>?>
>
>Hello visitor, you have seen this page  times.
>
>
>Try loading it about 10 times or so, watch what happens.
>
>Chad
>
>-Original Message-
>From: hassan el forkani [mailto:[EMAIL PROTECTED]]
>Sent: Tuesday, August 07, 2001 8:34 AM
>To: Chad Day
>Subject: RE: [PHP] Session problem
>
>
>hello
>
>At 15:16 07/08/01, you wrote:
> >My code:
> > >
> > > auth.php:
> > >
> > > session_start();
> > >
> > > ...
> > >
> > > $res = mysql_query("SELECT NAME FROM dbhere where EMAIL = '$EMAIL' AND
> > > PASSWORD = '$PASSWORD'");
> > >
> > > if ($row = mysql_fetch_array($res)) {
>
>//try adding this:
>  global $NAME;
>
> > > $NAME = $row[NAME];
> > > session_register("NAME");
> > > }
> > >
> > > ...
> > >
> > > Header("Location: menu.php");
>
>
>regards



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Session problem

2001-08-07 Thread Chad Day

I tried this, I still have the same problem.  Is this a bug in the version
of PHP I am running?

Chad

-Original Message-
From: mike cullerton [mailto:[EMAIL PROTECTED]]
Sent: Monday, August 06, 2001 4:58 PM
To: Chad Day; [EMAIL PROTECTED]
Subject: Re: [PHP] Session problem


i would try

session_start();
session_register("NAME");

$res = mysql_query("SELECT NAME FROM dbhere where EMAIL = '$EMAIL' AND
PASSWORD = '$PASSWORD'");

if ($row = mysql_fetch_array($res)) {
 $NAME = $row[NAME];
}

notice that $NAME is registered before being assigned to.

on 8/6/01 2:23 PM, Chad Day at [EMAIL PROTECTED] wrote:

> PHP 4.0.2 ..
>
> I have a very basic script, gets the user's name, registers it, then
> displays "Welcome, $NAME."   $NAME is the session registered name.
>
> If I constantly reload that page that says Welcome, sometimes $NAME
appears,
> sometimes not.  Completely random.  It just loses track of the variable.
>
> My code:
>
> auth.php:
>
> session_start();
>
> ...
>
> $res = mysql_query("SELECT NAME FROM dbhere where EMAIL = '$EMAIL' AND
> PASSWORD = '$PASSWORD'");
>
> if ($row = mysql_fetch_array($res)) {
> $NAME = $row[NAME];
> session_register("NAME");
> }
>
> ...
>
> Header("Location: menu.php");
>
>
>
> menu.php:
>
> session_start();
>
> echo "Welcome, $NAME";
>
>
>
> So like, what the hell.  Why would it keep losing track of $NAME?
>
> Thanks,
> Chad
>


-- mike cullerton



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Session problem

2001-08-06 Thread Chad Day

PHP 4.0.2 ..

I have a very basic script, gets the user's name, registers it, then
displays "Welcome, $NAME."   $NAME is the session registered name.

If I constantly reload that page that says Welcome, sometimes $NAME appears,
sometimes not.  Completely random.  It just loses track of the variable.

My code:

auth.php:

session_start();

...

$res = mysql_query("SELECT NAME FROM dbhere where EMAIL = '$EMAIL' AND
PASSWORD = '$PASSWORD'");

if ($row = mysql_fetch_array($res)) {
$NAME = $row[NAME];
session_register("NAME");
}

...

Header("Location: menu.php");



menu.php:

session_start();

echo "Welcome, $NAME";



So like, what the hell.  Why would it keep losing track of $NAME?

Thanks,
Chad


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Apache

2001-08-03 Thread Angerer, Chad

add yourself to the apache group in the groups file.  This will allow you to
do a chmod for the group on the apaceh dir so you are able to write to it.

chmod +775 I think you would want to do on the directory.

C

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Thursday, August 02, 2001 8:16 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Apache


This is just a little bit off-topic - sorry

I'm running Mandrake 8.0 and am pretty new to Linux. I want to download my 
entire website to my hard drive and put it in hte /var/www folder, but
apache 
is the owner and the group for that directory. I'm just wondering, if I
chown 
the directory so that I am the owner, would that cause problems somehow? Or 
is it possible to chmod it so that apache is still the owner but i am
allowed 
to write to it?  

TIA

Tom Malone

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Re: FAQ

2001-08-01 Thread Angerer, Chad

Isn't it Personal Home Pages?

Chad

-Original Message-
From: Johnson, Kirk [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, August 01, 2001 10:55 AM
To: php
Subject: RE: [PHP] Re: FAQ


> Does anyone know what PHP stands for?

PHP => People Hate Perl.

No, that's just a joke, no flames please :)

PHP Hypertext Preprocessor.

Kirk

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] HELP!! What wrong with this code...

2001-07-31 Thread Angerer, Chad

escape the double quotes around the href... with \"

PHP thinks youe are ending the echo string prematurely.

-Original Message-
From: Steve Wright [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, July 31, 2001 11:13 AM
To: PHP List
Subject: [PHP] HELP!! What wrong with this code...


Hey, i am getting an error passed back for this line of code, the rest of
the code is below:

echo "Your feedback has been sent to mailto:$address";>$name";

the error is:

Parse error: parse error, expecting `','' or `';'' in
/www/customers/stevewrightonline.co.uk/form/do_sendform.php on line 20


Does anyone know y this is?? If i remove the a href tags it works fine. Can
you not use links properly in PHP??

--
 \n";
$mailheaders = "Reply-To: $sender_email\n\n";

/*The Message*/
$msg = "Sender:\t mailto:$sender_email \t $sender_name\n\n";
$msg = "Message:\t$message\n\n";

/*Mail to Me*/
mail($recipient, $subject, $msg, $mailheaders);


/*Onscreen confirmation of sending*/
echo "Form Sent!";
echo "Thank You, $sender_name";
echo "Your feedback has been sent to mailto:$address";>$name";
echo "";
?>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Example high-profile PHP sites

2001-07-26 Thread Chad Day

How about my site..  http://www.bangable.com

Might not be the kind of site you want to put on your list, but we do get a
lot of traffic.. 4 million page views a month.   All PHP/mysql.

Chad

-Original Message-
From: Maurice Rickard [mailto:[EMAIL PROTECTED]]
Sent: Thursday, July 26, 2001 12:36 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Example high-profile PHP sites


For a number of reasons, I need to offer a client a list of big,
impressive-sounding, high-profile sites using PHP.  I went looking
for the list on PHP.net, and the closest I could find is
http://pt2.php.net/sites.php  which, as you'll see, is suffering from
a fatal error.

I did find a list at http://php.datalogica.com/sites.php which, while
helpful,  seems a bit dated.  Does anyone have some favorite examples
that aren't on this list?

I've been preparing other arguments as well, but the "all the cool
people are doing it" examples will help.

Thanks!
--
Maurice Rickard
http://mauricerickard.com/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] auto link?

2001-07-16 Thread Chad Day

Here's a function I use on a text field..


function activateUrls( $s ) {
  $o = '';
  while ($s != '') {
$url = '';
$temp = split('://', $s, 2);
if (count($temp)>1) {   # '://' found; now extract schema
  $s = $temp[1];
  $temp2 = split('[^[:alpha:]]', strrev($temp[0]), 2);
  $schema = strrev($temp2[0]); # this gets schema
  $o .= substr($temp[0], 0, strlen($temp[0])-strlen($schema));
  if ($schema != '') { # this ensures a non-null schema
$temp3 = split("[[:space:],'\"<>:]", $s, 2);
$url = $schema . '://' . $temp3[0];
$ns = substr($s, strlen($temp3[0]),1) . $temp3[1];
if ($temp3[0] != '') {
  $o .= "$url";
} else {
  $o .= $url;
}
$s = $ns;
  }
  else {
$o .= '://';
  }
}
else {
  $o .= $s;
  $s = '';
}
  } // while
  return $o;
}


Hope this helps,
Chad

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Monday, July 16, 1979 4:01 PM
To: [EMAIL PROTECTED]
Subject: [PHP] auto link?


On Ray's advice I've given up on letting the users put html into my form.
But I would like any http:// type addresses they include to be turned into
hyper links:



http://www.mysite.com>www.mysite.com

is there a script or function some place I can use to do this? Or must I try
to write something of my own?


Susan


--
[EMAIL PROTECTED]
http://futurebird.diaryland.com



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] GD help

2001-07-13 Thread Angerer, Chad

I am having some problems generating images with GD.  I am using GD 1.6.2
and trying to create a .png image.  I know it works.  I have created just a
generic graphic without trying to put variables into it and am hoping
someone can help me on this one.  Here is some code snippet

// here is my gd.php file to create the image



// here is the function that I use to determine the attributes of the image

// create a function to call gd.php
function graphic($blueval, $redval)
{
$pctrd = round($blueval*100, 1);
$pctbl = round($redval*100, 1);
$blueval = ($blueval * 200);
$redval = ($redval * 200);

echo "

$pctbl%

$pctrd

";
}

On the page I get a broken image.  If I view the source I see the image is
being called with params.

Any help would be appreciated.

Thanks.

Chad

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Not sure how to describe this problem..

2001-07-10 Thread Chad Day

I have a chunk of code in a webpage that works like this, to rotate some
ads.. :

if ($row = mysql_fetch_array($getads)) {
do {
$POS = $row[LASTPOS];
$ID = $row[ID];
$POS++;
if ($POS > $numads) {
$POS = 1;
}

$update = mysql_query("UPDATE adtracker set LASTPOS = '$POS' 
where ID =
'$ID'");
echo $row[LINKLOC];

} while ($row = mysql_fetch_array($getads));

}

so it grabs the last position that ad was in from the DB, increments it by
1, unless incrementing it would push it past the max # of ads, so it resets
the position to 1.

The problem is, the site gets a lot of traffic, and instead of the ads
retaining positions like:

1, 2, 3   or  2, 3, 1   or  3, 1, 2   as they should, I've seen it somehow
go to:

1, 1, 3,  or  2, 2, 1  etc.

So I guess what is happening is that when 2 people hit the page at the exact
same time, it's getting updated values out of the DB for some of the ads
before they are all updated.. how can I go about controlling this?

Thanks,
Chad


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Re: string formatting help

2001-07-06 Thread Chad Day

Yeah, I was seeing them.  And when I stripped them out and replaced them
with white space, it still broke in those places, it'd look like:

kdjsakdasja

dsakjaskjsa


dsakaskj

But I got it fixed..

$RESPONSE = addslashes($row[RESPONSE]);
$OVERLIBBED = str_replace(chr(13), "", $RESPONSE);
$OVERLIBBED = str_replace(chr(10), "", $OVERLIBBED);

is what worked for me ..

Thanks all,
Chad

-Original Message-
From: Steve Edberg [mailto:[EMAIL PROTECTED]]
Sent: Friday, July 06, 2001 4:29 PM
To: Chad Day; [EMAIL PROTECTED]
Subject: [PHP] Re: string formatting help


In the original message below, did you mean that you're actually
SEEING the  tags in the output? If so, there may be a conversion
with htmlentities() going on somewhere that converts the  tags to
<br> (so they are displayed instead of being interpreted).

If you replaced the 's with spaces or newlines, the output
_should_ all be on one line, since HTML considers ALL strings of
whitespace (tabs, newlines, returns, spaces) to be a single space. If
you replaced 's with newlines and you are getting the line breaks
still, your output may be in a ... block.

- steve


At 3:36 PM -0300 7/6/01, "InÈrcia Sensorial" <[EMAIL PROTECTED]> wrote:
>   Maybe:
>
>$array = explode("", $string);
>
>foreach ($array as $key => $value) {
> echo "$value";
>}
>
>   Would separate the string by 's and print all in one line.
>


Or, more compactly:

echo str_replace('', '', $string);

This would only work if tags were lowercased; to handle mixed case,
you'd need to do

echo eregi_replace('', '', $string);

or use the preg equivalent




>   Julio Nobrega.
>
>A hora est· chegando:
>http://sourceforge.net/projects/toca
>
>"Chad Day" <[EMAIL PROTECTED]> wrote in message
>[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>>  I'm trying to pull a string from a database to use in a javascript
>>  function.. but it's doing line breaks on me, which in turn messes up the
>>  javascript.
>>
>>  The string in the mysql db is like:
>>  kjdsakjadkskjdkskjkdfjdfkjfd
>>
>>  When I pull it out, it becomes:
>>
>>  kjdsakjadk
>>  
>>  skjdks
>>  
>>  
>>  kjkdfjdfkjfd
>>
>>  I've tried replacing the br's with blank spaces or new line characters,
>but
>>  in the html code it still breaks on those breaks when I echo it back
out.
>>  How can I force this string to be all on one line?
>>
>>  Thanks,
>  > Chad
>>

--
+-- Factoid: Of the 100 largest economies in the world, 51 are --+
| Steve Edberg   University of California, Davis |
| [EMAIL PROTECTED]   Computer Consultant |
| http://aesric.ucdavis.edu/  http://pgfsun.ucdavis.edu/ |
+--- corporations -- http://www.ips-dc.org/reports/top200text.htm ---+

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] string formatting help

2001-07-06 Thread Chad Day

I'm trying to pull a string from a database to use in a javascript
function.. but it's doing line breaks on me, which in turn messes up the
javascript.

The string in the mysql db is like:
kjdsakjadkskjdkskjkdfjdfkjfd

When I pull it out, it becomes:

kjdsakjadk

skjdks


kjkdfjdfkjfd

I've tried replacing the br's with blank spaces or new line characters, but
in the html code it still breaks on those breaks when I echo it back out.
How can I force this string to be all on one line?

Thanks,
Chad


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] addslashes problem ..

2001-07-06 Thread Chad Day

I have to use addslashes on a string of mine so I can use it in a javascript
function, so that when a link is clicked, a html textarea box is populated
with that string.

The problem I have is that if there are line breaks in the string, the
's seem to get created when addslashes is run on the string, then in the
textarea box my string looks like:

i can't do thatright nowbut maybe later

How can I get the slashes escaped properly, but keep the same format?  I
tried this:

$RESPONSE = eregi_replace('', "\n",
$RESPONSE);

but it didn't work for me, it just kinda merged all the strings together, no
line breaks (or 's) at all.

Thanks,
Chad


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] problems with round ..

2001-06-27 Thread Chad Day

Yes, it is.  I've tried it on a couple different php4 servers, I've never
gotten it to work.

Chad

-Original Message-
From: CC Zona [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, June 26, 2001 8:00 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] problems with round ..


In article <[EMAIL PROTECTED]>,
 [EMAIL PROTECTED] ("Chad Day") wrote:

> $BLAH = round($BLAH, 2);
>
> Spits out a wrong parameter error.  I've tried quotes around the variable,
> the parameter, and any combinations, but it still pukes on me.  Why can't
I
> specify a precision?

According to the manual, the second parameter is only available in PHP4--is
that what you're using?

--
CC

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] problems with round ..

2001-06-26 Thread Chad Day

I'm trying a simple round in php4 and having problems .. rounding to 2
decimal places..

$BLAH = round($BLAH, 2);

Spits out a wrong parameter error.  I've tried quotes around the variable,
the parameter, and any combinations, but it still pukes on me.  Why can't I
specify a precision?

Thanks,
Chad


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] PHP / gd problems / compiling

2001-06-20 Thread Chad Day

my configure line:

./configure' '--with-mysql' '--with-apache=../apache_1.3.12'
'--enable-track-vars' '--enable-ftp' '--with-jpeg-dir=/usr/local/bin'
'--with-gd-dir=/usr/local/bin'

gd version 1.8.1 ..

Then whenever I try to create an image of any kind, be it gif, jpg, or png,
I get:


Warning:  ImageTtfText: No TTF support in this PHP build in
/data/www/apache/htdocs/airforce/quote/image.php on line 7

Warning:  ImageGif: No GIF support in this PHP build in
/data/www/apache/htdocs/airforce/quote/image.php on line 8



(It would give me the same warnings for JPG .. No JPG support, no PNG
support, etc.)


What did I do wrong?  I thought I built it in correctly, that configure line
appears when I do the phpinfo() stuff ..

Thanks,
Chad


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] compile with apxs

2001-05-17 Thread Angerer, Chad


I am trying to configure php using --with-apxs .. here is my configure file

./configure --with-apxs=/usr/local/www/bin --with-mysql=/usr/local/
mysql --enable-discard-path --enable-safe-mode --enable-calendar
--with-dom-dir
=ext/domxml --enable-ftp --with-gd=shared --with-jpeg-dir=/usr
--with-java=/usr
/java/jre --with-pdflib=shared --with-sablot=ext/sablot
--with-expat-dir=/usr -
-with-regex=system --with-swf

when it gets to the apxs part I get this error

Configuring SAPI modules
checking for AOLserver support... no
checking for Apache module support via DSO through APXS...
./configure: apxs: command not found
Sorry, I was not able to successfully run APXS.  Possible reasons:
1.  Perl is not installed;
2.  Apache was not compiled with DSO support (--enable-module=so);
3.  'apxs' is not in your path.
configure: error: ;

Perl is installed.. which perl produces /usr/bin/perl

httpd -l shows mod_so.c

and apxs is pointing to the current path of my apache bin directory.  I am
not sure what else to try.

Can someone help me out please.

Thanks in advance.

Chad

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] help with header/cookies ..

2001-05-17 Thread Chad Day

Sweet, thanks!  Fixed it .. learn something new every day ..

Chad

-Original Message-
From: Johnson, Kirk [mailto:[EMAIL PROTECTED]]
Sent: Thursday, May 17, 2001 12:19 PM
To: Php-General@Lists. Php. Net
Subject: RE: [PHP] help with header/cookies ..


Add an exit(); immediately following all the header() calls. Hitting a
header() does not end execution of the script, so without the exit() the
last header() that gets called is the one that actually occurs.

Kirk

> -Original Message-
> From: Chad Day [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, May 17, 2001 9:13 AM
> To: Php-General@Lists. Php. Net
> Subject: [PHP] help with header/cookies ..
> 
> 
> I'm submitting a form to a search page that performs 
> different searches
> based on what engine was selected.  One of these searches is 
> restricted, and
> runs a function that checks for a cookie.  If the user has no 
> cookie, they
> are redirected to a login page.
> 
> I've used echo tests to make sure the function is being run 
> correctly, that
> I don't have a cookie, etc, and it all checks out.  I 
> *SHOULD* be redirected
> to a login page, but I am not.
> 
> 
>   if ($fromwhere == "ARCHIVES") {
>   check_cookie($cookiename);
>   Header("Location: gotosearch);
>   }
> 
>   switch ($fromwhere) {
>   case "SITE":
>   Header("Location: gotosearch2);
>   break;
>   case "ARCHIVES":
>   check_cookie($cookiename);
>   Header("Location: gotosearch3);
>   break;
>   }
> 
> 
> I tried putting the check_cookie statement in and outside of 
> the switch
> statement, but both places perform the cookie check, fail it, 
> but don't
> redirect me, and continue to allow me to search?  What is 
> wrong with my
> code?  Is there something I'm missing about how I'm handling my
> headers/cookies?  I have the check_cookie function working on 
> several other
> parts of the site, but for some reason I can't get this to work .. :(
> 
> Thanks,
> Chad
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: 
> [EMAIL PROTECTED]
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] help with header/cookies ..

2001-05-17 Thread Chad Day

I'm submitting a form to a search page that performs different searches
based on what engine was selected.  One of these searches is restricted, and
runs a function that checks for a cookie.  If the user has no cookie, they
are redirected to a login page.

I've used echo tests to make sure the function is being run correctly, that
I don't have a cookie, etc, and it all checks out.  I *SHOULD* be redirected
to a login page, but I am not.


if ($fromwhere == "ARCHIVES") {
check_cookie($cookiename);
Header("Location: gotosearch);
}

switch ($fromwhere) {
case "SITE":
Header("Location: gotosearch2);
break;
case "ARCHIVES":
check_cookie($cookiename);
Header("Location: gotosearch3);
break;
}


I tried putting the check_cookie statement in and outside of the switch
statement, but both places perform the cookie check, fail it, but don't
redirect me, and continue to allow me to search?  What is wrong with my
code?  Is there something I'm missing about how I'm handling my
headers/cookies?  I have the check_cookie function working on several other
parts of the site, but for some reason I can't get this to work .. :(

Thanks,
Chad


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Compiling .. or Re-Compiling.

2001-05-17 Thread Angerer, Chad

Hello,

I have a question about recompiling PHP to add some options.  I am a newbie
to linux and compiling.  Let give a background on my processes.

I compiled MySQL -- got it working.
I compiled isntalled Openssl
Configured PHP 4.0.5
Installed Apache with SSL and PHP.

Everything was up and and running.

Now I want to add gd support and a few other options to PHP.  Can I just
recompile PHP and it will continue to function as normal or would I have to
start at the beginning with openssl and recompile everything along with PHP?

Any help is appreciated.

Thanks

Chad


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Forms and PHP_SELF

2001-05-10 Thread Chad Guilette

I'm currently working on a project and I've come across a problem which I'm
sure has been discussed several times before but I still need some
assistance on it.

I have a page with a form whose action is $PHP_SELF so the form and the form
action are all in the same pagethis works fine but in the form action a
message is displayed stating success or failure of the insertion of data
into a database and the user is redirected by means of a meta
refershduring this time if the user refreshes the page the data is
resubmitted againthe user can do this repeatedly

Some people have suggested that I use headers but I cannot do this at this
point because I've already sent the header...

others have suggested I use some variable

$script_ran_count = 1 then run and after increment so a test of it would be
false...this had no effect

others have suggested javascript...

I'm really baffled...how can I have a self-submitting form page that has a
display message and a meta redirect but if the user refreshes the page stop
the resumission of data?


Regards,
Chad Guilette




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




  1   2   >