Re: [PHP] phpMyAdmin for Microsoft SQL

2003-01-28 Thread Joshua E Minnie
I might just have to do that, thanks.


Maxim Maletsky wrote:
 There is nothing for MS SQL that I know. phpMyAdmin was used for mySQL
 initially and then some volunteers like you made postreSQL and Oracle
 versions of it. So, you might want to try one on your own on SourceForge
 :)


 --
 Maxim Maletsky
 [EMAIL PROTECTED]



 Joshua E Minnie [EMAIL PROTECTED] wrote... :

  Hey all,
 
  Does any body know of anything similar to phpMyAdmin for MS SQL?  I have
been doing some googling and haven't come across anything that would help me
out.  I have also checked out www.sourceforge.net and can't seem to come
across anything either.  I am looking for something that will be easy enough
for my client to utilize to update/manipulate a database, rather than having
me re-create the wheel so-to-speak.
 
  --
  Joshua Minnie
  Advantage Computer Services, LLC
  Senior Project Manager
  [EMAIL PROTECTED]
  www.advantagecomputerservices.com
  Tel: 269.276.9690
  Fax : 269.342.8750




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




[PHP] phpMyAdmin for Microsoft SQL

2003-01-27 Thread Joshua E Minnie
Hey all,

Does any body know of anything similar to phpMyAdmin for MS SQL?  I have been doing 
some googling and haven't come across anything that would help me out.  I have also 
checked out www.sourceforge.net and can't seem to come across anything either.  I am 
looking for something that will be easy enough for my client to utilize to 
update/manipulate a database, rather than having me re-create the wheel so-to-speak.

-- 
Joshua Minnie
Advantage Computer Services, LLC
Senior Project Manager
[EMAIL PROTECTED]
www.advantagecomputerservices.com
Tel: 269.276.9690
Fax : 269.342.8750


[PHP] Newline charactes causing problems

2002-12-05 Thread Joshua E Minnie
Hey all,
I know this has been asked before, and I have tried many of the
solutions that were posted in the mailing archives, and also did some
googling.  But I can't seem to eliminate some new line characters from a
string.  Here is the scenario:

1. A user inputs some text into an form and submits the form.
2. The information gets put into my MySQL db.
3. I retrieve the information from the db and display it.

Now after the user submits the form, I have tried dumping it to the db in a
few different ways.  First of all, I dumped it directly to the db with no
changes, hoping that I could remove the newline characters and other
unwanted markup and tags when retrieving the string.  I also tried dumping
it to the db with after I used some string manipulation function, such as
stripslashes, nl2br, htmlentities, stripcslashes, trim, rtrim, and even
str_replace.  And just to be safe I made sure I double checked to make sure
the newlines were removed on before displaying by using some of the same
functions, but to no avail.  The newlines still seem to be there.

In the db, I have tried various different field types, from text to varchar
to blob, but this hasn't changed anything either.

The reason it is so important that the newline characters be removed is
because they are being used to create a javascript string.  And if the
newline characters are there then, I get an unterminated string error.

Here is the current code for adding the user input to the db:

?php

