[PHP-DB] any ideas?

2003-06-30 Thread Addison Ellis
hello and thank you for your time...
any ideas why this isn't working?
thank you again. best regards, addison
?
$query = select * from stores,subcategory,category where 
stores.category = $crow-id and subcategory.category = $crow-id and
(stores.city = '$city' and stores.state = '$state') and que='checked' 
order by 'name';
$result = mysql_query($query) or die(mysql_error());
while ($row = mysql_fetch_array($result, MYSQL_ASSOC))
{
	$count++;
?

// url of site with problem: http://www.momandpopcentral.com - select 
a category(arts  crafts) and state(TN) -next page enter 
city(nashville) there is a test store in the db  that will not appear.
--
Addison Ellis
small independent publishing co.
114 B 29th Avenue North
Nashville, TN 37203
(615) 321-1791
[EMAIL PROTECTED]
[EMAIL PROTECTED]
subsidiaries of small independent publishing co.
[EMAIL PROTECTED]
[EMAIL PROTECTED]
addisonellis.com

THIS E-MAIL AND ANY FILES TRANSMITTED WITH IT ARE CONFIDENTIAL  AND 
ARE INTENDED SOLELY FOR THE INDIVIDUAL OR ENTITY TO WHOM THEY ARE 
ADDRESSED.  IF YOU ARE NOT THE INTENDED RECIPIENT, PLEASE DO NOT 
READ, COPY OR RE-TRANSMIT THIS COMMUNICATION BUT DESTROY IT 
IMMEDIATELY.  ANY UNAUTHORIZED DISSEMINATION, DISTRIBUTION OR COPYING 
OF THIS COMMUNICATION IS STRICTLY PROHIBITED.
A 

[PHP-DB] concatenate issue?

2003-06-29 Thread Addison Ellis
hello and thank you for your time...
	i have not been able to get the below to produce any 
results... i'm getting no mysql error messages... just There are no 
stores that match your search. Please try another...
 no matter what i have tried it worketh not...
thank you again. best regards, addison
// url of site with problem: http://www.momandpopcentral.com - select 
a category(arts  crafts) and state(TN) -next page enter 
city(nashville) there is a test store there that will not appear.

//top of page:
?
require(config.php);
$count = 0;

$scobj = mysql_db_query($dbname,select * from subcategory where id=$id);
$scrow = mysql_fetch_object($scobj);
$cobj =  mysql_db_query($dbname,select * from category where 
id=$scrow-category);
$crow =  mysql_fetch_object($cobj);

?

//mid-page or so: working fine.
p align=center  pfont face=Verdana size=2bfont 
color=#CC6600br
? echo $crow-name; ?
font color=#CC6600- Select-A-Business/font/font/b/font /p

//where i need results and not getting any:
?
$query = select * from stores,subcategory,category where 
stores.category = $crow-id and subcategory.category = $crow-id and
(stores.city = '$city' and stores.state = '$state') and que='checked' 
order by 'name';
$result = mysql_query($query) or die(mysql_error());
while ($row = mysql_fetch_array($result, MYSQL_ASSOC))
{
	$count++;
?
  tr
td valign=top wrap align=left width=50% font 
color=#CC6600 size=2 face=Verdanasmall
  a href=? echo $row-url; ?  target=newb
  ? echo $row-name; ?
  /b/aBR
  ? echo $row-shortdesc; ?
  /font/td
td valign=top wrap align=left width=50% font 
color=#CC6600 size=2 face=Verdanasmall
  ?
	if ($row = mysql_fetch_object($obj))
		{
?
  a href=? echo $row-url; ? target=newb
  ? echo $row-name; ?
  /b/a/font font color=#CC6600 size=2 
face=Verdanasmall
  ?
		echo $row-shortdesc;
		} else {
		echo nbsp;/font;
		}
?
  /font/td
/tr
?
	}
?
  /table
?
if ($count == 0)
	{
?
	CENTER
font face=Verdana size=2 color=#00CCFF? echo $city; ?br
/font font face=Verdana size=2 color=#FFThere are no stores
that match your search.br
Please try another.../fontBR
/CENTER
  ?
	}
?

//i have checked my db and my admin area and that all works fine... i 
can't figure it out... thanks again...
--
Addison Ellis
small independent publishing co.
114 B 29th Avenue North
Nashville, TN 37203
(615) 321-1791
[EMAIL PROTECTED]
[EMAIL PROTECTED]
subsidiaries of small independent publishing co.
[EMAIL PROTECTED]
[EMAIL PROTECTED]
addisonellis.com

THIS E-MAIL AND ANY FILES TRANSMITTED WITH IT ARE CONFIDENTIAL  AND 
ARE INTENDED SOLELY FOR THE INDIVIDUAL OR ENTITY TO WHOM THEY ARE 
ADDRESSED.  IF YOU ARE NOT THE INTENDED RECIPIENT, PLEASE DO NOT 
READ, COPY OR RE-TRANSMIT THIS COMMUNICATION BUT DESTROY IT 
IMMEDIATELY.  ANY UNAUTHORIZED DISSEMINATION, DISTRIBUTION OR COPYING 
OF THIS COMMUNICATION IS STRICTLY PROHIBITED.
A 

Re: [PHP-DB] Confirmation e-mail

2003-02-09 Thread Addison Ellis
this is what i use. hope it helps, addison

/* send email to new member */
$emess1=Thank you...\n;
$emess2=Your Member ID and password are:\n;
$emess3=\n\n\tID:$email\n\tPassword:$password\n\n;
$emess4=Each time you submit an ad, please use your existing
ID and password.\n\n;
$emess5=Please e-mail ?@?.com with questions or comments.;
$emess =
   $emess1.$emess2.$emess3.$emess4.$emess5;
$ehead=From: ?@?.com\r\n;
$subject = this appears in the subject of the email to the
new member;
$mailsend=mail($email,$subject,$emess,$ehead);
header(Location: index.php (where you want them directed
after they sign in. it could be a welcome page.);


Hello people.,

I am developing a website with a user login system, i would like to
send an confirmation e-mail to the user when he/she registers for
the site, asking for confirmation...for instance click on a link to
activate thier account.
My question is what would be the best approach to achieve this? How
is this usualy done? Any thoughts and help is appreciated.

Best regards,

Davy Obdam

--

Davy Obdam - Obdam webdesign©
mailto:[EMAIL PROTECTED]   web: www.davyobdam.com





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


--
Addison Ellis
small independent publishing co.
114 B 29th Avenue North
Nashville, TN 37203
(615) 321-1791
[EMAIL PROTECTED]
[EMAIL PROTECTED]
subsidiaries of small independent publishing co.
[EMAIL PROTECTED]
[EMAIL PROTECTED]

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




[PHP-DB] validate list menu selection

2003-02-09 Thread Addison Ellis
hello,
	what do i need to do to make sure someone has made a 
selection from a list menu. my foreach($HTTP_POST_VARS as $value)
{
  if ($value == )
  {
unset($do);
$message_new = font face=verdana size=1 
color=redRequired information missing.\n
Please try again./font;
include(place_ad.php);
exit();
  }
}

is checking everything but my list menu. thank you and i have 
searched, to no avail. best, addison
--
Addison Ellis
small independent publishing co.
114 B 29th Avenue North
Nashville, TN 37203
(615) 321-1791
[EMAIL PROTECTED]
[EMAIL PROTECTED]
subsidiaries of small independent publishing co.
[EMAIL PROTECTED]
[EMAIL PROTECTED]

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



[PHP-DB] subdate

2003-02-05 Thread Addison Ellis
hello,
	thank you for your time.

	please note the time intervals that are working. what i 
want is to select only data that is two weeks old or younger. i did a 
test with one day and it worked great. i inserted the two-week/14days 
and neither of them worked. 1 month worked. i could not find anything 
on php.net that directed me to this.  thank you again, addison

this works:(*note end of syntax interval 1 day)
$obj = mysql_db_query($dbname,select a.*,s.name as 
subcategory_name,c.name as category_name from ads a,subcategory s,
category c where a.subcategory=s.id and s.category=c.id and 
a.subcategory=$id and a.que='checked' and
createdate =subdate(now(), interval 1 day));


this does not: (*note end of syntax interval 14 days)
$obj = mysql_db_query($dbname,select a.*,s.name as 
subcategory_name,c.name as category_name from ads a,subcategory s,
category c where a.subcategory=s.id and s.category=c.id and 
a.subcategory=$id and a.que='checked' and
createdate =subdate(now(), interval 14 days));


this does not: (*note end of syntax interval 2 weeks)
$obj = mysql_db_query($dbname,select a.*,s.name as 
subcategory_name,c.name as category_name from ads a,subcategory s,
category c where a.subcategory=s.id and s.category=c.id and 
a.subcategory=$id and a.que='checked' and
createdate =subdate(now(), interval 2 weeks));


this works: (*note end of syntax interval 1 month)
$obj = mysql_db_query($dbname,select a.*,s.name as 
subcategory_name,c.name as category_name from ads a,subcategory s,
category c where a.subcategory=s.id and s.category=c.id and 
a.subcategory=$id and a.que='checked' and
createdate =subdate(now(), interval 1 month));
--
Addison Ellis
small independent publishing co.
114 B 29th Avenue North
Nashville, TN 37203
(615) 321-1791
[EMAIL PROTECTED]
[EMAIL PROTECTED]
subsidiaries of small independent publishing co.
[EMAIL PROTECTED]
[EMAIL PROTECTED]

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



[PHP-DB] date: reverse order

2003-02-04 Thread Addison Ellis
hello,
	when retrieving data from the db and displaying it on the 
page by creation date how can i reverse the order so that the most 
recent entry appears first? here's what i have now:

?
require(config.php);

$obj = mysql_db_query($dbname,select * from ads order by createdate);
?


thank you addison
--
Addison Ellis
small independent publishing co.
114 B 29th Avenue North
Nashville, TN 37203
(615) 321-1791
[EMAIL PROTECTED]
[EMAIL PROTECTED]
subsidiaries of small independent publishing co.
[EMAIL PROTECTED]
[EMAIL PROTECTED]

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



RE: [PHP-DB] date: reverse order

2003-02-04 Thread Addison Ellis
thank you... this worked. best, addison


Simple MySQL.

After your ORDER BY clause use either ASC (I think this is the default) or
DESC. I'm pretty sure this'll work on date fields to produce the results you
want.

Your query will end up looking like:
...order by createdate DESC


 -Original Message-
 From: Addison Ellis [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, February 04, 2003 5:28 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP-DB] date: reverse order


 hello,
	when retrieving data from the db and displaying it on the
 page by creation date how can i reverse the order so that the most
 recent entry appears first? here's what i have now:

 ?
 require(config.php);

  $obj = mysql_db_query($dbname,select * from ads
 order by createdate);
 ?


 thank you addison
 --
 Addison Ellis
 small independent publishing co.
 114 B 29th Avenue North
 Nashville, TN 37203
 (615) 321-1791
 [EMAIL PROTECTED]
 [EMAIL PROTECTED]
 subsidiaries of small independent publishing co.
 [EMAIL PROTECTED]
 [EMAIL PROTECTED]

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



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


--
Addison Ellis
small independent publishing co.
114 B 29th Avenue North
Nashville, TN 37203
(615) 321-1791
[EMAIL PROTECTED]
[EMAIL PROTECTED]
subsidiaries of small independent publishing co.
[EMAIL PROTECTED]
[EMAIL PROTECTED]

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




[PHP-DB] print_r($row);

2003-02-04 Thread Addison Ellis
hello,
	i do print_r($row); and all my data is printing properly from 
my db. however, with the below code only one row is not printing: 
{$row-property_type}
thank you for your time. addison

?
// Begin Ad Block
$count = 0;
$id = 45;
$obj = mysql_db_query($dbname,select a.*,s.name as 
subcategory_name,c.name as category_name from ads a,subcategory s,
category c where a.subcategory=s.id and s.category=c.id and 
a.subcategory=$id and a.que='checked');
if ($obj  mysql_num_rows($obj)0) {
while($row = mysql_fetch_object($obj))
{
$count++;
?
  ? echo {$row-bedrooms}Bedroom/{$row-baths}Bath 
{$row-property_type}br
  {$row-description}br
  {$row-distance} from campus.br
  Available: {$row-date_available}br
  {$row-price}br
  Contact: {$row-contact};
?
  /fontfont color=#00 size=2 face=Arial, 
Helvetica, sans-serifbr /
  br
  img src=../images/thin_line.gif width=185 height=1br
  br
  ?
 }
 }
 // End Ad Block
?

this is what is printing:

2Bedroom/2Bath great place less than 5 miles From Campus Available 
immediately $500.00/month
Contact: 321-1791
--
Addison Ellis
small independent publishing co.
114 B 29th Avenue North
Nashville, TN 37203
(615) 321-1791
[EMAIL PROTECTED]
[EMAIL PROTECTED]
subsidiaries of small independent publishing co.
[EMAIL PROTECTED]
[EMAIL PROTECTED]

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



[PHP-DB] where limits?

2003-02-04 Thread Addison Ellis
hello,
	is there a limit to how many where statements one can 
include in a query?
	i am wondering if i can add this:
where createdate = subdate(now(),interval 1 month)

to this:
$obj = mysql_db_query($dbname,select a.*,s.name as 
subcategory_name,c.name as category_name from ads a,subcategory 
s,category c where a.subcategory=s.id and s.category=c.id and 
a.subcategory=$id and a.que='checked');

with no complications and if so, where should i insert it???

i do appreciate your time. best regards, addison
--
Addison Ellis
small independent publishing co.
114 B 29th Avenue North
Nashville, TN 37203
(615) 321-1791
[EMAIL PROTECTED]
[EMAIL PROTECTED]
subsidiaries of small independent publishing co.
[EMAIL PROTECTED]
[EMAIL PROTECTED]

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



[PHP-DB] font options

2003-02-02 Thread Addison Ellis
hello,
	what is the proper way to get a block of echoes to echo with 
the same font, size, color, etc... as in:

  ? echo $row-property_type; ?
  ? echo $row-bedrooms; ?
  ? echo $row-baths; ?
  ? echo $row-description; ?
  ? echo $row-distance; ?
  ? echo $row-date_available; ?
  ? echo $row-price; ?
  ? echo $row-contact; ?

thank you and best regards, addison
--
Addison Ellis
small independent publishing co.
114 B 29th Avenue North
Nashville, TN 37203
(615) 321-1791
[EMAIL PROTECTED]
[EMAIL PROTECTED]
subsidiaries of small independent publishing co.
[EMAIL PROTECTED]
[EMAIL PROTECTED]

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



[PHP-DB] list menu

2003-02-02 Thread Addison Ellis
hi and thank you for your time...
	how do i, as my text fields are echoing a selected value, get 
my list menus to do the same?

text field has: ? echo $arow-contact; ?
list menu has:
select name=property
  option value=? echo $row-property_type; ?  selected
  ? echo $row-property_type; ?
  /option
  option value=househouse/option
  option value=condocondo/option
  option value=duplexduplex/option
  option value=apartmentapartment/option
  option value=landland/option
/select

thank you again, addison ellis
--
Addison Ellis
small independent publishing co.
114 B 29th Avenue North
Nashville, TN 37203
(615) 321-1791
[EMAIL PROTECTED]
[EMAIL PROTECTED]
subsidiaries of small independent publishing co.
[EMAIL PROTECTED]
[EMAIL PROTECTED]

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



[PHP-DB] print

2003-02-02 Thread Addison Ellis
hello,
	i have a form someone fills out, say with the field # of 
bedrooms. they submit. data goes into db. how can i get the # of 
bedrooms to print 4 Bedrooms instead of just 4?
thank you, addison
--
Addison Ellis
small independent publishing co.
114 B 29th Avenue North
Nashville, TN 37203
(615) 321-1791
[EMAIL PROTECTED]
[EMAIL PROTECTED]
subsidiaries of small independent publishing co.
[EMAIL PROTECTED]
[EMAIL PROTECTED]

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



[PHP-DB] print resolved- thank you

2003-02-02 Thread Addison Ellis
hello,
	i have a form someone fills out, say with the field # of 
bedrooms. they submit. data goes into db. how can i get the # of 
bedrooms to print 4 Bedrooms instead of just 4?
thank you, addison
--
Addison Ellis
small independent publishing co.
114 B 29th Avenue North
Nashville, TN 37203
(615) 321-1791
[EMAIL PROTECTED]
[EMAIL PROTECTED]
subsidiaries of small independent publishing co.
[EMAIL PROTECTED]
[EMAIL PROTECTED]

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



[PHP-DB] print

2003-02-02 Thread Addison Ellis
hi,
 	i still am having a problem.
	can you see what is wrong with what i've got. and... thank 
you. best regards, addison ellis

this is what is printing:
2Bedroom/2Bath great From Campus Available imm 500.00 Contact: 321-1791

it is not printing the property_type and it is not following my \n commands.
here's the code:
 ?
// Begin Ad Block
$count = 0;
$id = 50;
$obj = mysql_db_query($dbname,select a.*,s.name as 
subcategory_name,c.name as category_name from ads a,subcategory 
s,category c where a.subcategory=s.id and s.category=c.id and 
a.subcategory=$id and a.que='checked');
if ($obj  mysql_num_rows($obj)0) {
while($row = mysql_fetch_object($obj))
{
$count++;
?
  ? echo 
{$row-bedrooms}Bedroom/{$row-baths}Bath{$row-property_type}\n
  {$row-description}\n
  {$row-distance} From Campus
  Available {$row-date_available}\n
  {$row-price}\n
  Contact: {$row-contact};
?
  /fontfont color=#00 size=2 face=Arial, 
Helvetica, sans-serifbr /
br
  img src=../images/thin_line.gif width=185 height=1br
  br
  ?
 }
 }
 // End Ad Block
?

thanks again...
--
Addison Ellis
small independent publishing co.
114 B 29th Avenue North
Nashville, TN 37203
(615) 321-1791
[EMAIL PROTECTED]
[EMAIL PROTECTED]
subsidiaries of small independent publishing co.
[EMAIL PROTECTED]
[EMAIL PROTECTED]

[PHP-DB] select

2003-02-02 Thread Addison Ellis
hi and thank you,
	is there a reason this will not work? i am trying to echo an 
option that has already been selected in a list menu. best, addison



 select name=property
  ?
 $obj = mysql_db_query($dbname,select * from ads where id=$id;);
 while($row = mysql_fetch_object($obj))
  {
 if ($row-property_type == $row-id)
  {
			$selected = SELECTED;
			} else {
			$selected = ;
			}
?
  option value=? echo $row-id; ? ? echo $selected; ? selected
  ? echo $row-property_type; ?
  /option
  option value=househouse/option
  option value=condocondo/option
  option value=duplexduplex/option
  option value=apartmentapartment/option
  option value=landland/option
/select
--
Addison Ellis
small independent publishing co.
114 B 29th Avenue North
Nashville, TN 37203
(615) 321-1791
[EMAIL PROTECTED]
[EMAIL PROTECTED]
subsidiaries of small independent publishing co.
[EMAIL PROTECTED]
[EMAIL PROTECTED]

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



[PHP-DB] form field rejection

2003-02-02 Thread Addison Ellis
hello,
	thank you for your time...
	what is the best way for me to have a form field, phone 
reject certain phone prefixes?
for example: someone enters 321-1791 and 321 prefix can not be 
allowed as an entry...
	thank you again, addison
--
Addison Ellis
small independent publishing co.
114 B 29th Avenue North
Nashville, TN 37203
(615) 321-1791
[EMAIL PROTECTED]
[EMAIL PROTECTED]
subsidiaries of small independent publishing co.
[EMAIL PROTECTED]
[EMAIL PROTECTED]

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



[PHP-DB] MySQL result resource

2003-01-29 Thread Addison Ellis
hello,
	i have a new issue... :-)
	i am getting:
Warning: Supplied argument is not a valid MySQL result resource in 
/users/infoserv/web/register/ca/admin/catads.php on line 54

from:
?
while($row = mysql_fetch_object($obj))
{
  $scobj = mysql_db_query($dbname,select * from subcategory 
where id=$row-subcategory);
  $scrow = mysql_fetch_object($scobj);
  $cobj = mysql_db_query($dbname,select * from category where 
id=$scrow-category);//54
  $crow = mysql_fetch_object($cobj);
?


any ideas, of course, are most appreciated. thank you and best, addison
--
Addison Ellis
small independent publishing co.
114 B 29th Avenue North
Nashville, TN 37203
(615) 321-1791
[EMAIL PROTECTED]
[EMAIL PROTECTED]
subsidiaries of small independent publishing co.
[EMAIL PROTECTED]
[EMAIL PROTECTED]

[PHP-DB] really stumped!

2003-01-28 Thread Addison Ellis
hello and thank you for taking a look at this.
	i, no matter what id do can not get variables to echo a value 
or inserted into my db. i uploaded the original file and parse error 
line by parse error line had to remove all brackets, which doesn't 
make sense to me right now, except for the two encompassing header:.
	one of many forms submitted to this will actually process and 
post now with no errors but will not, as i mentioned, print any of my 
echo. here is the thing in it's entirety and i very much appreciate 
your time and efforts. best regards, addison ellis

?
  session_start();  
  if (@$auth != yes)  
  {
 header(Location: login.php);
 exit();
  }
  include(config.php);
  $sql = SELECT first_name,last_name FROM accounts
 WHERE email='$logname';
  $result = mysql_query($sql)
   or die(Couldn't execute query 1.);
  $row = mysql_fetch_array($result,MYSQL_ASSOC);
  extract($row);

echo 
headtitleCreate an Ad/title/head
h3 align='center' style='margin-top: .05in'
$first_name $last_name/h3;

echo  id=$id, HTTP_POST_VARS=$HTTP_POST_VARS, key=$key, 
value=$value, category=$category, subcategory=$subcategory, 
logname=$lognamebr;

foreach ($HTTP_POST_VARS as $key = $value)

 $key = stripslashes($key);

 /* is there a better way to do this? the below if ($key !=...) are 
all fields from all the various forms that submit to this page that 
are not required to be filled in. so if ($value == ) checks all the 
other fields, which are the required fields. there are almost as many 
required as not, so i opted to go with if ($key !=...)*/
  
   if ($key != destination and $key != depart_city and $key 
!= quantity and $key != depart_time and $key != depart_date and 
$key != arrival_time and $key != return_date and $key != 
return_depart and $key != return_arrive and $key != price and 
$key != other and $key != contact and $key != condition and 
$key != color and $key != date_available and $key != distance 
and $key != pets and $key != deposit and $key != lease and $key 
!= mileage and $key != dates_available)


   if ( $value ==  )


echo font face=verdana size=1 color=redRequired information is 
missing.\n Please click your browser's back button, try 
again./fontbr\n;
exit();


if (ereg(^[A-Za-z' -]{1,50}$,$key))


echo font face=verdana size=1 color=redSome information is not 
processing.\n Please click your browser's back button, check you 
entries and try again./fontbr\n;
exit();

  $$key = strip_tags(trim($value));

/*this next section checks the contact field to see if it is an 
irregular phone or email address. i would prefer to have two seperate 
fields(phone,email) to be checked individually but only one or the 
other is required and i don't know how to have it check; if one field 
is filled in and if it contains no irregularities, it is ok if the 
other field is not filled in. then, on to else.*/

  if (ereg(^[0-9)(xX -]{7,20}$,$contact))


echo font face=verdana size=1 color=redIt appears your Contact 
Phone Number may be entered incorrectly.\n Please click your 
browser's back button, check your entry and try again./fontbr\n;
exit();

if (!ereg(^.+@.+\\..+$,$contact))

{
echo font face=verdana size=1 color=redIt appears your eMail 
Address may be entered incorrectly.\n Please click your browser's 
back button, check your entry and try again./fontbr\n;
exit();
}
else   
 
foreach($HTTP_POST_VARS as $column_name = $column_value)

$column_names .= $column_name . ',';
$column_values .= '$column_values',;

$today = date(-mm-dd);
$query = insert into ads values ($column_names,createdate)
  values ($column_values,'$today');
$result = mysql_db_query($dbname,$query)
   or die (mysql_error());

/* send email to account holder */   
 
$emess1=\n\n\tUsername:$email\n\n;
$emess2=A new Vanderbilt Register Classified Ad has been 
setup for you.;
$emess3=We appreciate your Placing an ad with us.\n\n;
$emess4=If you have any questions or problems, email ;
$emess5=[EMAIL PROTECTED];
$emess =
   $emess1.$emess2.$emess3.$emess4.$emess5;
$ehead=From: [EMAIL PROTECTED]\r\n;
$subject = Your Vanderbilt Register Classified Ad;

$mailsend=mail($email,$subject,$emess,$ehead);
 

$body = A new ad has been added to the que.
You may add the store to the site by going to
http://www.vanderbilt.edu/ca/admin/index.php
;
	mail([EMAIL PROTECTED], New Ad, $body);
 ?













--
Addison Ellis
small independent publishing co.
114 B 29th Avenue North
Nashville

[PHP-DB] need INSERT help

2003-01-27 Thread Addison Ellis
hello,
	can someone help me with this? i have tried all i know and i 
am very new at this... my apologies.
	i am trying to have multiple forms, all with different 
fields/values, point to one .php that will foreach($HTTP_POST_VARS as 
$key = $VALUE)
1) check for if ($value == )
2) ereg function
3) $$key = strip_tags(trim($value));
4) $today = date(-m-d);
5) $sql = INSERT INTO tablename ($HTTP_POST_VARS)
VALUES ('$$HTTP_POST_VARS values');
mysql_query($sql);

the problem i am having is i have so many different form 
fields/values. i am almost resigning to having one .php for each form 
but i know there is a better way. and... anyway... thanks for looking 
at this. best regards, addison
--
Addison Ellis
small independent publishing co.
114 B 29th Avenue North
Nashville, TN 37203
(615) 321-1791
[EMAIL PROTECTED]
[EMAIL PROTECTED]
subsidiaries of small independent publishing co.
[EMAIL PROTECTED]
[EMAIL PROTECTED]

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



[PHP-DB] REVISED; need INSERT help

2003-01-27 Thread Addison Ellis
hello again and i am sorry i was not more specififc in my last post.
	here is where i am confused:
 else   
  {
$today = date(Y-m-d h:m:s);
$sql = INSERT INTO ads () VALUES
('$first_name','$last_name','$email','$phone','$univ_status',
 '$password','$today');
mysql_query($sql);
$auth=yes; 
$logname = $email;


for the actual insert, what do i put in order to avoid having to do a 
separate .php for each form and list the fields/values from each 
form? thanks and sorry again. addison


previous post:


hello,
	can someone help me with this? i have tried all i know and i 
am very new at this... my apologies.
	i am trying to have multiple forms, all with different 
fields/values, point to one .php that will foreach($HTTP_POST_VARS as 
$key = $VALUE)
1) check for if ($value == )
2) ereg function
3) $$key = strip_tags(trim($value));
4) $today = date(-m-d);
5) $sql = INSERT INTO tablename ($HTTP_POST_VARS)
VALUES ('$$HTTP_POST_VARS values');
mysql_query($sql);

