RE: [PHP-DB] Open file dialog box to save static file

2002-05-12 Thread Peter Lovatt

Hi

you can use php to write the html to a file, rather than having to do it all
manually.

Look at

fopen()

Not sure if this is exactly what's needed, but it might be.


HTH

Peter

---
Excellence in internet and open source software
---
Sunmaia
www.sunmaia.net
[EMAIL PROTECTED]
tel. 0121-242-1473
---

 -Original Message-
 From: Howard Picken [mailto:[EMAIL PROTECTED]]
 Sent: 12 May 2002 10:05
 To: [EMAIL PROTECTED]
 Subject: [PHP-DB] Open file dialog box to save static file


 I'm looking for a way to do the following

 I've created a php/mysql site for my wife for various
 database lists she has.

 She uses PHP locally on our on web server to add/manage
 entries but a lot of the pages need to be static and uploaded
 to a specific site (no PHP/MySQL).

 So I've give her a link that calls another php page to generate
 and view the static page in the format she requires.  She then has to
 view the source of that page hilight and copy it over the top
 of the old page on her PC, then upload it to the site.

 Now... what I would to be able to do is instead of her having to
 view source etc. I would like to be able to call up a Windows
 file save dialog box (maybe even going staright to the correct folder)
 so that the file can just be saved.

 I can't find anything in the PHP manual about this.  Anyone done it
 or have any ideas?

 Howard



 --
 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] Re: Easy one for you guru's :-)

2002-05-12 Thread Jason Morehouse

Here is a simple cart, but should give you the idea.

Cheers!
-J

?
switch($action) {
 # Add to cart
 case 'add':   
$_SESSION['cart'][$id] = array('name'=$name,'price'=$price,'qty'=$qty);
break;

 # Remove from cart   
 case 'remove':
# Remove item
unset($_SESSION['cart'][$id]);
break;
}

# Show cart contents if any
if (count($_SESSION[cart])  0) {
print Cart contents:;
foreach($_SESSION[cart] as $id = $value) {
print li $value[qty] $value[name] (@\$$value[price])br;
$total += $value[price] * $value[qty];
}
print Total: \$$totalhrbr;
}

# a product
$id = 101; $name = 'beer'; $price = '3.15';
?  
form action=?=$PHP_SELF?  
pQty: input type=textbox name=qty size=3 value=1br
Product: ?=$name?br
Price: $?=$price? NZDbr
input type=radio name=action value=add checked Add
input type=radio name=action value=remove Remove 
input type=submit value=OK
/p
input type=hidden name=id value=?=$id?
input type=hidden name=name value=?=$name?
input type=hidden name=price value=?=$price?
/form 
?
On Sun, 12 May 2002 06:02:39 +1200, Dave Carrera wrote:

 Hi All
 
 
 
 Can someone breakdown the logic of adding and subtracting products to a
 shopping cart using sessions.
 
 
 
 I can't quite get the logic so something in plain English would help
 very much.
 
 
 
 Any helpful advice, pointers or even code examples are very much
 appreciated.
 
 
 
 Thank you fully in advance for any help you may give.
 
 
 
 Dave C
 

-- 
.--- .- ... --- -. /  -- --- .-. .  --- ..- ... .

 Jason Morehouse
 [EMAIL PROTECTED]
  
 Netconcepts LTD
 Auckland, New Zealand

 - Linux: because rebooting is for adding hardware.

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




RE: [PHP-DB] Open file dialog box to save static file

2002-05-12 Thread Howard Picken

No that wouldn't work because the formatted page looks
quite different from the page she uses for admin.

I've been looking for some samples for fopen() coding,
cause I'm relatively new to this PHP game, I think
I've found an example that might be useful though so
I'll play around a bit and see what I can learn.

Thanks Peter

---
Hi

Just occurred to me - can you just use the browser to 'Save page as' and
change the file name to page.htm instead of page.php?

