Re: [PHP-DB] [PHP]: session problem

2004-06-24 Thread Matt Matijevich
[snip]
But when I ask the value of 
a registered session variable on another page, it is empty?!?! Does
anyone 
know how this comes? i am using session_start() at every page..
[/snip]

try the $_SESSION array for starage of session variables.

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



Re: [PHP-DB] [PHP]: session problem

2004-06-24 Thread Matt Matijevich
[snip]
i do ($_SESSION['sid']), but the variables remain empty...
[/snip]

If you are using the array forget about session_register. 
http://www.php.net/session_register

Could you post a little code?  That will make this easier to solve.

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



Re: [PHP-DB] [PHP]: session problem

2004-06-24 Thread Matt Matijevich
do you get any output on the second page if you do this? 

?php

session_start();

print 'pre';
print_r($_SESSION);
print '/pre';

if ( isset($_SESSION['logged_in'])){

echo Welcome...;

}else{
  header(location: user.php?action=9);
}
?

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



Re: [PHP-DB] regular expression help

2004-06-24 Thread Matt Matijevich
try this 

$password = 'abcdef'; 

if (preg_match ('/\w\d\w/', $password)) {

   die (You must have a number between 2 letters in your password ...
0-9);

}

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



RE: [PHP-DB] regular expression help

2004-06-24 Thread Matt Matijevich
you only want to check to see if there is at least one digit?

If that is true, this should work:

if(preg_match('/\d/',$password)) {
echo 'password ok';
}

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



RE: [PHP-DB] regular expression help

2004-06-24 Thread Matt Matijevich
[snip]
That does not work either... I can not make the statement fail!!!

I have tried 

$password = 123456;
and
$password = abcdef;

I have change the if statement to what is below and past in all letters
and
it still works?

if (preg_match ('/\d/', $password)) {

   die (You must have a number between 2 letters in your password ...
0-9);

// Larry
[/snip]

sorry, this should be:

if (!preg_match ('/\d/', $password)) {
   die (You must have a number between 2 letters in your password ...
0-9);
}

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



Re: [PHP-DB] help with consecutive numbers in db

2004-06-24 Thread Matt Matijevich
[snip]
The IP's (for example 192.168.1.1) are all in a single field.
[/snip]

If it is a possiblity, I would store each IP in its own row, with a
column in that row being some kind of flag, like: is_issued as a logical
column.

Can you change you db layout or is it set in stone?

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



Re: [PHP-DB] DB and mssql

2004-04-14 Thread Matt Matijevich
[snip]
Hi Matt

Before sending the result set, the mssql extension stores the entire
result set into memory.  However, PHP limits the amount of memory that
can be allocated by a script to 8MB.  So, the query will fail if the
result set is larger than 8MB.  You can change this value in php.ini
with
the memory_limit parameter. So, try increasing it and see if it solves
the
problem.

-- bob
[/snip]

Thanks for the response.

If I was hitting the memory limit, wouldn't php throw me some kind of
error?  Or would it just abort?

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



[PHP-DB] DB and mssql

2004-04-13 Thread Matt Matijevich
I am using PEAR::DB on linux, php 4.3.2, with freetds to access a sql
server database.  I am trying to get more information on the problem,
but everyonece in a while, it seems random, php will stop executing when
I use the query method, php stops executing.  I dont get an error, php
just stops running.  I can echo out things before the query call but not
after.

The query that is running can return large result sets,on the high end
it will return 1 - 15000 rows.

I am am sql server novice so I am not sure where to start looking to
see if the problem is db server side.

I am just wondering if anyone has had this kind of problem before.  I
am not sure if it is something going on with PEAR::DB or if something is
happening with the native php calls to sql server.

I have not tried to do the query without using pear::db, but I am going
to try that to see if I can get the script to error out that way.

Thanks in advance.

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



Re: [PHP-DB] MySql query

2004-03-17 Thread Matt Matijevich
snip
SELECT * FROM sometable


Just that :) (do I hear you slapping your forehead? :)

Bruno Ferreira.
/snip

Thanks for the answers guys.  My problem was I am a mysql novice and
there was a bunch of existing queries that use the WHERE 1 syntax.

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



Re: [PHP-DB] apache/php/mysql - guarenteed DB transaction

2004-02-04 Thread Matt Matijevich
snip
So if a user hits submit on a webpage, the transaction under the hood
completes, no matter if the user hits cancel or his browser dies or
whatever. (Not sure how to even test this condition, but I know it
will
happen)
/snip

Once php has the request, hitting cancel on the browser or a browser
dying will not stop the php script from executing all the way through.

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



Re: [PHP-DB] apache/php/mysql - guarenteed DB transaction