the problem i am having is i have so many different form 
fields/values. i am almost resigning to having one .php for each form 
but i know there is a better way. and... anyway... thanks for looking 
at this. best regards, addison
--
Addison Ellis
small independent publishing co.
114 B 29th Avenue North
Nashville, TN 37203
(615) 321-1791
[EMAIL PROTECTED]
[EMAIL PROTECTED]
subsidiaries of small independent publishing co.
[EMAIL PROTECTED]
[EMAIL PROTECTED]

[PHP-DB] too many connections?

2003-01-27 Thread Addison Ellis
hello and thank you.
	any idea what this means? i have not touched or changed my 
config.php file since i put it up the first time... it contains my db 
connect info. also, i just downloaded it from the server to see if it 
had been modified and it had not. thanks again and best, addison

Warning: Too many connections in 
/users/infoserv/web/register/ca/admin/config.php on line 5

Warning: MySQL Connection Failed: Too many connections in 
/users/infoserv/web/register/ca/admin/config.php on line 5
--
Addison Ellis
small independent publishing co.
114 B 29th Avenue North
Nashville, TN 37203
(615) 321-1791
[EMAIL PROTECTED]
[EMAIL PROTECTED]
subsidiaries of small independent publishing co.
[EMAIL PROTECTED]
[EMAIL PROTECTED]