Peter

---
Excellence in internet and open source software
---
Sunmaia
www.sunmaia.net
[EMAIL PROTECTED]
tel. 0121-242-1473
---

 -Original Message-
 From: Howard Picken [mailto:[EMAIL PROTECTED]]
 Sent: 12 May 2002 10:05
 To: [EMAIL PROTECTED]
 Subject: [PHP-DB] Open file dialog box to save static file


 I'm looking for a way to do the following

 I've created a php/mysql site for my wife for various
 database lists she has.

 She uses PHP locally on our on web server to add/manage
 entries but a lot of the pages need to be static and uploaded
 to a specific site (no PHP/MySQL).

 So I've give her a link that calls another php page to generate
 and view the static page in the format she requires.  She then has to
 view the source of that page hilight and copy it over the top
 of the old page on her PC, then upload it to the site.

 Now... what I would to be able to do is instead of her having to
 view source etc. I would like to be able to call up a Windows
 file save dialog box (maybe even going staright to the correct folder)
 so that the file can just be saved.

 I can't find anything in the PHP manual about this.  Anyone done it
 or have any ideas?

 Howard



 --
 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] Client IP

2002-05-12 Thread Hayan AL Mamoun

Dear all,
I'm using the $REMOTE_ADD variable to get the visitor IP address, but when a
visitor access my website throught a proxy server I get always the same ip
of that proxy server.
Is there a way to get the unique IP of each users???

bst rgds
Hayan


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




[PHP-DB] Upcoming event script

2002-05-12 Thread Andrew

I'm sorta new at php, as most of my experience is in ASP...so I need a
little help.

I am making a next upcoming event script. Basically, I want to be able to
put into mysql a description of the even and a date where the posting should
start, and I want to be able to make it show the most recently passed post
date. So in other words, if today is June 1 2002, and I have 3 records with
post dates of May 28, March 22, and June 13 of that year, I want it to show
the May one. How do I sort this? I know that in ASP it would be SELECT text
FROM events WHERE datenow()  SORT BY date DESC, but how do I do it
in php?




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




Re: [PHP-DB] Client IP

2002-05-12 Thread Jason Wong

On Sunday 12 May 2002 21:49, Hayan AL Mamoun wrote:
 Dear all,
 I'm using the $REMOTE_ADD variable to get the visitor IP address, but when
 a visitor access my website throught a proxy server I get always the same
 ip of that proxy server.
 Is there a way to get the unique IP of each users???

If someone connects through a proxy then you might be able to use 
$HTTP_X_FORWARDED_FOR, but that depends on whether the proxy gives that info.

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


/*
Today you'll start getting heavy metal radio on your dentures.
*/


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




Re: [PHP-DB] Syncing two tables in mysql

2002-05-12 Thread Jason Wong

On Sunday 12 May 2002 13:37, Thomas \omega\ Henning wrote:
 And how can i use it?

I suppose the manual will have full details.

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


/*
Whenever I feel like exercise, I lie down until the feeling passes.
*/


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




Re: [PHP-DB] Client IP

2002-05-12 Thread Sebastian Tschiatschek

Take a look at the following page:
http://www.cgsa.net/php/identifierShow.php

The script for getting the original ip-address is quite good.

hth
Sebastian

--
Tschiatschek Sebastian, [EMAIL PROTECTED] | System Consulting
Graz, AUSTRIA  / High Availability/Cluster
Mobile: +43 676 84552713  / Web Development
Fax: +43 316 428896  / Unix  Network Administration



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




[PHP-DB] Date problem

2002-05-12 Thread its me

i get $postdate from my mysql database,the problem is that i want to increase that 
date by 6 months??
its stored in mysql as date field





-
Express yourself with a super cool email address from BigMailBox.com.
Hundreds of choices. It's free!
http://www.bigmailbox.com
-

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




RE: [PHP-DB] Date problem