2004-02-04 Thread Matt Matijevich
snip
Actually whether the script runs through to completion depends on the 
'ignore_user_abort' setting.
/snip

wow, guess you learn something everyday.

wish I would have known about that when I wrote a php script with some
terrible (lots of joins, just poorly designed) queries that took down my
webserver :(

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



RE: [PHP-DB] apache/php/mysql - guarenteed DB transaction

2004-02-04 Thread Matt Matijevich
snip
Suppose I have several DB transactions that I want to treat as 1
logical
transaction that I need to complete guarenteed.

For instance, an INSERT to one table, and a DELETE to another, and an
UPDATE
to a third. All need to complete once a user selects submit.

What's the best approach to this scenario?
/snip

this is the pseudo code i would use:

start the transaction
INSERT
DELETE
UPDATE
if everything is ok, commit, else rollback

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



RE: [PHP-DB] using query_strings in sql

2004-01-21 Thread Matt Matijevich
snip
WHAT DOESN'T HAPPEN is that the query_string values DO NOT trump the
default
variables.

so query_string = ?class=Xsection=Yorder=ASC

I can't input these variables : $class,$section,$order into the SQL
statement

SELECT *
FROM classes
WHERE section=$section
ORDER BY $class $order
/snip

I am getting in really late in this disussion so I apologize if I am
off base here but if you have register_globals off

$section, $class, and $order wont get set.

try this:
$section = $_GET['section'];
$class = $_GET['class'];
$order = $_GET['order'];

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



RE: [PHP-DB] using query_strings in sql

2004-01-21 Thread Matt Matijevich
snip
I have no knowledge (YET) of how to prevent sql injection attacks with
php.
/snip

Just yesterday I read a short tutorial on http://www.dotgeek.org on how
to prevent sql injection.

The site is down right now for maintenance otherwise I would have a
direct link to the article for you.

try searching google: php prevent sql injection

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



Re: [PHP-DB] Missing Data in Columns

2003-12-10 Thread Matt Matijevich
snip
Any ideas?
/snip

could you post the code you use to output each table row?

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



Re: [PHP-DB] Web counter question..

2003-12-05 Thread Matt Matijevich
snip
 James Hatridge [EMAIL PROTECTED] 12/5/2003 10:52:52 AM 
Hi all..

I just put up my stamp bulletin on line (issue #100!!). I have a
problem with 
it. The counter that I use counts everyone every time they look at the
site. 
I want a better counter, can you all suggest one? It's got to work with
html 
and php only.
/snip

You would have to either set some kind of permanent cookie once the
user visites your site, so on every request, check for the existence of
that cookie, if it is not there, add 1 to your counter and set the
permanent cookie, if the cookie is there, they have viited the site.

Or you could require the people to sign up for an account to visit the
site.
 

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



Re: [PHP-DB] I 'am not so goooood with php....

2003-12-03 Thread Matt Matijevich
** Low Priority **

snip
  ?php  $tel = 1;
$dbrows = mysql_num_rows($rsSubGroup);
  ?
?php do { ?

  ?php
 if (($tel % 2) 0)
  {echo tr;
   echo td;
   echo $row_rsSubGroup['name'];
   echo /td;
   if $tel == $dbrows{
   echo /tr;
   }
  }
  else
   {
   echo td;
   echo $row_rsSubGroup['name'];
   echo /td;
   echo /tr;
   }
  $tel +=1;

   ?
?php } while ($row_rsSubGroup =
mysql_fetch_assoc($rsSubGroup)); ?
/snip

I think you want to replace  if $tel == $dbrows with if ($tel ==
$dbrows).

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



Re: [PHP-DB] Uploading files

2003-12-02 Thread Matt Matijevich
snip
Warning: move_uploaded_file(./images/exec/Editor.jpg): failed to open
stream: Permission denied in
/home/hudson/misc/dtr8hcj/public_html/changeexec.php on line 24
/snip

php needs permission to write to that directory.  Check the permissons
on ./images/exec/.

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



Re: [PHP-DB] Ifs, ands, or buts

2003-08-27 Thread Matt Matijevich
http://www.php.net/manual/en/language.operators.logical.php

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



Re: [PHP-DB] Simple Referrer

2003-08-27 Thread Matt Matijevich
$_SERVER[HTTP_REFERER]

http://www.php.net/manual/en/reserved.variables.php#reserved.variables.server

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



[PHP-DB] Newbie PHP/MySQL question

2002-12-20 Thread Matt Matijevich
I am just getting started with php an mysql.

When I try to insert a record php get stuck in some kind of loop and
about 25 records are created.  Any help would be greatly appreciated.

Windows 2000 server latest service pack.
PHP 4.2.3
MySql 3.23
IIS 5.0

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