[PHP-DB] resolved : Re: [PHP-DB] too many connections?

2003-01-27 Thread Addison Ellis
i searched at mysql.com and it said basically what you are asking. i 
contacted the server admin and they are going to re-set the server. 
thank you for your time. best regards, addison


Assuming that line 5 is the dbconnect, is there a limit on the number of
connections that your MySQL server allows? Is there a limit set in
php.ini?


Shannon Johnston

On Mon, 2003-01-27 at 15:13, Addison Ellis wrote:

 hello and thank you.
	any idea what this means? i have not touched or changed my
 config.php file since i put it up the first time... it contains my db
 connect info. also, i just downloaded it from the server to see if it
 had been modified and it had not. thanks again and best, addison

 Warning: Too many connections in
 /users/infoserv/web/register/ca/admin/config.php on line 5

 Warning: MySQL Connection Failed: Too many connections in
 /users/infoserv/web/register/ca/admin/config.php on line 5

--
Shannon Johnston [EMAIL PROTECTED]


--
Addison Ellis
small independent publishing co.
114 B 29th Avenue North
Nashville, TN 37203
(615) 321-1791
[EMAIL PROTECTED]
[EMAIL PROTECTED]
subsidiaries of small independent publishing co.
[EMAIL PROTECTED]
[EMAIL PROTECTED]

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




