Re: [PHP-DB] eregi sentence

2003-12-01 Thread Nikos Gatsis
Ivan hello
Yoy really help me a lot!
Thanx

- Original Message - 
From: Ivan Fomichev [EMAIL PROTECTED]
To: Nikos Gatsis [EMAIL PROTECTED]
Sent: Sunday, November 30, 2003 6:56 PM
Subject: Re: [PHP-DB] eregi sentence


 Hello Nikos,

 Sunday, November 30, 2003, 10:29:19 AM, you wrote:

 NG Can somebody tell me what is wrong with the following?
 NG $body=eregi_replace(a href=\(.+)\([^]*)(.+)/a, a
href=\\\1\
 NG target=\_blank\ class=\down_txt\strong\\3/strong/a,
$body);

 1) /.+/ is too greedy. You should use something like /[^]+/ or /.+?/
instead
(second is supported only in Perl-compatible regexps). The best
solution
could be /[^']+?/ however.
 2) /a / doesn't match \n after a.

$body = preg_replace(
'#[Aa]\s[^]*?[Hh][Rr][Ee][Ff]\s*=\s*([\'])([^\']+?)\1[^]*?'
.
'([^]*?)/a[^]*?#s',
'A href=\2 target=_blank class=down_txt' .
'strong\3/strong/a',
$body
);

This regexp is not perfect, but I hope it has enough margin of safety,
at
least if your HTML code is more or less correct. E. g., all href values
must be quoted and '', '', '' and ' without special meaning must
be
written as HTML entities.

 -- 
 Best regards,
  Ivanmailto:[EMAIL PROTECTED]

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


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



[PHP-DB] Go to detail page...problem

2003-12-01 Thread Dario
Hi,
I'm doing a PHP MySQL website with Dreamweaver MX, and I'm not much of a
coder myself.
The problem that I have is that when I create the recordset for the detail
page, all the elements in the master page link to the same field in the
detail page (which is the first one of the table).
What's wrong?
Thanks in advance
Dario

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



[PHP-DB] Subject: Dynamic Website Question!

2003-12-01 Thread Neil Smth
Sure, you can try using the xmlhttp methods available in IE5+ or Mozilla / 
Netscape 7 (look up the docs on msdn.microsoft.com and mozilla.org). You 
might try getting away with a smaller screen refresh, or using a hidden but 
self-refreshing iframe and some Javascript

Else, no, you're stuck with the yucky refresh.

However, be aware
1) This is a PHP mailing list not a javascript or XML mailing list and
2) PHP stops after it leaves the server, so anything you do here is client 
side and therefore not a PHP problem.

Cheers - Neil