function addNewTask($posted) {
  if(db_conn()) {
// building query
$notes = trim($posted['notes']);
$query = INSERT INTO tasks (uid,title,due,notes) VALUES
('{$_SESSION['uid']}','{$posted['title']}',';
$query .= (($posted['is_due']==1) ?
mktime(23,59,59,$posted['month'],$posted['day'],$posted['year']) : x);
$query .= ','.$notes.');

$result = mysql_query($query) or header(Location:
http://localhost/errors/script.php?f=addNewTaskr=query_failed;);

header(Location: http://localhost/events/task.php?action=addset=1;);
  } else {
header(Location:
http://localhost/errors/script.php?f=addNewTaskr=db_conn;);
  }
}

?

$posted is the array $_POST after it is passed to the function.
$_POST['notes'] is where I am having the problem.

Here is the code for displaying the information from the db:

[library file snippit]
?php
function getTasks($uid) {
  if(db_conn()) {
$i=0;
$aTask=array();

$query = SELECT * FROM tasks WHERE uid='{$uid}' AND done'1';
$result = mysql_query($query);

while($row=mysql_fetch_assoc($result)) {
  $aTasks[$i] =
array($row['due'],$row['title'],stripslashes($row['notes']));
  $i++;
}
if(isset($aTasks)) {
  array_multisort($aTasks,SORT_DESC,SORT_STRING);
  print(pre);
  print_r($aTasks);
  print(/pre);
  return($aTasks);
}
  } else {
header(Location:
http://localhost/errors/script.php?f=getTasksr=db_conn;);
  }
}
?

[displaying page snippit]
?php
$tasks = getTasks($_SESSION['uid']);
$len = count($tasks);
if($len  0) {
  echo(script language=\JavaScript\ type=\text/javascript\\n);
  echo(aTasks = new Array(\n);
  $sTask = ;
  for($i=0;$i$len;$i++) {
$sTask .= \;
if($tasks[$i][0]  getNow()  $tasks[$i][0] != x) $sTask .= span
class='pastdue'Past Due!/spanbr;
$sTask .= $tasks[$i][2].\,;
  }
  $sTask = substr($sTask,0,(strlen($sTask) - 1));
  echo($sTask.);\n);
  echo(/script\n);
}
?

I know that is going into the db with the newlines still in the string.  And
I am constantly going back to mysqladmin and the newlines are there, no
matter what I do.  I was hoping someone could shed some light on what could
possibly be causing this.


+-+-+
| Joshua Minnie   |Tel:  269.276.9690   |
| [EMAIL PROTECTED]|Fax:  269.342.8750   |
| www.wildwebtech.com +-+
|   |
| Independent Web Consultant / Developer|
+---+
| SYSTEM INFO   |
+---+
| PHP v. 4.2.3 running on Win 2000 / IIS 5  |
| MySQL v. 3.23.49 running on RedHat 7.3/Apache |
+---+



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




Re: [PHP] Newline charactes causing problems

2002-12-05 Thread Joshua E Minnie
Already tried that.  Doesn't seem to change anything.

- Original Message -
From: John Wards [EMAIL PROTECTED]
To: Joshua E Minnie [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Thursday, December 05, 2002 10:48 AM
Subject: Re: [PHP] Newline charactes causing problems


On Thursday 05 Dec 2002 3:48 pm, Joshua E Minnie wrote:
 A load of stuff..

I just read the fist few paragraphs and got bored;-)

but

Have you tried doing a str_replace for \n which is new line? just replate it
with a blank string

John




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




Re: [PHP] Newline charactes causing problems

2002-12-05 Thread Joshua E Minnie
I am wondering if it has something to do with the way that MySQL is storing
the data.  But I can't seem to find anything that is helping me when I
search on MySQL related strings.

+-+-+
| Joshua Minnie   |Tel:  269.276.9690   |
| [EMAIL PROTECTED]|Fax:  269.342.8750   |
| www.wildwebtech.com +-+
|   |
| Independent Web Consultant / Developer|
+---+
| SYSTEM INFO   |
+---+
| PHP v. 4.2.3 running on Win 2000 / IIS 5  |
| MySQL v. 3.23.49 running on RedHat 7.3/Apache |
+---+

John Wards [EMAIL PROTECTED] wrote:
On Thursday 05 Dec 2002 3:48 pm, Joshua E Minnie wrote:
 A load of stuff..

I just read the fist few paragraphs and got bored;-)

but

Have you tried doing a str_replace for \n which is new line? just replate
it
with a blank string

John



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




[PHP] Re: Trouble maintaining a session - FIXED

2002-11-27 Thread Joshua E Minnie
Hey all,
  Not exactly sure why this fixed it, but when I upgraded the PHP on the NT4
server to PHP 4.2.3, everything worked as I had hoped.  I plan on looking
into it more, but I just thought that I would let you all know in case
anyone else comes across a similar problem in the future.


--
  _
 / Joshua Minnie\
++---+
| Wild Web Technology|
| Independent Web Consultant/Developer   |
| [EMAIL PROTECTED]   |
||
| Tel : 616.890.1566 |
++




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




[PHP] Trouble maintaining a session

2002-11-05 Thread Joshua E Minnie
Hey all,
I was wondering if anyone could explain to me why I can't seem to maintain a 
session using PHP 4.1.2 on my NT4 server.  I am don't have any problems on my W2K/IIS5 
or Linux machine.  What I am doing is allowing my users to log on to the site at any 
time, and then being returned to the page that they logged in from.  This isn't the 
problem.  The problem is on the NT4/PHP4.1.2 machine when I click on a link to go to 
another page their login information is lost, almost as if they logged out.  Here is 
the validation code that I am currently using:

[auth.inc]
?php
function validateUser() {
  $users = file(includes/users.txt);

  if(!isset($_SESSION['logged_in'])) $_SESSION['logged_in'] = FALSE;
  if(!isset($_SESSION['log_attempt'])) $_SESSION['log_attempt'] = FALSE;
  if(!isset($_SESSION['valid_user'])) $_SESSION['valid_user'] = ;
  if(!isset($_SESSION['email'])) $_SESSION['email'] = ;
  if(!isset($_REQUEST['phpsessid'])) {
if(empty($_POST['email']) || empty($_POST['passwd'])) {
  $email = ;
  $pass = ;
} else {
  $email = $_POST['email'];
  $pass = $_POST['passwd'];
  $_SESSION['log_attempt'] = TRUE;
}

// replace with SQL query when db is instated
foreach($users as $login) {
  list($user,$passwd,$fname,$lname) = explode(|,$login);
  if($user==$email  $passwd==md5($pass)) {
$_SESSION['logged_in'] = TRUE;
$_SESSION['valid_user'] = $fname. .trim($lname);
$_SESSION['email'] = $email;
  }
}
  }
  return($_SESSION['logged_in']);
}
?

Once again, it works fine on the W2K/IIS5 and Linux box, so that is why I am having 
problems isolating the problem.  Maybe it's just my logic and a fresh pair of eyes 
would help looking at this.

Thanks for all your help,

  _
 / Joshua Minnie\
++---+
| Wild Web Technology|
| Independent Web Consultant/Developer   |
| [EMAIL PROTECTED]   |
||
| Tel : 616.890.1566 |
++




[PHP] Re: function()

2002-11-05 Thread Joshua E Minnie
First of all, you can't echo that variable in the manner you are trying.

Try this instead:

[lib.inc]
function test_func($param1) {
  return $param1;
}


[main.php]
?php

// option 1
$num = test_func(123);
echo $num;

// option 2
echo test_func(123);
?

HTH


  _
 / Joshua Minnie\
++---+
| Wild Web Technology|
| Independent Web Consultant/Developer   |
| [EMAIL PROTECTED]   |
||
| Tel : 616.890.1566 |
++


Francisco Vaucher [EMAIL PROTECTED] wrote:
| Hi to all,
|
| I have a problem with function() and some variables.
|
| The issue is this
|
| I declare the function, suppose:
|
| function test_func($param1) {
| echo $param1;
| }
|
| when I call the function like;
|
| ?php test_func(123)?
|
| works OK!
|
| But if I try something like this:
|
| ?php
|
| test_func(123);
| echo $param;
|
| ?
|
| This doesn't work. I need to get some variables values out of the
function.
| Is there a way to make te variables defined in the function 'global' ? So
I
| can use them after the function call.
|
| Thanks in advance!!
|
| regards,
|
| f.
|



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




Re: [PHP] String manipulation

2002-10-24 Thread Joshua E Minnie
If you are trying to just validate the email you might also try to the email
validation function that php.net uses.  You can get it in the CSV area of
the site.

  _
 / Joshua Minnie\
++---+
| Wild Web Technology|
| Independent Web Consultant/Developer   |
| [EMAIL PROTECTED]   |
||
| Tel : 616.890.1566 |
++

Francisco Vaucher [EMAIL PROTECTED] wrote in message
news:3B966ABC166BAF47ACBF4639003B11AC848AE9;exchange.adtarg.com...
:
: Yes I know, but what I need is to check after the @.
:
: I think that regexp it's going to work fine. Erwin wrote something that i
: think it's going to work.
:
: Thanks!
:
: -Mensaje original-
: De: Justin French [mailto:justin;indent.com.au]
: Enviado el: jueves, 24 de octubre de 2002 11:29
: Para: Francisco Vaucher; '[EMAIL PROTECTED]'
: Asunto: Re: [PHP] String manipulation
:
:
: Well, what you really trying to do?  Validate the format of an email
: address?  If so, what you really should be doing is looking for an
existing
: library of code which validates email address formats against the RFC
: standard.
:
: phpclasses.org is bound to have some, but I really like this one:
:
: http://killersoft.com/modules.php?op=modloadname=Newsfile=articlesid=2
:
:
: For your EXACT problem (making sure 'test.com' comes after the @), you
could
: use regular expressions... BUT [EMAIL PROTECTED] IS a valid email address,
: so you'd be running into problems pretty quick :)
:
:
: I looked into HEAPS of regexp's that claim to validate email address'...
: HEAPS of them had problems that would bounce VALIDly formatted email
: address... the killersoft one is the best I found...
:
:
:
: Justin
:
:
: on 25/10/02 12:12 AM, Francisco Vaucher ([EMAIL PROTECTED]) wrote:
:
: 
:  Hi to all (again ;-)
: 
:  I need one or more PHP functions to handle a form input.
: 
:  i.e. you write: [EMAIL PROTECTED]
: 
:  I have to check that after the '@' comes 'test.com'. I think this is
easy,
: 
:  Any help on this ?
: 
:  regards in advance...
: 
:  f.



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




[PHP] Interesting results with date()

2002-10-11 Thread Joshua E Minnie

Hey all,
I am having some interesting, but confusing results when I use date().
What is confusing me is that when I use date with only the first argument, I
get some interesting results with the timezone.

i.e.
?php
  echo date(r T);
?

You would expect to see something like this:

Fri, 11 Oct 2002 13:24:53 -0500 Eastern Standard Time

But instead everything is off by an hour while still keeping the current
timezone:

Fri, 11 Oct 2002 13:24:53 -0400 Eastern Standard Time (notice the -0400
instead of -0500)

Is there something I can do to fix this problem, a setting in the php.ini
file perhaps.  The machine that is running the server is set to the proper
timezone (-0500 EST).

I am running W2K, IIS5 with PHP 4.2.3.

Thanks,


  _
 / Joshua Minnie\
++---+
| Advantage Computer Services, LLC   |
| Senior Project Manager |
| [EMAIL PROTECTED]|
||
| Tel : 269.276.9690 |
| Fax : 269.342.8750 |
++



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




[PHP] GD on Linux

2002-10-04 Thread Joshua E Minnie

I was wondering if anyone could point me in the right direction as to why I
can't get image manipulation with PHP to work.  I am running 4.1.2 on Redhat
with Apache.  The configure script has --with-gd and in the php.ini file I
added the line extension=gd.so.

I got it working on my W2K IIS5 Server by just adding the uncommenting the
line extension=php_gd.dll and restarting the server, but I can't seem to
figure out why I can't get it to work on the Linux box.

Any help or direction is greatly appreciated

~Josh



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




[PHP] Re: GD on Linux

2002-10-04 Thread Joshua E Minnie


Joshua E Minnie [EMAIL PROTECTED] wrote:
: I was wondering if anyone could point me in the right direction as to why
I
: can't get image manipulation with PHP to work.  I am running 4.1.2 on
Redhat
: with Apache.  The configure script has --with-gd and in the php.ini file
I
: added the line extension=gd.so.
:
: I got it working on my W2K IIS5 Server by just adding the uncommenting the
: line extension=php_gd.dll and restarting the server, but I can't seem to
: figure out why I can't get it to work on the Linux box.
:
: Any help or direction is greatly appreciated

A little adendum to my first post .. I can get the image to display but none
of the text I am writing on the image shows up.

~Josh



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




Re: [PHP] where's waldo

2002-09-26 Thread Joshua E Minnie

You could always use the GD image library to create an image and use
javascript to send back the coordinates of the mouse click.  From the mouse
click, the javascript variables would be sent back to the server to
interpret and check for correctness.

This way they can't look at the code to find where waldo is at. Not sure
how easy this would be but HTH.

--
Joshua E Minnie
Advantage Computer Services, LLC
Senior Project Manager
[EMAIL PROTECTED]
Phone: 269.276.9690
Fax: 269.342.8750

Don't work for recognition, but always do work worthy of recognition.

Kenneth Love [EMAIL PROTECTED] wrote:
: about the peeking at the code...
: yes, you could, unless the images were coded somehow. perhaps just
numbers,
: not names. after a few tries they'd find waldo easily enough, but not at
: first.
:
: and besides. i'd like to give people credit for being more honest than
that.
:
:
: @ Edwin [EMAIL PROTECTED] wrote:
:  True. Perhaps.
: 
:  But, I think, you can actually do something like that WITH php. Say
:  PHP+Flash or PHP+Javascript...
: 
:  Of course, if you're able to do something like this just by using
:  PHP+Javascript (and HTML only), most probably, you can just take a peek
at
:  the code and find out where waldo is... ;)
: 
:  - E
: 
:  On Thursday, September 26, 2002 12:12 AM
:  Marek Kilimajer wrote:
: 
:   This is for java, javascript, or flash, not much to do for php.
:  
:   Kenneth Love wrote:
:  
:   hi all.
:   
:   i'm interested in creating a php game that generates a page of random
:  (ish)
:   images, one of which is waldo (or the like). when the player clicks
on
:   waldo, they're taken to the next, slightly harder level.
:   
:   anyone think that sounds fun?
:   any pointers, tips, advice, criticisms?
:   
:   --
:   -- http://kennethlove.onewingedangel.com --



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




[PHP] PEAR or not PEAR

2002-09-24 Thread Joshua E Minnie

Hey all,

I was reading an article at PHPBuilder.com (not very recent, 01/15/2001)
about PEAR DB, and was wondering if anyone had any experience using PEAR
rather than the functions dedicated specifically to each type of DB (i.e.
mysql_, mssql_, pg_, msql_, etc.).  Also, if anyone has any reasons why to
go with one or the other.

The reason I ask, is because I recently downloaded QuerySim so I could
simulate my db info while the db is still in development and not have to
slow down the process.  QuerySim uses PEAR DB functions, and after the db
development is finished it is an easy conversion.  Simply change the line
that tells which db is being accessed.

[code snippet]
$db = DB::connect( mssql://$dbuser:$dbpass@$dbhost/$dbname ); // for MSSQL
$db = DB::connect( mysql://$dbuser:$dbpass@$dbhost/$dbname ); // for MySQL
//instead of

$conn = DB::connect('querysim');
[/code snippet]

And my querys would still remain relatively the same.  I hope you can shed
some light on this because I am not really sure which one to use.


--
Joshua E Minnie
Advantage Computer Services, LLC
Senior Project Manager
[EMAIL PROTECTED]
Phone: 269.276.9690
Fax: 269.342.8750

Don't work for recognition, but always do work worthy of recognition.



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




[PHP] Re: Resource for locating user-written functions?

2002-09-24 Thread Joshua E Minnie

You might check out http://wildelement.users.phpclasses.org/

--
Joshua E Minnie
Advantage Computer Services, LLC
Senior Project Manager
[EMAIL PROTECTED]
Phone: 269.276.9690
Fax: 269.342.8750

Don't work for recognition, but always do work worthy of recognition.
Paul Wilczynski [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Does anyone know of a net resource which lists user-written PHP
 functions available for download?




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




[PHP] Searching a db

2002-09-23 Thread Joshua E Minnie

Hey all,
I am looking for a way to search a MySQL DB based on a users input
string.  The string would be searched on particular fields in my DB, which
is already setup.  The problem I am having is that I want to be able to
return strings that match all *or* part of their string.  Right now it only
returns exact (case-insensitive) matches.  But I want to be able to return
partial matches as well.  I have the relevancy calculation worked out but
I'm not sure how to go about gathering the partial matches.

i.e.

User inputs: Christmas
Output would be something like:

Christmas (100%)
Christian (67%)
Christy (67%)
Chandelier (20%)

Anything below 10% will not be displayed.  I am using a class I found at
phpclasses.org called better_field_search.  I am looking to modify it to fit
my needs but I'm not sure how to go about it.  If anyone has done anything
similar, I would greatly appreciate any help or direction provided.


--
Joshua E Minnie
Advantage Computer Services, LLC
Senior Project Manager
[EMAIL PROTECTED]
Phone: 269.276.9690
Fax: 269.342.8750

Don't work for recognition, but always do work worthy of recognition.



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




[PHP] Implement PHP within a string

2002-07-25 Thread Joshua E Minnie

Is it possible to run PHP that is embedded within a string?  I have a file
that is read into a string and returned to the browser, how can I run that
PHP?

i.e.

?
function something() {
// this is set earlier by other functions
// $str = htmlbodysome html code? $this-getForm(guest); ?some more
html code/body/html;

return ($str);
}

echo $obj-something();


--
Joshua E Minnie/CIO
[EMAIL PROTECTED]
Phone: 616.276.9690
Fax: 616.342.8750
Nextel: 616.862.2847

Don't work for recognition, but always do work worthy of recognition.



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




[PHP] ARRAY_PUSH with $key

2002-07-18 Thread Joshua E Minnie

Hey all,
Does anybody know of a way to push an element onto an array with a
specific key?  What I am trying to do is create a dynamically created
associative array.  Here is a sample print_r of what an array would look
like:

Array (
[default] = css/default.css
[forms] = css/forms.css
)

I have tried array_push, but can't seem to get the results I am looking for.
i.e.:

?
 array_push($samp, $key=$value);  // this throws an error
 array_push($samp, array($key=$value)); // doesn't give the results i'm
looking for

/* output from second array_push
Array (
  [0] = Array (
[default] = css/default.css
  )
  [1] = Array (
[forms] = css/forms.css
  )
)*/
?

If anyone can point me in the right direction, I would appreciate any help
you can give me.


--
Joshua E Minnie/Webmaster
[EMAIL PROTECTED]
Phone: 616.276.9690
Fax: 616.342.8750
Nextel: 616.862.2847

Don't work for recognition, but always do work worthy of recognition.




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




[PHP] Re: (OT) Our Spam Friend

2002-07-10 Thread Joshua E Minnie

Serves our spam friend right... now we can get on with our lives.

Chris Shiflett [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 I just thought this was worth sharing. :-)

 - The following addresses had permanent fatal errors -
 [EMAIL PROTECTED]

 - Transcript of session follows -
 RECIPIENTS MAILBOX IS FULL
 554 [EMAIL PROTECTED]... Service unavailable





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




Re: [PHP] (OT) Our Spam Friend

2002-07-10 Thread Joshua E Minnie

Why not just use this code:
? while(TRUE) { mail(Our Special Friend,); } ?


Vins [EMAIL PROTECTED] wrote:
 ?php
 while($x != $count)
 {
 mail(The Creap, $x)
 $x++;
 }
 ?
 Note there isn't a count variable
 then the only person that can stop it is the system op on the free server.



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




[PHP] Re: How do I split an alphabetical list (array) into A-M and N-Z?

2002-07-03 Thread Joshua E Minnie

Try looking up in the manual about array_slice
(http://us2.php.net/manual/en/function.array-slice.php).
--
Joshua E Minnie/CIO
[EMAIL PROTECTED]
Phone: 616.276.9690
Fax: 616.342.8750
Nextel: 616.862.2847

Don't work for recognition, but always do work worthy of recognition.

Daevid Vincent [EMAIL PROTECTED] wrote:
 Anyone have a function that will take an alphabetical list of names (in
 an array already) and split it into two 'chunks' (arrays) A-M and N-Z?

 So, let's say I have:

 Abby Road
 BobbyCraft
 Darren's doodads
 Farenheit 456
 generic name
 MyCom.com
 Ninety Nine
 NoCo
 O U 1
 O'reilly Publishing
 Oracle
 PSI
 Test Company

 I want to end up with one array/chunk that has (A-M):

 Abby Road
 BobbyCraft
 Darren's doodads
 Farenheit 456
 generic name
 MyCom.com

 And the other that contains (N-Z):

 Ninety Nine
 NoCo
 O U 1
 O'reilly Publishing
 Oracle
 PSI
 Test Company



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




[PHP] sorting a list using regex

2002-06-05 Thread Joshua E Minnie

I am trying to sort a list by their first character, my problem comes when
that first character is a number.  When the character is a number I should
be able to display just the values which begin with a number.  When the
value is a letter, I have no problem sorting this out.  Here is the code
that I am using to determine that, any help will be greatly appreciated.

?
[snip]
while(!feof($fp)) {
  $artist = fgetcsv($fp,128,:);
  if(isset($_GET[sort])) {
if(($_GET[sort] != substr(strtoupper($artist[0]),0,1)) ||
($_GET[sort] == 0-9  !preg(^[0-9],$artist[0]))) continue;
  }
  // do something here
}
[snip]
?

Running PHP 4.2.1 on IIS 5 W2K

Thanks

-josh



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




[PHP] Re: sorting a list using regex

2002-06-05 Thread Joshua E Minnie

I am trying to sort a list by their first character, my problem comes when
that first character is a number.  When the character is a number I should
be able to display just the values which begin with a number.  When the
value is a letter, I have no problem sorting this out.  Here is the code
that I am using to determine that, any help will be greatly appreciated.

?
[snip]
while(!feof($fp)) {
  $artist = fgetcsv($fp,1024,:);
  if(isset($_GET[sort])) {
if(($_GET[sort] != substr(strtoupper($artist[0]),0,1)) 
!($_GET[sort] == #  ereg(^[0-9],$artist[0]))) continue;
  }
}
[snip]
?

Running PHP 4.2.1 on IIS 5 W2K

Thanks

-josh





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




[PHP] Re: [PHP-INST] W2K SP2, PHP 4.2.1, IIS 5

2002-05-23 Thread Joshua E Minnie

Finally got that part to work, I ended up unistalling then reinstalling the
IIS server and unistalling PHP, then using the PHP windows installer to
configure the IIS server for me.  Now I am having another problem.  I am
getting the error:

PHP Warning: Unable to load dynamic library
'D:\PHP\extensions\php_mssql.dll' - The specified module could not be found.
in Unknown on line 0

What I don't understand about this error is that the php_mssql.ddl is in
that exact directory.  Any suggestions?

- Original Message -
From: Paul Ellison [EMAIL PROTECTED]
To: Joshua E Minnie [EMAIL PROTECTED]
Sent: Wednesday, May 22, 2002 8:42 PM
Subject: Re: [PHP-INST] W2K SP2, PHP 4.2.1, IIS 5


 Are you trying to run PHP as a CGI or ISAPI module on IIS?

 Same setup here and it's cool - be happy to help if I can!

 Paul


 - Original Message -
 From: Joshua E Minnie [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Wednesday, May 22, 2002 12:43 in the PM
 Subject: [PHP-INST] W2K SP2, PHP 4.2.1, IIS 5


  Hey all,
  I have a problem, that I can't seem to find the answer to.  I have
  checked the archives and the website, but to no avail.  I have installed
 PHP
  4.2.1 on my local machine with IIS running W2K Pro.  When I run php -i,
I
  get the html output expected.  But when I try to open the simple php
 script
 
  ?php
phpinfo();
  ?
 
  all I get is the script written directly to the browser as text.  I
can't
  figure out why it is not going through php.exe.  Any help would be
greatly
  appreciated.
 
  -josh
 
 
 
  --
  PHP Install Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 


 ---
 Outgoing mail is certified Virus Free.
 Checked by AVG anti-virus system (http://www.grisoft.com).
 Version: 6.0.363 / Virus Database: 201 - Release Date: 5/21/2002





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




[PHP] undefined variable...working in PHP 4.1.2 not 4.2.1

2002-05-23 Thread Joshua E Minnie

Hey all,
I am having a problem that maybe some of you have had as well.  I am
using a session and when I pass the session variable to the next page it
comes back as undefined.  Is there some new syntax in 4.2.1 that I am
missing, I thought that I made all the necessary changes.  Here is the
entire script:

?php
session_start();
if(!session_is_registered(user)) {
  header(Location: http://localhost/denied.htm;);
  exit;
}
?
[snip] HTML CODE [snip]
?php echo $user;?
[snip] MORE HTML CODE [snip]

I am getting the error at the echo statement between the HTML code, saying
that $user is undefined.  The previous page does register user.


I am running PHP 4.2.1-CGI, IIS 5, W2K SP2.


-josh



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




[PHP] W2K SP2, PHP 4.2.1, IIS 5

2002-05-22 Thread Joshua E Minnie

Hey all,
I have a problem, that I can't seem to find the answer to.  I have
checked the archives and the website, but to no avail.  I have installed PHP
4.2.1 on my local machine with IIS running W2K Pro.  When I run php -i, I
get the html output expected.  But when I try to open the simple php script

?php
  phpinfo();
?

all I get is the script written directly to the browser as text.  I can't
figure out why it is not going through php.exe.  Any help would be greatly
appreciated.

-josh



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




Re: [PHP] W2K SP2, PHP 4.2.1, IIS 5

2002-05-22 Thread Joshua E Minnie

Already tried the other tag, and php extension is setup as a CGI in IIS.
That is why this is puzzling me so.

-josh

Bruce Vander Werf [EMAIL PROTECTED] wrote:
 Josh,

 Try just using ? as the opening tag.

 Make sure your php file has the extension php and make sure the php
 extension is setup as a CGI extension in IIS (pointing to php.exe).

 --Bruce

Joshua E Minnie [EMAIL PROTECTED] wrote:
 Hey all,
 I have a problem, that I can't seem to find the answer to.  I have
 checked the archives and the website, but to no avail.  I have installed
PHP
 4.2.1 on my local machine with IIS running W2K Pro.  When I run php -i, I
 get the html output expected.  But when I try to open the simple php
script

 ?php
   phpinfo();
 ?

 all I get is the script written directly to the browser as text.  I can't
 figure out why it is not going through php.exe.  Any help would be greatly
 appreciated.

 -josh



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




Re: [PHP] W2K SP2, PHP 4.2.1, IIS 5

2002-05-22 Thread Joshua E Minnie

I am about ready to use the hammer.  I know almost nill about IIS.  I do
know for sure that the PHP interpretter is working.  Does anybody who knows
about IIS have any advice for me to test if IIS is really working?

-frustrated josh


Sqlcoders.Com Programming Dept [EMAIL PROTECTED]:
 Ho hum,
 So it doesn't seem to be script mappings - I stand corrected.

 Have you checked that the .PHP type is associated in the

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W3SVC\Parameters\Script
 Map branch of the registry?.
 You might want to check that it's .PHP, and not .PHP4 , as this could be
 your problem if some tool did the setup and you didn't see the actual file
 ext being mapped.

 If that doesn't work, then as you already know the problem isn't with the
 PHP interpreter,
 it's probably something in IIS having a fit.

 Here's my general checklist:
 Did you restart IIS?
 Did you restart the server?
 Does php.exe have the appropriate permissions?
 Are you sure that the script mappings are correct? (based upon the fact
that
 you're getting the php source I'm inclined to say that it's still your
 script mappings).

 If all that fails, there's always:
 Have you tried a hammer?

 grin,
 I hope somewhere in there you find an answer,
 if it was me I'd be triple checking my script mappings, as from what
you've
 said everything seems to work individually, the pieces just haven't been
 bound together.

 HTH,
 Dw.

 Sqlcoders.com Dynamic data driven web solutions
 - Original Message -
 From: Sqlcoders.com Programming Dept [EMAIL PROTECTED]
 To: php general [EMAIL PROTECTED]
 Cc: Joshua E Minnie [EMAIL PROTECTED]
 Sent: May 22 2002 09:14 PM
 Subject: Re: [PHP] W2K SP2, PHP 4.2.1, IIS 5


  Hi there!,
  In a word - script mappings.
 
  In the IIS administrator,
  you must associate the .php extension with the php interpreter.
 
  Use the IIS help wizard to tell you how,
  or:
  1. Start Regedt32.exe and open the following registry key:
  HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W3SVC
  \Parameters\ScriptMap
 
  2. Click Add Value from the Edit menu.
 
  2b. The Value Name is .php
 
  2c. The Data type is REG_SZ.
 
  2d. The String value is the full path to php.exe.exe\php.exe %s %s
  NOTE: The %s %s is case sensitive. (e.g. %S %S will not work).
  (%s %s is the file, you might need to add a -i or -whatever if php needs
 it)
 
  3. Restart the WWW service.
 
  4. Cross your fingers, if it doesn't work go in  play with the string
 value
  by using the edit dialog in regedt32.
 
  HTH,
  Dw.
 
  Sqlcoders.com Dynamic data driven web solutions
  - Original Message -
  From: Joshua E Minnie [EMAIL PROTECTED]
  To: [EMAIL PROTECTED]
  Sent: May 22 2002 10:54 AM
  Subject: [PHP] W2K SP2, PHP 4.2.1, IIS 5
 
 
   Hey all,
   I have a problem, that I can't seem to find the answer to.  I have
   checked the archives and the website, but to no avail.  I have
installed
  PHP
   4.2.1 on my local machine with IIS running W2K Pro.  When I run
php -i,
 I
   get the html output expected.  But when I try to open the simple php
  script
  
   ?php
 phpinfo();
   ?
  
   all I get is the script written directly to the browser as text.  I
 can't
   figure out why it is not going through php.exe.  Any help would be
 greatly
   appreciated.
  
   -josh
  
  
  
   --
   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] Re: W2K SP2, PHP 4.2.1, IIS 5

2002-05-22 Thread Joshua E Minnie

I even tried adding the mime type for php (application/x-httpd-php). Argh.

Thanks for all the help that you guys have provided thus far.

-josh

 Hey all,
 I have a problem, that I can't seem to find the answer to.  I have
 checked the archives and the website, but to no avail.  I have installed
PHP
 4.2.1 on my local machine with IIS running W2K Pro.  When I run php -i, I
 get the html output expected.  But when I try to open the simple php
script

 ?
   phpinfo();
 ?

 all I get is the script written directly to the browser as text.  I can't
 figure out why it is not going through php.exe.  Any help would be greatly
 appreciated.




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




[PHP] lists of headers

2002-05-17 Thread Joshua E Minnie

Can anybody tell me where I can find a list of all the possible headers that
I can use in the header function? I searched through the manual and can't
seem to find a list of headers.

I need to know what header it is that display an authorization required or
forbidden when my authentication fails.
--
Joshua E Minnie/CIO
[EMAIL PROTECTED]
Don't work for recognition, but always do work worthy of recognition.



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




[PHP] trans-sid .. help

2002-05-15 Thread Joshua E Minnie

I have been using some simple session management for some of my pages.  I am
inquiring about the use of transparent session id usage.  I have read the
manual and I am still a little confused on how to go about using it.

I did run phpinfo() to make sure that trans-id was enabled.  It outputed:
session.use_trans_id[local value] 1[master value] 1

I am assuming that this means it is enabled.  Now my question is how do I go
about using a trans-id?  I've seen session id appended to the URL (i.e.
this.php?PHPSESSID=a2604374903c616c9cd34e13c0ceed98), but would like to use
it without disclosing the session id in the URL.  If anyone could give me
some sample code to help me alleviate the confusion, it will be greatly
appreciated.


I am using PHP 4.1.2 compiled as CGI on Windows NT 4.0

--
Joshua E Minnie/CIO
[EMAIL PROTECTED]
Don't work for recognition, but always do work worthy of recognition.



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




[PHP] header failing...

2002-05-15 Thread Joshua E Minnie

Can anybody tell me why a call to header would fail.  What I mean by this is
that it doesn't redirect at all.  Here is a snippet of the code that I am
using:

?
...
if(session_is_registered(user)) {
  header(Location: http://www.somwhere.net/admin.php;);
}
...
?

I am using PHP 4.1.2 on Win NT 4.0

--
Joshua E Minnie/CIO
[EMAIL PROTECTED]
Don't work for recognition, but always do work worthy of recognition.



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




Re: [PHP] Re: getting a function name of the calling function

2002-05-03 Thread Joshua E Minnie


Miguel Cruz [EMAIL PROTECTED] wrote:
[snip]
 I'm guessing he wants to do something like a stack trace to figure out how
 a function managed to get itself called with bad data.

 With utility functions that may get called hundreds of times in a single
 run, that would be some really handy stuff.
[snip]

That is exactly what I am trying to do.  Does you know of a good way to go
about doing this? The functions that are going to use this are base
functions which have full control to the database access to
INSERT/UPDATE/DELETE but they are never used by the user.  The user will use
some wrapper functions which call the base functions.  But I want to know
who (which function) called the base function.

-josh




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




[PHP] mssql_prev_result()???

2002-05-03 Thread Joshua E Minnie

Does anybody know of a good way to get the previous result in a query
result?

The query looks like this: SELECT * FROM [users].  This will return a result
set of 30 to 40 users.

The reason I need to grab the previous is because I would like to be able to
virtually scroll through my data in the table.  Here is some psuedocode of
what I am trying to do:

the form
  //fields to be filled by the user data that comes in from each query
  button value=previous user onClick=get_prev_user()
  button value=next user onClick=get_next_user()
/the form


--
Joshua E Minnie/CIO
[EMAIL PROTECTED]
Phone: 616.276.9690
Fax: 616.342.8750
Nextel: 616.862.2847

Don't work for recognition, but always do work worthy of recognition. ~
Unknown



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




[PHP] Re: getting a function name of the calling function

2002-05-02 Thread Joshua E Minnie

What I am trying to do is create an error message within in a string that
whenever each function fails it echos this particular string out with it's
pertinent information.

i.e.
?
$error_string = Warning: unable to complete query in .__FUNCTION__.name
in .__FILE__;

function some_funct($var) {
  global $error_string;
  //doing something
  //error detected
  echo $error_string;
}
?

Does this sounds feasible or is there another way to generate a dynamic
error message without giving the user to much information about the error if
it occurs?

-josh

Cc Zona [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 In article [EMAIL PROTECTED],
  [EMAIL PROTECTED] (Joshua E Minnie) wrote:

  Does anybody know of any constants or predefined functions that will
  retrieve the calling functions name?  For example:
 
  ?
  function new_func($somedata) {
echo I am function .get_func_name();
  }
  ?

 What would be the point of this?  How could you call the function to get
 the info without already having the info in the first place?  If calling
 with a variable ($foo();), then you have the variable.  If the call is
 hardcoded (new_func();) then of course you know the name there too.
 Perhaps if you explained what you're trying to accomplish...

 --
 CC



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




[PHP] bad row offset

2002-05-02 Thread Joshua E Minnie

I am a little confused with an error I am receiving on a function I am
using.  Here is the function:

function get_user_data($user,$field) {
# get_user_data is a base function assuming no errors have
# been passed and will return the data of a specific field
# based on the value of $user

  db_conn();
  $query = SELECT [$field] FROM [users] WHERE [user] = '$user';
  $result = mssql_query($query) or die(bWarning:/b Unable to complete
query - b.__LINE__./b in b$PHP_SELF/bbr\n);
  if($field == permission)
return hexdec(mssql_result($result,0,0));
  else
return mssql_result($result,0,0);
}

The error it is giving me is a bad row offset on line 15.  Line 15 is the
line containing return hexdec(mssql_result($result,0,0));  I don't
understand why it is giving me these errors because I was using this
function before with no problems and now it is return this error.  Any help
would be greatly appreciated, thanks in advance.

-josh



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




[PHP] Re: getting a function name of the calling function

2002-05-02 Thread Joshua E Minnie

Cc Zona [EMAIL PROTECTED] wrote:
[snip]
 A step up would be to use the error handling functions instead
 http://php.net/errorfunc.  Then you can customize which errors get
 reported to the user, under what circumstances, how, whether to forward
the
 reports to you as well, plus the opportunity to know the context (set
 variables and their values) in which the error occured.
[snip]

Thank you for the recommendation, I will probably use that as well. And I
have changed that __FUNCTION__ with __LINE__.

-josh



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




[PHP] Re: Variable Help.

2002-05-01 Thread Joshua E Minnie

Try using a link like this instead:

http://www.danceportal.co.uk/charts.php?date=wk001-fri-18-jan-2002

Then you can use the variable $date and parse through the variable how you
need it.
--
Joshua E Minnie/CIO
[EMAIL PROTECTED]
Phone: 616.276.9690
Fax: 616.342.8750
Nextel: 616.862.2847

Don't work for recognition, but always do work worthy of recognition.


Randum Ian [EMAIL PROTECTED] wrote in message
004901c1f137$5ca691c0$b1f2b5ac@randum">news:004901c1f137$5ca691c0$b1f2b5ac@randum...
 Hi all,

 I want to link to a page like this:

 http://www.danceportal.co.uk/charts.php?wk0001-fri-18-jan-2002

 How do I get the information into a script?

 Cheers, Ian.
 ---
 Randum Ian
 DJ / Reviewer / Webmaster, DancePortal (UK) Limited
 [EMAIL PROTECTED]
 http://www.danceportal.co.uk
 DancePortal.co.uk - Global dance music media




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




Re: [PHP] Re: PHP Editors

2002-05-01 Thread Joshua E Minnie

I develop my stuff in TextPad as well.  You can download other syntax
highlighting files as well, not just PHP.  So if you develop in Windows and
like to code in a text editor TextPad would be my definite recommendation.

-josh
Miguel Cruz [EMAIL PROTECTED] wrote:
 On Wed, 1 May 2002, Liam Gibbs wrote:
  Thanks to everyone for your suggestions. I went with EditPlus 2. The
  project features, easy access to all files, and directory-wide
  search-and-replace functionality are what hooked me. I'm still looking
  around, though, so if anyone has any other suggestions, let me know.

 When forced to use Windows, I always use TextPad, which has PHP-specific
 syntax highlighting, multifile search/replace, and basically just provides
 any editor feature you think you might need as long as you look hard
 enough. Wicked fast too.

 It's no BBEdit, but what can you do?

 miguel




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




[PHP] getting a function name of the calling function

2002-05-01 Thread Joshua E Minnie

Does anybody know of any constants or predefined functions that will
retrieve the calling functions name?  For example:

?
function new_func($somedata) {
  echo I am function .get_func_name();
}
?

-josh



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




[PHP] Re: Query Close

2002-05-01 Thread Joshua E Minnie

Check the PHP manual for mysql_close

Depends on how you opened it.  Did you use mysql_pconnect or mysql_connect?
Your answer should be in the manual.

-josh
Christian Ista [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hello,

 What's happen if when I used a query, I don't do that :

 mysql_close($connection);

 Bye







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




Re: [PHP] getting a function name of the calling function

2002-05-01 Thread Joshua E Minnie

I actually need it to print out the name of itself for error detection
purposes.

  Does anybody know of any constants or predefined functions that will
  retrieve the calling functions name?  For example:
 
  ?
  function new_func($somedata) {
echo I am function .get_func_name();
  }
  ?

This example should print out:
I am function new_func

Is this possible?



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




[PHP] Re: Query Close

2002-05-01 Thread Joshua E Minnie

Christian Ista [EMAIL PROTECTED] wrote:
Depends on how you opened it.  Did you use mysql_pconnect or
mysql_connect?

 mysql_connect

Here is an excerpt from the manual http://www.php.net/mysql_connect

The link to the server will be closed as soon as the execution of the script
ends, unless it's closed earlier by explicitly calling mysql_close().

Hope that answers your question, but maybe next time check the manual first.

-josh



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




[PHP] Checking to see if a DELETE was successful from MSSQL

2002-04-30 Thread Joshua E Minnie

Can anyone tell me the best way to check that a DELETE query was successful.
I have tried using mssql_num_rows() and mssql_rows_affected() but it is
always telling me that the DELETE was successful, even when it shouldn't
have been.  Here is the code that I am trying to work with right now.

?
function delete_user($dbname, $user) {
  //connecting to db and getting table
  mssql_select_db($dbname) or die(Table unavailable);

  //deleting user from user table
  $query = DELETE FROM [users] WHERE [user] = '$user';
  $result = mssql_query($query) or die(Unable to delete user);
  if(mssql_num_rows($result)  0) echo User successfully deleted.br\n;
  else echo User does not existbr\n;
}
?

*Running PHP 4.1.2 on Windows NT 4.0 with MS SQL Server 2000

--
Joshua E Minnie/CIO
[EMAIL PROTECTED]
Phone: 616.276.9690
Fax: 616.342.8750
Nextel: 616.862.2847

Don't work for recognition, but always do work worthy of recognition.




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




Re: [PHP] Checking to see if a DELETE was successful from MSSQL

2002-04-30 Thread Joshua E Minnie

I tried that already, it always returns true.  The reason is because it will
always return true since it is only deleting if the user exists.  This means
that the query will run and successfully complete.  But if the user does not
exist it still runs and completes successfully, but the user was not there.
So how do I detect that situation.

--
Joshua E Minnie/CIO
[EMAIL PROTECTED]
Phone: 616.276.9690
Fax: 616.342.8750
Nextel: 616.862.2847

Don't work for recognition, but always do work worthy of recognition.

Steve Bradwell [EMAIL PROTECTED] wrote:
 Try this,

   $query = DELETE FROM [users] WHERE [user] = '$user';
   $result = mssql_query($query) or die(Unable to delete user);
   if ($result)
  //delete worked.
   else
  //delete failed.

Original Message
 Can anyone tell me the best way to check that a DELETE query was
successful.
 I have tried using mssql_num_rows() and mssql_rows_affected() but it is
 always telling me that the DELETE was successful, even when it shouldn't
 have been.  Here is the code that I am trying to work with right now.

 ?
 function delete_user($dbname, $user) {
   //connecting to db and getting table
   mssql_select_db($dbname) or die(Table unavailable);

   //deleting user from user table
   $query = DELETE FROM [users] WHERE [user] = '$user';
   $result = mssql_query($query) or die(Unable to delete user);
   if(mssql_num_rows($result)  0) echo User successfully deleted.br\n;
   else echo User does not existbr\n;
 }
 ?

 *Running PHP 4.1.2 on Windows NT 4.0 with MS SQL Server 2000



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




Re: [PHP] Checking to see if a DELETE was successful from MSSQL

2002-04-30 Thread Joshua E Minnie

That was exactly what I needed.  Thanks, this group has been so helpful.

.:. Josh .:.

Miguel Cruz [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 On Tue, 30 Apr 2002, Joshua E Minnie wrote:
  I tried that already, it always returns true.  The reason is because it
  will always return true since it is only deleting if the user exists.
  This means that the query will run and successfully complete.  But if
  the user does not exist it still runs and completes successfully, but
  the user was not there. So how do I detect that situation.

 You could always try preceeding it with a SELECT...

 miguel




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




[PHP] Hex2Bin??

2002-04-30 Thread Joshua E Minnie

I know that there is a built-in function for bin2hex(), but does any body
know have any code to do just the opposite, convert hex2bin?

--
Joshua E Minnie/CIO
[EMAIL PROTECTED]
Phone: 616.276.9690
Fax: 616.342.8750
Nextel: 616.862.2847

Don't work for recognition, but always do work worthy of recognition.



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




Re: [PHP] Hex2Bin??

2002-04-30 Thread Joshua E Minnie

Although the first comment was not what I needed, I did find another
built-in function that converts between any base, base_convert($number,
$frombase, $tobase) worked wonderful for what I needed.

Josh

Miguel Cruz [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 On Tue, 30 Apr 2002, Joshua E Minnie wrote:
  I know that there is a built-in function for bin2hex(), but does any
body
  know have any code to do just the opposite, convert hex2bin?

 Check the first comment in the manual under bin2hex.

 miguel




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




Re: [PHP] Hex2Bin??

2002-04-30 Thread Joshua E Minnie

Expensive how?

-josh

Bogdan Stancescu [EMAIL PROTECTED] wrote:
 I'd recommend writing a wrapper around base_convert, naming it hex2bin
 and using that instead. base_convert() is way too expensive for this
 purpose (you know that any hex figure is translated to exactly four
 bits, so you don't need any actual conversion - just replacement). This
 is why I suggested the wrapper - you can change the code at any time if
 you see it's too time-consuming...



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




[PHP] MS SQL problem

2002-04-29 Thread Joshua E Minnie

I am relatively new to the SQL aspect of PHP.  I have a small background in
SQL programming, so I can get my way around that part.  The problem I am
having is that a query of mine is throwing back zero (0) rows of result.  I
am using some simple SQL syntax to check for the existance of a user in a db
(i.e.  SELECT $field FROM $table WHERE $field = '$value').  Now I am testing
the script and I am trying to add a user twice, which should in theory throw
an error and not allow the user to be added a second time.  Here is the
function that I created in which my errors are.  It may just be a simple
problem with my logic.  I have checked the manual and a lot of other PHP and
SQL resources.

I am running PHP 4.1.2 binary on windows connecting to MS SQL Server 2000.

?
...
if(user_exists($dbname,users,user,$user)  0) {
  echo User name already taken, please choose another.;
}
else {
  $query = INSERT INTO users VALUES
('$first','$last','$user','$pass','$perms');
  $result = mssql_query($query) or die(Unable to add user);
  echo User successfully added.br\n;
}
...
?
-function-
?
function user_exists($dbname, $table, $field, $value) {
  //connecting to db and getting table
  mssql_select_db($dbname) or die(Table unavailable);

  //checking existance of field:value combination
  $query = SELECT $field FROM $table WHERE $field = '$value';
  $result = @ mssql_query($query) or die(Unable to check existance of
userbr);
  $rows = mssql_num_rows($result);
  echo Query returned $rows row(s) of data.brbr\n;
  return $rows;
}
?

Any help that anyone can provide would be a big help.  Thanks in advance.

--
Joshua E Minnie/CIO
[EMAIL PROTECTED]
Phone: 616.276.9690
Fax: 616.342.8750
Nextel: 616.862.2847

Don't work for recognition, but always do work worthy of recognition.



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




[PHP] Deleting from a SQL db

2002-04-29 Thread Joshua E Minnie

Can anyone help me understand why this code is not deleting the row from the
MS SQL db like it should.

?
...
  $query = DELETE FROM users WHERE user = '$user';
  $result = @ mssql_query($query) or die(Unable to delete user);
  if($result = 0) echo User successfully deleted.br\n;
...
?

I am running PHP 4.1.2 binary on Windows NT 4.0 with MS SQL Server 2000
running on Windows 2000.


--
Joshua E Minnie/CIO
[EMAIL PROTECTED]
Phone: 616.276.9690
Fax: 616.342.8750
Nextel: 616.862.2847

Don't work for recognition, but always do work worthy of recognition.



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




Re: [PHP] Deleting from a SQL db

2002-04-29 Thread Joshua E Minnie

Stuart Dallas [EMAIL PROTECTED] wrote:
 Replace the die(...) with die(mysql_error()) and the message should tell
 you what's wrong.

It never gets to the die(...) statement.  The script is returning a
positive integer from the mssql_query() function. I am not seeing it ever
throw an error.  It just doesn't delete.

Here is the URL of the running script:
http://www.acsurf.net/php_db/sql_test.php.  I am trying to delete the
username josh.

--
Joshua E Minnie/CIO
[EMAIL PROTECTED]
Phone: 616.276.9690
Fax: 616.342.8750
Nextel: 616.862.2847

Don't work for recognition, but always do work worthy of recognition.





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




Re: [PHP] Deleting from a SQL db

2002-04-29 Thread Joshua E Minnie

Stuart Dallas [EMAIL PROTECTED] wrote:
 Print the SQL statement $query just before you call mssql_query() - make
 sure the SQL going in is what you think it is. Also, check
 mssql_affected_rows() after the call to make sure something was modified.

It is writing the proper $query.  The reason for the error is missing []
around the table and field names.  I don't know why this didn't throw an
error in other parts of the script but it works fine now that I added them.


  Replace the die(...) with die(mysql_error()) and the message should
tell
  you what's wrong.

 It never gets to the die(...) statement.  The script is returning a
 positive integer from the mssql_query() function. I am not seeing it ever
 throw an error.  It just doesn't delete.

 Here is the URL of the running script:
 http://www.acsurf.net/php_db/sql_test.php.  I am trying to delete the
 username josh.


--
Joshua E Minnie/CIO
[EMAIL PROTECTED]
Phone: 616.276.9690
Fax: 616.342.8750
Nextel: 616.862.2847

Don't work for recognition, but always do work worthy of recognition.



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




[PHP] Looking for an easier regex check...

2002-04-29 Thread Joshua E Minnie

Does anybody know of a good way to make sure that a string contains ONLY
certain characters.  I tried using
ereg([~`!@#$%^*(){}-+=|\\/.,'\:;\[\]], $string); but I get parse
errors.  Besides that I only want the characters A-Za-z0-9_ in $string.  Is
there is simpler way to ensure this rather than checking to see if any of
the characters I don't want are in there?


Thank you for your help in advance.




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




[PHP] Looking for an easier regex check...

2002-04-29 Thread Joshua E Minnie

Does anybody know of a good way to make sure that a string contains ONLY
certain characters.  I tried using
ereg([~`!@#$%^*(){}-+=|\\/.,'\:;\[\]], $string); but I get parse
errors.  Besides that I only want the characters A-Za-z0-9_ in $string.  Is
there is simpler way to ensure this rather than checking to see if any of
the characters I don't want are in there?


Thank you for your help in advance.


--
Joshua E Minnie/CIO
[EMAIL PROTECTED]
Phone: 616.276.9690
Fax: 616.342.8750
Nextel: 616.862.2847

Don't work for recognition, but always do work worthy of recognition.



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




Re: [PHP] Looking for an easier regex check...

2002-04-29 Thread Joshua E Minnie

Worked great only you forgot to escape the carat character.  Thanks for the
help.

Josh

Miguel Cruz [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 On Mon, 29 Apr 2002, Joshua E Minnie wrote:
  Does anybody know of a good way to make sure that a string contains ONLY
  certain characters. I tried using
  ereg([~`!@#$%^*(){}-+=|\\/.,'\:;\[\]], $string); but I get parse
  errors.

 I'm surprised you get a parse error. I'd expect you would get a runtime
 error like REG_ERANGE.

 Anyway, you need to escape all the characters that have special meanings
 in regular expressions. Try something like:

 ereg([~!@#\$%^\*(){}\-\+=|\\/\.,'\:;\[\]a-zA-Z0-9], $string);

  Besides that I only want the characters A-Za-z0-9_ in $string. Is there
  is simpler way to ensure this rather than checking to see if any of the
  characters I don't want are in there?

 miguel




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




Re: [PHP] PHP 4.2.0 on win2k, can't use mysql_fetch_* functions

2002-04-29 Thread Joshua E Minnie

Do you have some sample code that we could look at?

--
Joshua E Minnie/CIO
[EMAIL PROTECTED]
Phone: 616.276.9690
Fax: 616.342.8750
Nextel: 616.862.2847

Don't work for recognition, but always do work worthy of recognition.

1lt John W. Holmes [EMAIL PROTECTED] wrote in message
01ee01c1efbb$1889ee60$2f7e3393@TB447CCO3">news:01ee01c1efbb$1889ee60$2f7e3393@TB447CCO3...
 Did you turn on Display_errors in php.ini?

 ---John Holmes...

 - Original Message -
 From: Austin W. Marshall [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Monday, April 29, 2002 3:52 PM
 Subject: [PHP] PHP 4.2.0 on win2k, can't use mysql_fetch_* functions


  Is there something about the php 4.2.0 windows binary (installer
  version) that renders the mysql_fetch_* functions useless?
 
  I installed php 4.2.0 on windows 2000 along with Apache 1.3.24 and MySQL
  3.23.49, and in a script i have a simple SELECT statement.  The content
  is in the database, the query executes successfuly, but it's as if
  mysql_fetch_array and mysql_fetch_row functions don't return anything.
   I know mysql support is built-in (as indicated on php.net) and working,
  because i was able to use php to insert data into the database.  On that
  one computer i was able to recreate the problem consistently and in no
  situation would mysql_fetch array or _row return anything.
 
  I haven't had the opportunity to try this on any other win2k boxen, but
  am not having any problems in Linux or OpenBSD.  Is anyone else
  experiencing any problems?
 
 
  --
  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] Array elements missing

2002-04-09 Thread Joshua E Minnie

Thanks for the suggestion.  I did get it to work prior to your posting, but
this does help slim up my code quite a bit.
--
Joshua E Minnie
CIO
[EMAIL PROTECTED]

Don't work for recognition, but always do work worthy of recognition.

Jason Wong [EMAIL PROTECTED] wrote:
 On Monday 08 April 2002 23:03, Joshua E Minnie wrote:
  Can anyone tell me why when the first element in my array would
disappear
  with the following code:
 
  ?
//remove the unwanted item from the array
for($i=0;$icount($stores);$i++) {
  $delete=0;
  //checking to see if it has been requested for delete
  foreach($HTTP_POST_VARS as $val) {
if(is_numeric($val)) {
  if($val==$i) $delete = 1;
  else continue;
}
else continue;
  }
  //if not requested for delete, push on to temp array
  if($delete == 0) {
array_push($temp, $stores[$i]);
  }
}
$stores = $temp;
print_r($stores);
print_r($HTTP_POST_VARS);
  ?

 I would rewrite the above as:

   foreach ($HTTP_POST_VARS as $val) {
 if(is_numeric($val)) {
   unset($stores[$val]);
 }
   }

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

 /*
 Don't smoke the next cigarette.  Repeat.
 */



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




[PHP] Array elements missing

2002-04-08 Thread Joshua E Minnie

Can anyone tell me why when the first element in my array would disappear
with the following code:

?
  //remove the unwanted item from the array
  for($i=0;$icount($stores);$i++) {
$delete=0;
//checking to see if it has been requested for delete
foreach($HTTP_POST_VARS as $val) {
  if(is_numeric($val)) {
if($val==$i) $delete = 1;
else continue;
  }
  else continue;
}
//if not requested for delete, push on to temp array
if($delete == 0) {
  array_push($temp, $stores[$i]);
}
  }
  $stores = $temp;
  print_r($stores);
  print_r($HTTP_POST_VARS);
?

Here is the output of the print_r's:

Array
(
[0] =
[1] = Array
(
[0] = AR
[1] = 1
[2] = 1059 11th St.
[3] = Grand Rapids
[4] = (233) 457-2394
[5] = (233) 457-4982
[6] =
[7] =
[8] =
)

[2] = Array
(
[0] = AR
[1] = 2
[2] = 1059 11th St.
[3] = Grand Rapids
[4] = (233) 457-2394
[5] = (233) 457-4982
[6] =
[7] =
[8] =
)

[3] = Array
(
[0] = LA
[1] = 3
[2] = 1174 Gernaat Ct.
[3] = Delton
[4] = (233) 457-2394
[5] = (233) 457-4982
[6] =
[7] =
[8] =
)

[4] = Array
(
[0] = ME
[1] = 4
[2] = 1059 11th St.
[3] = Delton
[4] = (233) 457-2394
[5] = (233) 457-4982
[6] =
[7] =
[8] =
)

[5] = Array
(
[0] = MI
[1] = 6
[2] = 437 4th Ave.
[3] = Yet Another City
[4] = (123) 283-4839
[5] = (123) 458-4843
[6] =
[7] =
[8] =
)

)
Array
(
[chk5] = 5
[Submit] = Delete Store(s)
)


The script deletes the element that was requested deleted, but for some
reason the first element in the array never gets copied.  Any help that you
can provide would be greatly appreciated.
--
Joshua E Minnie
CIO
[EMAIL PROTECTED]

Don't work for recognition, but always do work worthy of recognition.



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




Re: [PHP] Explode and Trim

2002-04-05 Thread Joshua E Minnie

Unfortunately it doesn't.  That is why I am kind of puzzled by the
situation.


--
Joshua E Minnie
CIO
[EMAIL PROTECTED]

Don't work for recognition, but always do work worthy of recognition.

Maxim Maletsky [EMAIL PROTECTED] wrote

 I think what yo wrote should be working fine for you.

 My way of your code:




 foreach(file($storelist) as $line_num=$line_data) {
 foreach(explode(':', $line) as $key=$val) {
 $val = trim($val); // remove whitespaces around

 // now you are inside each element of your
 multidimentional array
 // combine your rest of the code and work it out the way
 you need it.

 }
 }



 Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

 PHPBeginner.com (Where PHP Begins)
 [EMAIL PROTECTED]
 www.phpbeginner.com


  -Original Message-
  From: Joshua E Minnie [mailto:[EMAIL PROTECTED]]
  Sent: Friday, April 05, 2002 1:07 AM
  To: [EMAIL PROTECTED]
  Subject: [PHP] Explode and Trim
 
  I am parsing through a text file and using explode to convert the
 string to
  an array.  The problem seems to be at the end of the string, when I
 check to
  see if the last element in the array is empty it tells me that it is
 not.
  The problem comes because the last element should be empty because all
 that
  was after the separator was white space.
 
  ---Sample text file---
  AL:123 2nd Ave.:SomeCity:(123) 456-7890:(123) 456-1234:::
  MI:293 3rd St.:Another City:(123) 345-2839:(123) 384-0398:::
  MI:437 4th Ave.:Yet Another City:(123) 283-4839:(123) 458-4843:::
  ---End of text file---
 
  ---Code snippit---
  $stores = file($storelist);
  for($i=0; $icount($stores); $i++) {
//$stores[$i] = trim($stores[$i],\r);
//$stores[$i] = trim($stores[$i],\n);
//$stores[$i] = trim($stores[$i], :);
//$stores[$i] = rtrim($stores[$i]);
echo $stores[$i].brbr\n;
$stores[$i] = explode(:, $stores[$i]);
  }
 
  reset($states);
  while(current($states)  current($stores)) {
for($i=0; $icount($stores); $i++, next($stores)) {
  while($stores[$i][0] != key($states)) {
next($states);
$state = 0;
  }
  if($state==0) {
echo b.$states[$stores[$i][0]]./bbr\n;
$state = 1;
  }
  echo $stores[$i][1]., .$stores[$i][2].brPhone:
  .$stores[$i][3].brFax: .$stores[$i][4].br\n;
  if(!empty($stores[$i][5])) echo Email: .$stores[$i][5].br\n;
  if(!empty($stores[$i][6])) echo Web site:
 .$stores[$i][6].br\n;
  if(!empty($stores[$i][7])  $stores[$i][7] != ) echo
 Additional
  notes: .$stores[$i][7].br\n;
  echo br;
}
  }
  ---End of code snippit---
 
  Here is the URL of where the code is being used:
  www.wildwebtech.com/acs/nuven/stores.php.  The additional notes should
 only
  show up if there were additional notes.
 
  --
  Joshua E Minnie
  CIO
  [EMAIL PROTECTED]
 
  Don't work for recognition, but always do work worthy of
 recognition.
 
 
 
  --
  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] Explode and Trim

2002-04-05 Thread Joshua E Minnie

It works great using the foreach statements, but for some reason couldn't
make it work the other way.  Oh well, no one ever said there was only one
way to do things when programming.  Thanks for your help.

---
Joshua E Minnie
CIO
[EMAIL PROTECTED]

Don't work for recognition, but always do work worthy of recognition.

Maxim Maletsky [EMAIL PROTECTED] wrote:
 I think what yo wrote should be working fine for you.

 My way of your code:




 foreach(file($storelist) as $line_num=$line_data) {
 foreach(explode(':', $line) as $key=$val) {
 $val = trim($val); // remove whitespaces around

 // now you are inside each element of your
 multidimentional array
 // combine your rest of the code and work it out the way
 you need it.

 }
 }



 Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

 PHPBeginner.com (Where PHP Begins)
 [EMAIL PROTECTED]
 www.phpbeginner.com


  -Original Message-
  From: Joshua E Minnie [mailto:[EMAIL PROTECTED]]
  Sent: Friday, April 05, 2002 1:07 AM
  To: [EMAIL PROTECTED]
  Subject: [PHP] Explode and Trim
 
  I am parsing through a text file and using explode to convert the
 string to
  an array.  The problem seems to be at the end of the string, when I
 check to
  see if the last element in the array is empty it tells me that it is
 not.
  The problem comes because the last element should be empty because all
 that
  was after the separator was white space.
 
  ---Sample text file---
  AL:123 2nd Ave.:SomeCity:(123) 456-7890:(123) 456-1234:::
  MI:293 3rd St.:Another City:(123) 345-2839:(123) 384-0398:::
  MI:437 4th Ave.:Yet Another City:(123) 283-4839:(123) 458-4843:::
  ---End of text file---
 
  ---Code snippit---
  $stores = file($storelist);
  for($i=0; $icount($stores); $i++) {
//$stores[$i] = trim($stores[$i],\r);
//$stores[$i] = trim($stores[$i],\n);
//$stores[$i] = trim($stores[$i], :);
//$stores[$i] = rtrim($stores[$i]);
echo $stores[$i].brbr\n;
$stores[$i] = explode(:, $stores[$i]);
  }
 
  reset($states);
  while(current($states)  current($stores)) {
for($i=0; $icount($stores); $i++, next($stores)) {
  while($stores[$i][0] != key($states)) {
next($states);
$state = 0;
  }
  if($state==0) {
echo b.$states[$stores[$i][0]]./bbr\n;
$state = 1;
  }
  echo $stores[$i][1]., .$stores[$i][2].brPhone:
  .$stores[$i][3].brFax: .$stores[$i][4].br\n;
  if(!empty($stores[$i][5])) echo Email: .$stores[$i][5].br\n;
  if(!empty($stores[$i][6])) echo Web site:
 .$stores[$i][6].br\n;
  if(!empty($stores[$i][7])  $stores[$i][7] != ) echo
 Additional
  notes: .$stores[$i][7].br\n;
  echo br;
}
  }
  ---End of code snippit---
 
  Here is the URL of where the code is being used:
  www.wildwebtech.com/acs/nuven/stores.php.  The additional notes should
 only
  show up if there were additional notes.
 
  --
  Joshua E Minnie
  CIO
  [EMAIL PROTECTED]
 
  Don't work for recognition, but always do work worthy of
 recognition.
 
 
 
  --
  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] Having problems deleting an element from an array

2002-04-05 Thread Joshua E Minnie

Can anyone tell me why when stepping through an array and trying to delete a
specific element in the array it deletes not only the one that I want it to
delete, but also the first and last element in the array as well.?

Here is the situation:
I am retrieving information from a text file, dumping it to any array of
arrays.  Then searching for the specific element to delete it.  After the
deletion it should re-write the information back to the text file. Without
the element that I wanted to delete.  But it also deletes the first and last
element.

?
if(!empty($HTTP_POST_VARS)) {
  foreach(file($storelist) as $store = $data) {
foreach($stores[$i] = explode(:, $data) as $key = $val) {
  $stores[$i][$key] = trim($val);
}
$i++;
  }
  $fp = @ fopen($storelist, w) or die(bFatal Error:/b could not open
$storelist for editbr\n);
  foreach($HTTP_POST_VARS as $key = $val) {
unset($stores[$val]);
  }
  for($i=0; $icount($stores); $i++) {
if(!isset($stores[$i])) continue;
fwrite($fp,
$stores[$i][0].:$j:.$stores[$i][2].:.$stores[$i][3].:.$stores[$i][4].
:.$stores[$i][5].:.$stores[$i][6].:.$stores[$i][7].:.$stores[$i][8].
\n);
$j++;
  }
  fclose($fp);
}
unset($HTTP_POST_VARS);
?
--
Joshua E Minnie
CIO
[EMAIL PROTECTED]

Don't work for recognition, but always do work worthy of recognition.



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




[PHP] Explode and Trim

2002-04-04 Thread Joshua E Minnie

I am parsing through a text file and using explode to convert the string to
an array.  The problem seems to be at the end of the string, when I check to
see if the last element in the array is empty it tells me that it is not.
The problem comes because the last element should be empty because all that
was after the separator was white space.

---Sample text file---
AL:123 2nd Ave.:SomeCity:(123) 456-7890:(123) 456-1234:::
MI:293 3rd St.:Another City:(123) 345-2839:(123) 384-0398:::
MI:437 4th Ave.:Yet Another City:(123) 283-4839:(123) 458-4843:::
---End of text file---

---Code snippit---
$stores = file($storelist);
for($i=0; $icount($stores); $i++) {
  //$stores[$i] = trim($stores[$i],\r);
  //$stores[$i] = trim($stores[$i],\n);
  //$stores[$i] = trim($stores[$i], :);
  //$stores[$i] = rtrim($stores[$i]);
  echo $stores[$i].brbr\n;
  $stores[$i] = explode(:, $stores[$i]);
}

reset($states);
while(current($states)  current($stores)) {
  for($i=0; $icount($stores); $i++, next($stores)) {
while($stores[$i][0] != key($states)) {
  next($states);
  $state = 0;
}
if($state==0) {
  echo b.$states[$stores[$i][0]]./bbr\n;
  $state = 1;
}
echo $stores[$i][1]., .$stores[$i][2].brPhone:
.$stores[$i][3].brFax: .$stores[$i][4].br\n;
if(!empty($stores[$i][5])) echo Email: .$stores[$i][5].br\n;
if(!empty($stores[$i][6])) echo Web site: .$stores[$i][6].br\n;
if(!empty($stores[$i][7])  $stores[$i][7] != ) echo Additional
notes: .$stores[$i][7].br\n;
echo br;
  }
}
---End of code snippit---

Here is the URL of where the code is being used:
www.wildwebtech.com/acs/nuven/stores.php.  The additional notes should only
show up if there were additional notes.

--
Joshua E Minnie
CIO
[EMAIL PROTECTED]

Don't work for recognition, but always do work worthy of recognition.



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




[PHP] Browser detection

2002-04-03 Thread Joshua E Minnie

Can anybody tell me why, when running on the same browser, I get 2 different
outputs.

This is the output when I echo $HTTP_USER_AGENT:Mozilla/4.0
(compatible; MSIE 6.0; Windows NT 5.0)

This is the output when I use get_browser():

browser_name_pattern.Mozilla/4\.0.*
parent...Netscape 4.00
browser..Netscape
version..4.00
majorver.4
minorver.00
frames...1
tables...1
cookies..1
backgroundsounds.
vbscript.
javascript...1
javaapplets..1
activexcontrols..
beta.1


I am using IE 6.0 running PHP 4.1.2 binary for Windows.
--
Joshua E Minnie
CIO
[EMAIL PROTECTED]

Don't work for recognition, but always do work worthy of recognition.



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




[PHP] MCAL for Windows

2002-04-03 Thread Joshua E Minnie

Does anybody know where I can find MCAL for Windows?

--
Joshua E Minnie
CIO
[EMAIL PROTECTED]

Don't work for recognition, but always do work worthy of recognition.



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




[PHP] Rollover not functioning

2002-03-22 Thread Joshua E Minnie

Does anyone have any idea why adding PHP into an HTML page would cause a
rollover (not even within the PHP script) to not function?

The thing is, I have done the same thing on various other pages, but this is
the only page that does it.  I tried removing the PHP script from the page,
and the rollover works, but when I add the code back in, it doesn't.  And if
anyone has any ideas as how to minimize the code, they would be appreciated
as well.  Here is the code that was inserted within a cell in a table ..the
rollover is in another cell:



?php
$filename = contact.frm;
if(empty($HTTP_POST_VARS[name])  empty($HTTP_POST_VARS[email]) 
empty($HTTP_POST_VARS[comments])) {
  @ $fp = fopen($filename, r);
  if(!$fp) {
echo pbError:/b could not open b$filename/b for
reading/p\n;
exit;
  }
  $form = fread($fp, filesize($filename));
  fclose($fp);
  $form = str_replace({name}, $HTTP_POST_VARS[name], $form);
  $form = str_replace({email}, $HTTP_POST_VARS[email], $form);
  echo $form;
}
elseif(empty($HTTP_POST_VARS[name]) || empty($HTTP_POST_VARS[email]) ||
empty($HTTP_POST_VARS[comments])) {
  echo p align='center'font color='#FF'bYou must fill out all
information/b/font/p\n;
  @ $fp = fopen($filename, r);
  if(!$fp) {
echo pbError:/b could not open b$filename/b for
reading/p\n;
exit;
  }
  $form = fread($fp, filesize($filename));
  fclose($fp);
  $form = str_replace({name}, $HTTP_POST_VARS[name], $form);
  $form = str_replace({email}, $HTTP_POST_VARS[email], $form);
  echo $form;
}
else {
  $submit = 0;
  $name = $HTTP_POST_VARS[name];
  $body = strip_tags(trim(stripslashes($HTTP_POST_VARS[comments])));
  $body .= \n\nSent: .date(F j, Y  g:i a).\nSender: $name;
  $to = [EMAIL PROTECTED];
  $subject = Wild Zone web contact;
  $headers = From: .$HTTP_POST_VARS[email].\n;
  mail($to,$subject,$body,$headers);
  @ $fp = fopen($filename, r);
  if(!$fp) {
echo pbError:/b could not open b$filename/b for
reading/p\n;
exit;
  }
  $form = fread($fp, filesize($filename));
  fclose($fp);
  $form = str_replace({name}, , $form);
  $form = str_replace({email}, , $form);
  echo p align='center'font color='#FF'Your information has been
successfully transmitted/font/p\n;
  echo $form;
}
?
--
Joshua E Minnie
CIO
[EMAIL PROTECTED]

Don't work for recognition, but always do work worthy of recognition.



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




[PHP] T_STRING, T_VARIABLE, and T_NUM_STRING

2002-03-21 Thread Joshua E Minnie

I keep getting the following error message and I am just wondering what
T_STRING, T_VARIABLE, and T_NUM_STRING mean.

Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or
`T_NUM_STRING' in /home/www/process.php on line 20

--
Joshua E Minnie
CIO
[EMAIL PROTECTED]

Don't work for recognition, but always do work worthy of recognition.



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




[PHP] $HTTP_POST_VARS

2002-03-21 Thread Joshua E Minnie

I need to access a variable on a form that allows multiples.  I have to use
$HTTP_POST_VARS so I need to know how to display the information obtained
from the form.  This is what I am using right now:

?
  reset($HTTP_POST_VARS[interest]);
  while(current($HTTP_POST_VARS[interest])) {
echo strip_tags(trim($HTTP_POST_VARS[interest])).nbsp;nbsp;nbsp;;
next($HTTP_POST_VARS[interest]));
  }
?

Both $HTTP_POST_VARS[interest] and $HTTP_POST_VARS[interest[]] throw
errors.  Any suggestions would be greatly appreciated.


--
Joshua E Minnie
CIO
[EMAIL PROTECTED]

Don't work for recognition, but always do work worthy of recognition.



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




[PHP] Accessing form variables

2002-03-20 Thread Joshua E Minnie

I have a form with a menu which I need multiple select on.  How does PHP
handle this?  I have to use $HTTP_POST_VARS[somevariable] to access
somevariable from the form.

--
Joshua E Minnie
CIO
[EMAIL PROTECTED]

Don't work for recognition, but always do work worthy of recognition.



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




[PHP] Sessions

2002-03-20 Thread Joshua E Minnie

I am kind of confused by this error that I am receiving when I try to logout
of a session.  If somebody could pleae help me out here.

Warning: Cannot send session cache limiter - headers already sent (output
started at /home/www/wildwebtech/cumc/default.php:9) in
/home/www/wildwebtech/cumc/default.php on line 10

Here is the code that is causing the problem.

?
  session_start();

  $result = session_unregister(valid_user);
  session_destroy();
?

--
Joshua E Minnie
CIO
[EMAIL PROTECTED]

Don't work for recognition, but always do work worthy of recognition.



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




[PHP] sessions

2002-03-20 Thread Joshua E Minnie

I am kind of confused by an error I am getting when trying to destroy a
session.  Here is the error that I am receiving along with the code that is
causing the problem.

Warning: Cannot send session cache limiter - headers already sent (output
started at /home/www/wildwebtech/cumc/default.php:9) in
/home/www/wildwebtech/cumc/default.php on line 10

?
  session_start();

  $old_user = $cumc_user;  // store  to test if they *were* logged in
  $result = session_unregister(cumc_user);
  session_destroy();
?

This is the only code on that particular page, I just want to make sure that
when they leave the site via my links that the session is destroyed.

--
Joshua E Minnie
CIO
[EMAIL PROTECTED]

Don't work for recognition, but always do work worthy of recognition.



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




[PHP] Re: help with date formatting

2002-03-18 Thread Joshua E Minnie


Ryan [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hi, I'm trying to create an events page, where it shows the posted
 events.  I enter data using phpmyadmin.  Currently, the ouput is like
 this:

 
 Conference in New York
 2002-03-06

 There is going to be a conference in New York next week.
 

 I'm having trouble with the formatting of the date.  I'm using the type
 date with the function now, so it shows the current date when I post an
 event.  Here is what I would like:

 
 Conference in New York
 Wednesday, March 5th, 2002

 There is going to be a conference in New York next week.
 


If you are using the mktime() to make a UNIX timestamp you could do
something like this:

?
$conftime = mktime($hour, $minute, $seconds, $month, $day, $year);

echo date(l, F jS, Y, $conftime);
?


--
Joshua E Minnie
CIO
[EMAIL PROTECTED]

Don't work for recognition, but always do work worthy of recognition.




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




[PHP] problem with getdate()

2002-03-11 Thread Joshua E Minnie

I am having a problem with the getdate() function.  I don't understand why I
am getting the output that it is giving me.  Here is the code:

$timevalid_ = getdate();
$hours = $timevalid_[hours] + 1;
$minutes = $timevalid_[minutes];
$month = $timevalid_[mon];
$day = $timevaild_[mday];
$year = $timevalid_[year];

$update = mktime($hours, $minutes, 0, $month, $day, $year);

echo \$hours = $hoursBR\n;
echo \$minutes = $minutesBR\n;
echo \$month = $monthBR\n;
echo \$day = $dayBR\n;
echo \$year = $yearBR\n;
echo date(F jS, Y  g:i a,$update);

With this code the output is as follows, but I don't see why it is not
giving me the $day:

$hours = 10
$minutes = 27
$month = 3
$day =
$year = 2002
February 28th, 2002 10:27 am

You can see the code run from my server at
www.wildwebtech.com/php-bin/test/mfmtime.php

Any help that anyone can provide will be greatly appreciated.
--
Joshua E Minnie
CIO
[EMAIL PROTECTED]

Don't work for recognition, but always do work worthy of recognition.



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




[PHP] require v. includes

2002-03-07 Thread Joshua E Minnie

I was just wondering if anyone could tell me when would be the time to
choose require(), require_once(), or include().  I know a little bit about
using each one, but I am just not sure if there is one that is better than
the other in certain situations.

--
Joshua E Minnie
CIO
[EMAIL PROTECTED]

Don't work for recognition, but always do work worthy of recognition.



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




[PHP] Re: require v. includes

2002-03-07 Thread Joshua E Minnie

Thanks for the information, was definitely very helpful in clearing up that
question.

Joshua E Minnie
[EMAIL PROTECTED]

Don't work for recognition, but always do work worthy of recognition. ~
Unknown
Michael Kimsal [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Joshua E Minnie wrote:
  I was just wondering if anyone could tell me when would be the time to
  choose require(), require_once(), or include().  I know a little bit
about
  using each one, but I am just not sure if there is one that is better
than
  the other in certain situations.
 


 For all intents and purposes there's no real difference between the two.


  From the manual:
 require() and include() are identical in every way except how they
 handle failure. include() produces a Warning while require() results in
 a Fatal Error. In other words, don't hesitate to use require() if you
 want a missing file to halt processing of the page. include() does not
 behave this way, the script will continue regardless. Be sure to have an
 appropriate include_path setting as well.

 require_once() should be used in cases where the same file might be
 included and evaluated more than once during a particular execution of a
 script, and you want to be sure that it is included exactly once to
 avoid problems with function redefinitions, variable value
 reassignments, etc.

 include_once() should be used in cases where the same file might be
 included and evaluated more than once during a particular execution of a
 script, and you want to be sure that it is included exactly once to
 avoid problems with function redefinitions, variable value
 reassignments, etc.



 Michael Kimsal
 http://www.phphelpdesk.com
 Taking the ? out of ?php
 734-480-9961




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




[PHP] Arrays/OOP again

2002-03-07 Thread Joshua E Minnie

I am having problem with an array filled with an object.  I am trying to
access it using current($object_array)-object_var.  Here is the line of
code that is giving me the problem, any help that can be provided will be
greatly appreciated.

if((current($retrieved)-beginTime  $morning) 
(current($retrieved)-beginTime  $night))

--
Joshua E Minnie
CIO
[EMAIL PROTECTED]

Don't work for recognition, but always do work worthy of recognition.



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




[PHP] Arrays/OOP

2002-03-06 Thread Joshua E Minnie

This is for anyone who was following this post, I found a work-around for
the problem I was having with my array of objects.

The original code looked like this:

function getEvents($filename) {
//string $filename
  $event_list = array();
  $event_object = new event();
  $i = 0;

   $fp = fopen($filename, r);
  if(!$fp) {
echo pstrongCannot open .$filename. for reading
mode.../strong/p;
exit;
  }
  while(!feof($fp)) {
$temp = fgetcsv($fp, 1024, :);
$event_list[$i] =
$event_object-init($temp[0],$temp[1],$temp[2],$temp[3],$temp[4],$temp[5],$t
emp[6],$temp[7],$temp[8]);
$i++;
  }
  fclose($fp);

  return $event_list;
}

The modification was in how I was loading the array, instead of just putting
$event_list[$i] equal to the object, I pushed it onto the array using
array_push().  Now, it works great without any errors. The modified code
only pertained to the while loop, the modified code looks like this:

while(!feof($fp)) {
  $temp = fgetcsv($fp, 1024, :);
  if(!$temp) break;

$event_object-init($temp[0],$temp[1],$temp[2],$temp[3],$temp[4],$temp[5],$t
emp[6],$temp[7],$temp[8]);
  if(!array_push($event_list, $event_object)) break;
}

Hope this can be of help to someone.



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




[PHP] Arrays/OOP

2002-03-05 Thread Joshua E Minnie

I am relatively new to PHP but have had some background in OOP.  I am having some 
trouble with a method that for a certain class.  The problem is that I can seem to 
read my objects from an array that I am storing them to.  I keep getting the error 
Call to a member function on a non-object.  I have attached the code that contains 
the error, I would appreciate any help that can be provided.

function getEvents($filename) {
//string $filename
  $event_list = array();
  $event_object = new event();
  $i = 0;
  
  @ $fp = fopen($filename, r);
  if(!$fp) {
echo pstrongCannot open .$filename. for reading mode.../strong/p;
exit;
  }
  while(!feof($fp)) {
$temp = fgetcsv($fp, 1024, :);
$event_list[$i] = 
$event_object-init($temp[0],$temp[1],$temp[2],$temp[3],$temp[4],$temp[5],$temp[6],$temp[7],$temp[8]);
$i++;
  }
  fclose($fp);
  
  return $event_list;
}



P.S. Please CC it directly to me, as I will receive the reply faster that way.
 
Joshua E Minnie
CIO
[EMAIL PROTECTED]

Don't work for recognition, but always do work worthy of recognition.



Re: [PHP] Re: Arrays/OOP

2002-03-05 Thread Joshua E Minnie

Michael Kimsal wrote:
 Joshua E Minnie wrote:



while(!feof($fp)) {
  $temp = fgetcsv($fp, 1024, :);
  $event_list[$i] =
$event_object-init($temp[0],$temp[1],$temp[2],$temp[3],$temp[4],$temp[5],$t
emp[6],$temp[7],$temp[8]);
  $i++;
}


 Without seeing more of the code, I can't say for certain, but I suspect
 that instead of $event_object-init you need to call $this-init.  Does
 that do the trick?

 Wait - I looked above.  $event_object = new event().  What is the class
 definition for event?

 Could you send more code?

 Michael Kimsal
 http://www.phphelpdesk.com
 734-480-9961

Attached you will find the class definition.  Thanks in advance..

Joshua E Minnie
CIO
[EMAIL PROTECTED]



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


Re: [PHP] Re: Arrays/OOP

2002-03-05 Thread Joshua E Minnie

Michael Kimsal wrote:
 What version of PHP are you using?  I took the file and it seemed to
 work OK in PHP 4.0.5.

 Michael Kimsal
 http://www.phphelpdesk.com
 734-480-9961

I am currently using PHP 4.1.2.  Maybe it's in the file that I am using for
testing, I have attached the code.

Joshua E Minnie
CIO
[EMAIL PROTECTED]



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


Re: [PHP] Re: Arrays/OOP

2002-03-05 Thread Joshua E Minnie

Michael Kimsal wrote:
 Still works - at least, I'm not getting the error you posted.  Is there 
 something else we may be missing?  What line(s) are causing a problem?
 

On line 21 of the corrected test file that I attached previously.

Joshua E Minnie
[EMAIL PROTECTED]



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