[PHP-DB] elseif

2003-01-27 Thread Addison Ellis
hello and thank you for your time.
	will the below work to check if one field or the other is 
filled in upon submission? either contact_phone or contact_email is 
required but not both. best, addison

$error = ;
if ($name == )
	{
	$error = $errorLIYou must enter a company name./LI;
	}
if ($address == )
{
$error = $errorLIYou must enter an address./LI;
}
if ($city == )
{
$error = $errorLIYou must enter a city./LI;
}
if ($state == )
{
$error = $errorLIYou must enter a state./LI;
}
if ($zip == )
{
$error = $errorLIYou must enter a zip./LI;
}
if ($contact_phone == )
{
$error = $errorLIYou must enter a contact phone number or 
email address./LI;
}
elseif ($contact_email == )
{
$error = $errorLIYou must enter a contact phone number or 
email address./LI;
}
if ($error == )
	{
	$query = insert into stores  set
--
Addison Ellis
small independent publishing co.
114 B 29th Avenue North
Nashville, TN 37203
(615) 321-1791
[EMAIL PROTECTED]
[EMAIL PROTECTED]
subsidiaries of small independent publishing co.
[EMAIL PROTECTED]
[EMAIL PROTECTED]

[PHP-DB] if ($key !=

2003-01-27 Thread Addison Ellis
hello and presumably, thank you again...
	i have quite a few fields from different forms that are not 
required and almost as many that are so i have opted to go with
if ($key != middle_name) format.
	in using this can i separate the different fields like so if 
($key != 'middle_name','address','etc.')
or must i do this: if ($key != middle_name and  $key != address 
and $key != etc. )
{
if ($value == )
} etc...

best, addison
--
Addison Ellis
small independent publishing co.
114 B 29th Avenue North
Nashville, TN 37203
(615) 321-1791
[EMAIL PROTECTED]
[EMAIL PROTECTED]
subsidiaries of small independent publishing co.
[EMAIL PROTECTED]
[EMAIL PROTECTED]

[PHP-DB] $HTTP_POST_VARS

2003-01-27 Thread Addison Ellis
hello,
	will this work?

$sql = INSERT INTO ads ($HTTP_POST_VARS,createdate)
VALUES ('$key','$today');
mysql_query($sql);

i have this at the top:

foreach ($HTTP_POST_VARS as $key = $value)

thanks again, addison ellis
--
Addison Ellis
small independent publishing co.
114 B 29th Avenue North
Nashville, TN 37203
(615) 321-1791
[EMAIL PROTECTED]
[EMAIL PROTECTED]
subsidiaries of small independent publishing co.
[EMAIL PROTECTED]
[EMAIL PROTECTED]


Re: [PHP-DB] empty query

2003-01-26 Thread Addison Ellis
thank you so much for responding...
i added this: {
echo $key, $valuebr;
}
underneath function storeForm($formdata,$ads) and it is now displaying this:
year, 1971
make, chevy
model, impala
color, green
mileage,
condition, none
price,
other, Ad may not exceed 25 words.
contact, [EMAIL PROTECTED]
next_, Submit Your Ad

which is what i entered into the form except it is not passing the 
category, subcategory info that was selected from the two previous 
pages. and, in the table the data goes into needs to have a category 
and subcategory id. also, i don't know why i am getting the 
next_,Submit Your Ad values passed. again, i really appreciate your 
time. best regards, addison ellis


On Sunday 26 January 2003 14:31, Addison Ellis wrote:

 hello,
	i have unsuccessfully tried for three days to write, re-write
 something that will insert data into my db and ashamedly have failed
 again. at one point i was able to echo values and see that they were
 in fact passing from my form. now i can't even get that. anyway, if
 you could take a look at this and tell me where i'm going wrong i
 will greatly appreciate it. thank you... addison

 ?
session_start();
if (@$auth != yes)
include(config.php);

 function storeForm($formdata,$ads)


Are you saying that now $formdata is empty?? If it is, where are you getting
$formdata from?

[snip]


$result = mysql_query($query)
 or die (Couldn't execute query.);


Don't use die(), use:

  $result = mysql_query($query)
or echo Couldn't execute query.  . mysql_error();


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


/*
Now here's something you're really going to like!
-- Rocket J. Squirrel
*/


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


--
Addison Ellis
small independent publishing co.
114 B 29th Avenue North
Nashville, TN 37203
(615) 321-1791
[EMAIL PROTECTED]
[EMAIL PROTECTED]
subsidiaries of small independent publishing co.
[EMAIL PROTECTED]
[EMAIL PROTECTED]


Re: [PHP-DB] empty query

2003-01-26 Thread Addison Ellis
first, i must apologize as i am very new at this... and... i really 
appreciate your help. addison

On Sunday 26 January 2003 16:14, Addison Ellis wrote:

Please do not top-post.


Sorry here...




 i added this: {
 echo $key, $valuebr;
 }
 underneath function storeForm($formdata,$ads) and it is now displaying
 this: year, 1971
 make, chevy
 model, impala
 color, green
 mileage,
 condition, none
 price,
 other, Ad may not exceed 25 words.
 contact, [EMAIL PROTECTED]
 next_, Submit Your Ad


But this contradicts your initial assertion that you wasn't able to echo any
values from $formdata?


correct... i am able to echo values again.




 which is what i entered into the form except it is not passing the
 category, subcategory info that was selected from the two previous
 pages.


From _TWO_ previous pages? How are you carrying forward the values category 
subcategory? If you're not carrying them forward then it shouldn't come as a
great surprise that they're not available in the latter pages. You need to
pass those values along either using hidden field elements in your form or by
placing them into session variables.


i had the following to carry forward cat and subcat values:
?
  session_start();  
  if (@$auth != yes)
  {
 header(Location: login.php);
 exit();
  }
  include(config.php);
  $scobj = mysql_db_query($dbname,select * from subcategory where 
id=$subcategory)
or die (mysql_error());
  $scrow = mysql_fetch_object($scobj);
  $cobj =  mysql_db_query($dbname,select * from category where 
id=$scrow-category)
   or die (mysql_error());
  $crow =  mysql_fetch_object($cobj);
  $sql = SELECT first_name,last_name FROM accounts
 WHERE email='$logname';
  $result = mysql_query($sql)
   or die (mysql_error());
  while ($row = mysql_fetch_array($result,MYSQL_ASSOC))
  extract($row);



 and, in the table the data goes into needs to have a category
 and subcategory id.




 also, i don't know why i am getting the
 next_,Submit Your Ad values passed.


I would hazard a guess and say that next_ is the name of a button and
Submit Your Ad is it's value? As it is part of the form and you're
programmatically (or indiscriminately) extracting everything from $_POST (or
equivalent) then that is why you end up with it.


how am i to get rid of it.



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


/*
You have an ability to sense and know higher truth.
*/


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


--
Addison Ellis
small independent publishing co.
114 B 29th Avenue North
Nashville, TN 37203
(615) 321-1791
[EMAIL PROTECTED]
[EMAIL PROTECTED]
subsidiaries of small independent publishing co.
[EMAIL PROTECTED]
[EMAIL PROTECTED]


Re: [PHP-DB] empty query

2003-01-26 Thread Addison Ellis
whew! is there a tutorial you know of that might help me? in essence 
i have page 1 select category, page two select subcategory, page 
3 fill out the form, click submit, data is entered into database, 
user is directed to a new page. i thought from this php 4.1 book that 
i was doing that. :-) i guess not. anyway... thank you very much, 
again. addison
On Sunday 26 January 2003 18:59, Addison Ellis wrote:


 correct... i am able to echo values again.


Hmm, okay :-)


 i had the following to carry forward cat and subcat values:
 ?
session_start();
if (@$auth != yes)
{
   header(Location: login.php);
   exit();
}
include(config.php);
$scobj = mysql_db_query($dbname,select * from subcategory where
 id=$subcategory)
  or die (mysql_error());
$scrow = mysql_fetch_object($scobj);
$cobj =  mysql_db_query($dbname,select * from category where
 id=$scrow-category)
 or die (mysql_error());
$crow =  mysql_fetch_object($cobj);
$sql = SELECT first_name,last_name FROM accounts
   WHERE email='$logname';
$result = mysql_query($sql)
 or die (mysql_error());
while ($row = mysql_fetch_array($result,MYSQL_ASSOC))
extract($row);


I don't see anything in that code which would carry the category and
subcategory forward, UNLESS $scrow and $crow are registered as session
variables.


again, from this new php 4.1 book, i am following the examples and 
guidelines. i guess that since register_globals is turned on on the 
server they are passing.?



 I would hazard a guess and say that next_ is the name of a button and
 Submit Your Ad is it's value? As it is part of the form and you're
 programmatically (or indiscriminately) extracting everything from $_POST
  (or equivalent) then that is why you end up with it.

 how am i to get rid of it.


Don't put it into $formdata! Remember you're the one who is putting it in
there!


i guess i am not sure how to keep it out of $formdata. again, the 
book... addison


Presumably at some point you have some code which will insert the contents of
$formdata into your database. If that code is properly written then the
presence (or otherwise) of next_ should not affect its operation.


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


/*
Once upon a time, four AMPHIBIOUS HOG CALLERS attacked a family of
DEFENSELESS, SENSITIVE COIN COLLECTORS and brought DOWN their PROPERTY
VALUES!!
*/


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


--
Addison Ellis
small independent publishing co.
114 B 29th Avenue North
Nashville, TN 37203
(615) 321-1791
[EMAIL PROTECTED]
[EMAIL PROTECTED]
subsidiaries of small independent publishing co.
[EMAIL PROTECTED]
[EMAIL PROTECTED]

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




[PHP-DB] empty query

2003-01-25 Thread Addison Ellis
hello,
	i have unsuccessfully tried for three days to write, re-write 
something that will insert data into my db and ashamedly have failed 
again. at one point i was able to echo values and see that they were 
in fact passing from my form. now i can't even get that. anyway, if 
you could take a look at this and tell me where i'm going wrong i 
will greatly appreciate it. thank you... addison

?
  session_start();  
  if (@$auth != yes)  
  include(config.php);

function storeForm($formdata,$ads)
{
  $query = INSERT INTO $ads (;
  $query2 =  VALUES (;
  $counter = 0;
  foreach ($formdata as $key = $value) 
  {
$formdata[$key] = trim($formdata[$key]);
$formdata[$key] = strip_tags($formdata[$key]);
$counter++;
if ($counter == sizeof($formdata) ) //if this is last field
{
  $query = $query.$key;
  $query2 = $query2.'.$value.';
}
else   //if this is not the last field
{
  $query = $query.$key.,;
  $query2 = $query2.'.$value.'.,;
}
  }
  $query = $query.);
  $query2 = $query2.);
  $query=$query.$query2;
  $result = mysql_query($query)
   or die (Couldn't execute query.);
}
?
--
Addison Ellis
small independent publishing co.
114 B 29th Avenue North
Nashville, TN 37203
(615) 321-1791
[EMAIL PROTECTED]
[EMAIL PROTECTED]
subsidiaries of small independent publishing co.
[EMAIL PROTECTED]
[EMAIL PROTECTED]

Re: [PHP-DB] need help spotting this php parse error

2003-01-23 Thread Addison Ellis
you might try pulling the semi colon out before while. i put it in 
red. i think,that's probably it. addison


When i run this script it tells me that I have a parse error on line 
34? I really can't see it anyhelp (please!) would be much 
appreciated Cheers, Dave

?

	session_start();

	if(!$HTTP_COOKIE_VARS[username]) {

		/* The Cookie is not set, so load the page as if it 
is the first time
		*/

		include(library/include/header.php);
		include(library/include/database.php);

		/* Include a header file and a database 
connections/functions file
		*/

		?

		form name=login method=post action=
 			select name=select

 			?

 			$query = SELECT * FROM Staff WHERE ResterauntId = 1;
 			$result = mysql_query($query) or die( mysql_error () );

 			While( $row = mysql_fetch_array($result) ) {

 ?
			option value=? echo $row[0]; ?? echo 
$row[1]; echo $row[2]; ?/option
			?
		}
		?
  		/select
		/form

_
Stay in touch with MSN Messenger http://messenger.msn.co.uk


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

--
Addison Ellis
small independent publishing co.
114 B 29th Avenue North
Nashville, TN 37203
(615) 321-1791
[EMAIL PROTECTED]
[EMAIL PROTECTED]
subsidiaries of small independent publishing co.
[EMAIL PROTECTED]
[EMAIL PROTECTED]


[PHP-DB] revised: foreach($HTTP_POST_VARS...

2003-01-22 Thread Addison Ellis
hello,
i am trying to point all my forms to this .php file to check for 
errors, and if they are ok, insert the submitted form values into a 
table in a database.
if i use this:
?
require(config.php);

$error = ;
if ($name == )
	{
	$error = $errorLIYou must enter a company name./LI;
	}
if ($address == )
{
$error = $errorLIYou must enter an address./LI;
}

etc.   and the form, say yardsale.php, doesn't have the field 
name in it, will it skip over that field or will it return an 
error saying name is blank?or
can you tell me where to go from beyond the attached email below?
	below the code following i don't know where to go. do i need 
to list each value individually or can i do something with 
$HTTP_POST_VARS  or am i even headed in the right direction?
foreach($HTTP_POST_VARS as $key = $value)   
  {
if ($key != )
{
  if ($value == )
  {
$message_new = font face=verdana size=1 
color=redRequired information missing.\n
Please try again./font;
  }
} 
if (ereg($key))   
{
 if (!ereg(^[A-Za-z' -]{1,50}$,$key))
 {
   $message_new = font face=verdana size=1 color=redSome 
information not processing.\n
Please try again./font;
 } 
}
$$key = strip_tags(trim($value));  
  }
  if (!ereg(^[0-9)(xX -]{7,20}$,$contact_phone)) 
  {
$message_new = font face=verdana size=1 color=redNot a 
valid phone number.\n
Please try 
again./font; 
  }
  if (!ereg(^.+@.+\\..+$,$contact_email)) 
  {
$message_new = font face=verdana size=1 color=redNot a 
valid email address.\n
 Please try again./font;
}
  else
if ($message == )
	{
	$query = insert into ad_columns  set


(from here can i write something like $query = 
foreach($HTTP_POST_VARS as $key = $value) insert into ad_columns 
set???
thank you. addison ellis
--
Addison Ellis
small independent publishing co.
114 B 29th Avenue North
Nashville, TN 37203
(615) 321-1791
[EMAIL PROTECTED]
[EMAIL PROTECTED]
subsidiaries of small independent publishing co.
[EMAIL PROTECTED]
[EMAIL PROTECTED]


[PHP-DB] add.php

2003-01-22 Thread Addison Ellis
hello,
	i was hoping someone could help me further this?
	i have multiple form possibilities someone can fill out. each 
form, on submit would point to say, add.php. it would check for blank 
fields. if there are no blank fields it would insert the current 
values into the database accordingly. the issue i am facing is each 
form has different fields, for instance: form 1 has name, email and 
question. form 2 has name, email, ticket_type, price, how many. form 
3 has name, email, vehicle, color, year. and on and on.
	i appreciate your taking time to read this and any input you 
may have is also appreciated.
if i use this:
?
require(config.php);

$error = ;
if ($name == )
	{
	$error = $errorLIYou must enter a company name./LI;
	}
if ($address == )
{
$error = $errorLIYou must enter an address./LI;
}

etc.   and the form, say yardsale.php, doesn't have the field 
name in it, will it skip over that field or will it return an 
error saying name is blank?

this goes at the end of my ifs...
} else {

$query  = update ads set
name = '$name',
etc.





	my best regards, addison ellis
--
Addison Ellis
small independent publishing co.
114 B 29th Avenue North
Nashville, TN 37203
(615) 321-1791
[EMAIL PROTECTED]
[EMAIL PROTECTED]
subsidiaries of small independent publishing co.
[EMAIL PROTECTED]
[EMAIL PROTECTED]


Re: [PHP-DB] using Flat File

2003-01-22 Thread Addison Ellis
here is what i use. have your login_form.php post to this and call 
this login.php. hope it helps. addison

?
  session_start();
  session_register('auth');
  session_register('logname');
  include(config.php);   //this file (config.php) contains the 
database connection 
info.   
  {
case login:
  $sql = SELECT username FROM accounts 
  WHERE username='$username';
  $result = mysql_query($sql)
  or die(Couldn't execute query1.);
  $num = mysql_num_rows($result);  
  if ($num == 1)  // login name was found   
  {
 $sql = SELECT username FROM accounts  
 WHERE username='$username'
 AND password='$password';
 $result2 = mysql_query($sql)
   or die(Couldn't execute query2.);
 $num2 = mysql_num_rows($result2);
 if ($num2  0)  // password is correct
 {

$auth=yes;  
   $logname=$username;
   $today = date(Y-m-d h:m:s);   
   $sql = INSERT INTO login (username,logintime) //this is a 
login table in the db. not necessarily needed.
   VALUES ('$username','$today');
   mysql_query($sql) or die(Can't execute query login.);
   header(Location: 
where_you_want_user_to_go_if_authorized.php);
 }
 else// password is not correct
 { 
   $message=font face=verdana size=1 color=redThis account 
exists,\n  
 but you have not entered the\n 
 correct password!\n Please try again./font;
   include(login_form.php);  
 }
  }
  elseif ($num == 0)  // login name not found  
  {  
 unset($do);   
 $message = font face=verdana size=1 color=redThe eMail 
Address you entered\n 
 can't be found!\n Please try again or\n
Create a New Account./font;
 include(login_form.php); //this is the file that actually 
contains the log in text fields
  }
?   


Hi,

I have posted my question to this list before but I did not get a 
help that I was expected.

All I wanted to do is to give access for the users to view a page in 
which the below code is embedded. The user will enter his/her 
username and password.

But the code is not working.

I don't know what to think.

I need your help guys. Don't let me die on this code

?php

 $auth = false;
 if (isset( $PHP_AUTH_USER )   isset($PHP_AUTH_PW)) {


 $filename = 'c:\\php_data\\file.txt';
 $f = @fopen($filename, r);
  if ($f != FALSE)
  {$a = @fread($f, filesize($filename));
 fclose($f);
  }
  else
  {
   echo Could not open file;
  }



 $lines = explode ( \n, $file_contents );



 foreach ( $lines as $line ) {

 list( $username, $password ) = explode( ':', $line );

 if ( ( $username == $PHP_AUTH_USER ) amp;amp;
  ( $password == $PHP_AUTH_PW ) ) {




 $auth = true;
 break;

 }
 }

 }

 if ( ! $auth ) {

 header( 'WWW-Authenticate: Basic realm=Private' );
 header( 'HTTP/1.0 401 Unauthorized' );
 echo 'Authorization Required.';
 exit;

 } else {

 echo 'PYou are authorized!/P';

  }


 ?







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


--
Addison Ellis
small independent publishing co.
114 B 29th Avenue North
Nashville, TN 37203
(615) 321-1791
[EMAIL PROTECTED]
[EMAIL PROTECTED]
subsidiaries of small independent publishing co.
[EMAIL PROTECTED]
[EMAIL PROTECTED]


[PHP-DB] preview form field entries before db submission?

2003-01-21 Thread Addison Ellis
hello,
	do you know of a way to preview form field entries in a new 
page, the way they will appear in a query result, so that the user 
has a chance to edit their entries prior to their actual submission 
to the db?
	thank you and best, addison
--
Addison Ellis
small independent publishing co.
114 B 29th Avenue North
Nashville, TN 37203
(615) 321-1791
[EMAIL PROTECTED]
[EMAIL PROTECTED]
subsidiaries of small independent publishing co.
[EMAIL PROTECTED]
[EMAIL PROTECTED]

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



[PHP-DB] session_destroy(); on submit?

2003-01-21 Thread Addison Ellis
hello,
	will the following work or should i be attempting something else?

/form
input type=submit name=submit value=Submit 
onClick=?session_unset();,session_destroy();?
input type=hidden name=url  value=http://www.etc.com;
	thank you and best, addison
--
Addison Ellis
small independent publishing co.
114 B 29th Avenue North
Nashville, TN 37203
(615) 321-1791
[EMAIL PROTECTED]
[EMAIL PROTECTED]
subsidiaries of small independent publishing co.
[EMAIL PROTECTED]
[EMAIL PROTECTED]

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



[PHP-DB] datetime

2003-01-21 Thread Addison Ellis
hello and thank you... probably again.
using datetime, /or something else if applicable, is it possible to 
have entries to a page and entries to a db automatically delete? i 
have looked through many docs at php.net and mysql and can't find 
anything. perhaps i'm using the wrong search key words.? thanks 
again, addison
--
Addison Ellis
small independent publishing co.
114 B 29th Avenue North
Nashville, TN 37203
(615) 321-1791
[EMAIL PROTECTED]
[EMAIL PROTECTED]
subsidiaries of small independent publishing co.
[EMAIL PROTECTED]
[EMAIL PROTECTED]

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



[PHP-DB] foreach($HTTP_POST_VARS as $key = $value)

2003-01-21 Thread Addison Ellis
hello,
	i do appreciate your time...
	below the code following i don't know where to go. do i need 
to list each value individually or can i do something with 
$HTTP_POST_VARS  or am i even headed in the right direction? i am 
trying to point all my forms to this .php file to check for errors, 
and if they are ok, insert the submitted form values into a table in 
a database. thank you. addison ellis
foreach($HTTP_POST_VARS as $key = $value)   
  {
if ($key != )
{
  if ($value == )
  {
$message_new = font face=verdana size=1 
color=redRequired information missing.\n
Please try again./font;
  }
} 
if (ereg({name),$key))   
{
 if (!ereg(^[A-Za-z' -]{1,50}$,$key))
 {
   $message_new = font face=verdana size=1 color=redSome 
information not processing.\n
Please try again./font;
 } 
}
$$key = strip_tags(trim($value));  
  }
  if (!ereg(^[0-9)(xX -]{7,20}$,$phone)) 
  {
$message_new = font face=verdana size=1 color=redNot a 
valid phone number.\n
Please try again./font; 
  }
  if (!ereg(^.+@.+\\..+$,$email)) 
  {
$message_new = font face=verdana size=1 color=redNot a 
valid email address.\n
 Please try again./font;
}
  else
if ($message == )
	{
	$query = insert into ad_columns  set
--
Addison Ellis
small independent publishing co.
114 B 29th Avenue North
Nashville, TN 37203
(615) 321-1791
[EMAIL PROTECTED]
[EMAIL PROTECTED]
subsidiaries of small independent publishing co.
[EMAIL PROTECTED]
[EMAIL PROTECTED]

[PHP-DB] ghost parse error?

2003-01-20 Thread Addison Ellis
hello,
	if you could check this code that would be awesome. i am 
getting a parse error on line 16 but line 16 has nothing on it and my 
eyes are missing something... maybe my mind. anyway... thank you 
again. best, addison

?
  session_start();  
  if (@$auth != yes)  
  {
 header(Location: login.php);
 exit();
  }
  include(config.php);
  $sql = SELECT first_name,last_name FROM accounts
 WHERE email='$logname';
  $result = mysql_query($sql)
   or die(Couldn't execute query 1.);
  $row = mysql_fetch_array($result,MYSQL_ASSOC);
  extract($row);
?

?
$cobj =  mysql_db_query($dbname,select * from category where id=$category);
$crow =  mysql_fetch_object($cobj);
?

?
$scobj = mysql_db_query($dbname,select * from subcategory 
where id=$subcategory);
while ($scrow = mysql_fetch_object($scobj);
?


?
echo 
 headtitleDirecting/title/head
 h2 align='center' style='margin-top: .7in'
 $first_name $last_name/h2\n;
?
  p align=centerbr
  bfont color=#CC9933 size=2 face=Arial, Helvetica, sans-serif
  ? echo $crow-name;?
  font size=3gt;/font
  ? echo $scrow-name;?
  /font/b font color=#3399FF size=3 face=Arial, Helvetica, 
sans-serif
  Directing . . ./font/p
form method=post action=
/form
--
Addison Ellis
small independent publishing co.
114 B 29th Avenue North
Nashville, TN 37203
(615) 321-1791
[EMAIL PROTECTED]
[EMAIL PROTECTED]
subsidiaries of small independent publishing co.
[EMAIL PROTECTED]
[EMAIL PROTECTED]

[PHP-DB] is this possible?

2003-01-19 Thread Addison Ellis
hello,
	i have a page where the user selects a category. they are 
directed to a page that takes them to subactegory and displays the 
subcategory according to category id.
	my question is can i from there direct them to a particular 
page from a list of a number of different pages according to their 
subcategory choice? my thought was to direct them to one page that 
contains all the relations between category and subcategory and if 
subcategory=id where category=$category then include or header 
example.php.
	i wasn't even sure about that.
	anyway... thank you for your time and thoughts. best, addison
--
Addison Ellis
small independent publishing co.
114 B 29th Avenue North
Nashville, TN 37203
(615) 321-1791
[EMAIL PROTECTED]
[EMAIL PROTECTED]
subsidiaries of small independent publishing co.
[EMAIL PROTECTED]
[EMAIL PROTECTED]

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



[PHP-DB] header?

2003-01-19 Thread Addison Ellis
hello,
	i have a page where the user selects a category. they are 
directed to a page that takes them to subactegory and displays the 
subcategory according to category id.
	my question is can i from there direct them to a particular 
page from a list of a number of different pages according to their 
subcategory choice? my thought was to direct them to one page that 
contains all the relations between category and subcategory and if 
subcategory=id where category=$category then include or header 
example.php.
	i wasn't even sure about that.
	anyway... thank you for your time and thoughts. best, addison
--
Addison Ellis
small independent publishing co.
114 B 29th Avenue North
Nashville, TN 37203
(615) 321-1791
[EMAIL PROTECTED]
[EMAIL PROTECTED]
subsidiaries of small independent publishing co.
[EMAIL PROTECTED]
[EMAIL PROTECTED]

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



[PHP-DB] print new account name on new account page?

2003-01-18 Thread Addison Ellis
hello,
	i have a form someone fills out. on submit it takes them to a 
new accounts page that say welcome new member. how can i get their 
name to print on the new page from the form they just filled out? i 
have been trying the following but it keeps giving me error messages 
regardless of how i manipulate the following. thank you for your 
time. addison

?
  include(config.php);
  $sql = SELECT firstName,lastName FROM accounts
 WHERE email='$logname';
  $result = mysql_query($sql)
   or die(Couldn't execute query 1.);
  $row = mysql_fetch_array($result,MYSQL_ASSOC);
  extract($row);
  echo 
headtitleNew Account Welcome/title/head
h2 align='center' style='margin-top: .7in'
Welcome $firstName $lastName/h2\n;
?

here is an example of the errors:

Warning: extract() expects first argument to be an array in 
/users/infoserv/web/register/ca/new_account.php on line 82
--
Addison Ellis
small independent publishing co.
114 B 29th Avenue North
Nashville, TN 37203
(615) 321-1791
[EMAIL PROTECTED]
[EMAIL PROTECTED]
subsidiaries of small independent publishing co.
[EMAIL PROTECTED]
[EMAIL PROTECTED]

[PHP-DB] extract() expects first argument to be an array

2003-01-17 Thread Addison Ellis
hello,
	i have received the following error message and don't know 
what to do to correct it. i have tried several things but what i have 
tried does not work. i will post my code below the error message. 
thank you for your time. best, addison ellis

Warning: extract() expects first argument to be an array in 
/users/infoserv/web/register/ca/new_account.php on line 82


?
  include(config.php);
  $sql = SELECT first_name,last_name FROM accounts 
 WHERE email='$email';
  $result = mysql_query($sql)
   or die(Couldn't execute query 1.);
  $row = mysql_fetch_array($result);
  extract($row);
  echo 
headtitleNew Account Welcome!/title/head
h2 align='center' style='margin-top: .7in'
Welcome $firstName $lastName/h2\n;
?
--
Addison Ellis
small independent publishing co.
114 B 29th Avenue North
Nashville, TN 37203
(615) 321-1791
[EMAIL PROTECTED]
[EMAIL PROTECTED]
subsidiaries of small independent publishing co.
[EMAIL PROTECTED]
[EMAIL PROTECTED]

[PHP-DB] $user=$email

2003-01-15 Thread Addison Ellis
hello,
	i am trying to do the following:
case login:  
  $connection = mysql_connect($host, $user,$password)   //15   
   or die (Couldn't connect to server.);
  $db = mysql_select_db($database, $connection)
  or die (Couldn't select database.);

  $sql = SELECT email FROM accounts 
  WHERE email='$email';
  $result = mysql_query($sql)
  or die(Couldn't execute query.);
  $num = mysql_num_rows($result);  
  if ($num == 1)  // login name was found   //25 
  {
 $sql = SELECT email FROM accounts  
 WHERE email='$email'
 AND password=password('$password');
 $result2 = mysql_query($sql)
   or die(Couldn't execute query.);
 $num2 = mysql_num_rows($result2);
 if ($num2  0)  // password is correct
 {
$auth=yes; 
//35   
   $user=$email;
   $today = date(Y-m-d h:m:s);   
   $sql = INSERT INTO login (loginName,loginTime)
   VALUES ('$email','$today');
   mysql_query($sql) or die(Can't execute query.);
   header(Location: cat_ad.php);
 }
 else// password is not correct
 {

	in my config.php file which is a required file i have 
$user=$email, etc.
i continually receive an access denied/couldn't connect to server. 
i'm sure i'm leaving something out...
thank you for your time. addison
--
Addison Ellis
small independent publishing co.
114 B 29th Avenue North
Nashville, TN 37203
(615) 321-1791
[EMAIL PROTECTED]
[EMAIL PROTECTED]
subsidiaries of small independent publishing co.
[EMAIL PROTECTED]
[EMAIL PROTECTED]

[PHP-DB] error message print

2003-01-14 Thread Addison Ellis
hello,
	how can i get an error message to print in the color red as 
in the code below?
	thank you for your time, addison
 $message_new = $zip is not a valid zip code.
   Please try again.;
--
Addison Ellis
small independent publishing co.
114 B 29th Avenue North
Nashville, TN 37203
(615) 321-1791
[EMAIL PROTECTED]
[EMAIL PROTECTED]
subsidiaries of small independent publishing co.
[EMAIL PROTECTED]
[EMAIL PROTECTED]

[PHP-DB] db connect probs

2003-01-14 Thread Addison Ellis
hello,
	do you have any idea why the following(line 106)would return 
the following
error message ?  the login.php has an included form to create an 
account and that is what will not connect.

$connection = mysql_connect($host, $user,$password) //this is line 106

Warning: Access denied for user: 'x,@host' (Using password: YES) in 
/users/infoserv/web/register/login.php on line 106

Warning: MySQL Connection Failed: Access denied for user: 'x,@host' 
(Using password: YES) in /users/infoserv/web/register/login.php on 
line 106
Couldn't connect to server.

my required file is as follows:
?
 $user=$email,$femail;
 $host=$hostname;
 $password=password('$password'),password('$fpassword');
 $database=$classes;
?


thank you again for your time. addison
--
Addison Ellis
small independent publishing co.
114 B 29th Avenue North
Nashville, TN 37203
(615) 321-1791
[EMAIL PROTECTED]
[EMAIL PROTECTED]
subsidiaries of small independent publishing co.
[EMAIL PROTECTED]
[EMAIL PROTECTED]