2002-05-12 Thread Pierre-Alain Joye

 i get $postdate from my mysql database,the problem is that i want 
 to increase that date by 6 months??
 its stored in mysql as date field
http://www.mysql.com/doc/D/a/Date_and_time_functions.html

check DATE_ADD :)

hth
pa


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




[PHP-DB] Re: Upcoming event script

2002-05-12 Thread David Robley

In article [EMAIL PROTECTED], 
[EMAIL PROTECTED] says...
 I'm sorta new at php, as most of my experience is in ASP...so I need a
 little help.
 
 I am making a next upcoming event script. Basically, I want to be able to
 put into mysql a description of the even and a date where the posting should
 start, and I want to be able to make it show the most recently passed post
 date. So in other words, if today is June 1 2002, and I have 3 records with
 post dates of May 28, March 22, and June 13 of that year, I want it to show
 the May one. How do I sort this? I know that in ASP it would be SELECT text
 FROM events WHERE datenow()  SORT BY date DESC, but how do I do it
 in php?

It depends on the column type you use to store your dates; have a look at 
the date functions in Mysql, and also have a look at LIMIT which will 
allow you to return just one record from a SELECT.

I assume you are aware of the mysql functions in PHP so I won't go into 
them.


-- 
David Robley
Temporary Kiwi!

Quod subigo farinam

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




[PHP-DB] Word Count, rounding and missing zeros

2002-05-12 Thread Kim Kohen

G'day All,

I'm using php to query a mysql db and I need to display a word count from
one of the columns and multiply it to get a quote.

So far I have this:

$thewords = count(split ( ,$adtext));
$thequote = round(($thewords * .78),2);

In an example with 35 words it returns 27.3 but I'd like it to say 27.30. If
the total doesn't end in a zero it displays fine.

Is there a way to force the zero to display?

Cheers and thanks

kim


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




[PHP-DB] Link for next db record

2002-05-12 Thread Jennifer Downey

Hi all,

Wondering if you could help or point me to a tut  where I can use a link to
get the next record in the db?

Like a href='php.php'Previous record/aa href='php.php'Next record/a

How do I go about doing this.

Thanks
Jennifer

--
The sleeper has awaken


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.351 / Virus Database: 197 - Release Date: 4/19/2002



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




RE: [PHP-DB] Link for next db record

2002-05-12 Thread Beau Lebens

jen,
assuming you are currently looking at a page which is something like
php.php?record=3, then you should be able to just do

a href='php.php?record=?php echo ($record-1) ?'Previous record/aa
href='php.php?php echo ($record+1) ?'Next record/a

and then on the php.php page, you would obviously being grabbing something
from the database using a unique identifier or similar.

one gotcha to be careful of - if there is a chance that your id field will
have a gap in it (ie. not be perfectly consecutive) then you should make
your query something like

SELECT * FROM table LIMIT $record, 1

rather than 

SELECT * FROM table WHERE id='$record'

Since that takes them in whatever order, but only SELECTs from $record and
gets 1 record.

HTH

Beau


// -Original Message-
// From: Jennifer Downey [mailto:[EMAIL PROTECTED]]
// Sent: Monday, 13 May 2002 1:14 PM
// To: [EMAIL PROTECTED]
// Subject: [PHP-DB] Link for next db record
// 
// 
// Hi all,
// 
// Wondering if you could help or point me to a tut  where I 
// can use a link to
// get the next record in the db?
// 
// Like a href='php.php'Previous record/aa 
// href='php.php'Next record/a
// 
// How do I go about doing this.
// 
// Thanks
// Jennifer
// 
// --
// The sleeper has awaken
// 
// 
// ---
// Outgoing mail is certified Virus Free.
// Checked by AVG anti-virus system (http://www.grisoft.com).
// Version: 6.0.351 / Virus Database: 197 - Release Date: 4/19/2002
// 
// 
// 
// -- 
// 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