At 07:58 01/12/2003 +, you wrote:
Message-ID: [EMAIL PROTECTED]
Date: Sun, 30 Nov 2003 19:14:02 +1100 (EST)
From: JeRRy [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
Subject: Dynamic Website Question!
Hi,

I want to have a PHP website that feeds information
off a mysql database.  But generally changes occour
and instead of asking users to refresh the page to get
the updates is there a way to provide the updates
without them needing to refresh the page?
E.G. For like shooping Carts, Chat rooms, etc...

Is there a way in PHP or something to make updates
show up live as they happen instead of the yucky meta
refresh tag in HTML?
Thanks for your time in advance.

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


[PHP-DB] Dreamweaver as PHP editor

2003-12-01 Thread Susi Sloan
I'm just getting into PHP, and have found that as a PHP code editor,
Dreamweaver works pretty well (with the extension I installed). My question
is this, whenever I save an include file with the .inc extension, all of the
color coding goes away, as does the PHP tab on the tool bar. Is there any
way to make Dreamweaver see a .inc file as a PHP file? I looked on all the
menus and in the preferences, but I couldn't find an obvious way to do this.

Thanks!
Susi Sloan
___
GRASS ROOTS SOFTWARE
350 Crown Point Circle, Suite 225
Grass Valley, CA 95945
1-877-274-7277

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



[PHP-DB] Re: Downloading PHP source from a PHP filename, possible?

2003-12-01 Thread Kim Steinhaug
What you do is, if my logic is correct...

Read the entire file in to a variable and send it back to
the browser with another header information, typicall
TEXT.

Just like the force download method for a PDF file, or other
files. This should work very well.

-- 
Kim Steinhaug
---
There are 10 types of people when it comes to binary numbers:
those who understand them, and those who don't.
---


Jerry [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Hi,

 I am not sure if this is at all possible but here
 goes.

 If a file is called blah.php and is only tailored to
 PHP code is it possible to make it downloadable either
 as a file-download or appear as plain text in a
 browser window?

 So if you visit blah.php it would show the PHP page
 normally and work it's functions.  However is it
 possible to include a button on the page and or link
 that will actually download the PHP code to your
 computer?  Keeping the filename as blah.php to save
 as.

 So it uses 1 file not 2, and somehow PHP functions to
 download when a button or link is clicked.  Does that
 make sense?

 If not please reply and I'll try and explain better.

 Thanks for your time.

 Jerry

 http://personals.yahoo.com.au - Yahoo! Personals
 New people, new possibilities. FREE for a limited time.

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



[PHP-DB] Extra blank lines bomb fgetcsv function

2003-12-01 Thread Karen Resplendo
Here is the beginning of a big loop that loads a line at a time from an uploaded 
textfile and then runs validation on each field:
 

//loop through the rows putting the fields into an array

while ($fieldarray = fgetcsv ($handle, $userfile_size, ,)) {
 
 
The problem I am having is that when there is an empty line at the bottom of the txt 
file, my validation tells me it is a bad line, and rejects the file. Is there anyway 
of stopping the loop, or trimming the file of empty lines? Hope I've explained my 
problem correctly.
 
 


-
Do you Yahoo!?
Free Pop-Up Blocker - Get it now

[PHP-DB] multiple queries

2003-12-01 Thread Cameron Showalter
I am trying to pull data out of a mysql db, and am not sure how to begin 
to do this as a newbie...

what I have so far, which surprisingly does work:

?
$db_name = gwsched;

$table_name = dates;

$connection = mysql_connect(x,xx,x) or die (could not 
connect);

$db = @mysql_select_db($db_name, $connection) or die (count not connect 
to data
base);

$sql = SELECT * from dates where store=$store and date=$date;

$result = @mysql_query($sql,$connection) or die(could not execute);

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

$store = $row['store'];
$date = $row['date'];
$flash = $row['flash'];
}
-

ultimately I would like to display data for 3 days on either side of 
this.   

$minus3 - $minus2 - $minus1 - $date - $plus1 - $plus2 - $plus3

plus the data associated with the $minusX and $plusX days, but havent 
been able to find that anywhere. 

$flash3   -  $flash2  - $flash1   - $flash  - $flashp1 - $flashp2 - $flashp3

I attempted to use pre and post increment/decrement, but I can not get 
it pull from the db, it does what it is suppose to do and 
decrement/increments $flash/$date. 

I guess my question is, how do I get $minusX, etc.  to reflect what is 
in my db.

thanks,
cameron


Re: [PHP-DB] multiple queries

2003-12-01 Thread Richard Davey
Hello Cameron,

Tuesday, December 2, 2003, 1:08:19 AM, you wrote:

CS $sql = SELECT * from dates where store=$store and date=$date;

CS ultimately I would like to display data for 3 days on either side of
CS this.   

The following is un-tested, but a quick look over the MySQL manual
should firm this up for you:

SELECT * FROM dates WHERE store='$store' AND date  DATE_SUB(now(),
interval 3 day) AND date  DATE_ADD(now(), interval 3 day)

-- 
Best regards,
 Richardmailto:[EMAIL PROTECTED]

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



[PHP-DB] PG QoQ Execution Time

2003-12-01 Thread David Shadovitz
Two questions on using PHP with PostgreSQL:

1. QoQ
Is there any way to query the results of a previous query?

2. Query execution time
Is there any way to determine a query's execution time?  (I know that I can 
retrieve the time before and after a query and take the difference.)

Thanks.
David Shadovitz
[EMAIL PROTECTED]

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



[PHP-DB] PG QoQ Execution Time

2003-12-01 Thread David Shadovitz
Two questions on using PHP with PostgreSQL:

1. QoQ
Is there any way to query the results of a previous query?

2. Query execution time
Is there any way to determine a query's execution time?  (I know that I can 
retrieve the time before and after a query and take the difference.)

Thanks.
David Shadovitz
[EMAIL PROTECTED]

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



[PHP-DB] Help me please!!!!! (MSSQL + IIS + PHP)

2003-12-01 Thread Edgar Molina
Hi to every one, i have the next problem:

I'm trying to connect to Microsoft SQL Server 6.5 with PHP and Internet
Information Server in Microsoft Windows 2000 Professional, and everything is
ok when i do it via ODBC but i want to include specific functions of SQL
Server that come included with PHP so i decoment the line
extension=mssql.dll in php.ini, and works but the computer becomes very slow
and the memory and processor resources get very high like 300MB of memory
and 90%CPU, even whitout a sql querry, nothing run, all is so slow until i
shut down IIS. PLEASE HELP ME!, i heard that it can be a windows problem
is it true?

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