[PHP] Re: help needed with headers

2002-04-27 Thread Yuri Petro

Try this:

header ("Content-type: text/plain");
header ("Content-disposition: attachment; filename=file.txt");

--
Kind regards,
Yuri.
 www.AceHoster.com  Quality web hosting



"Vins" <[EMAIL PROTECTED]>

> I would like to create a text file that doesn't save to disk but askes me
to
> save the file.
> like when i click on a zip file from a website, ie asks me to save the
file
> to somewhere.
>
> how do i create the file and then tell my browser to ask the user to save
> the file somewhere
>
> ???
>
>



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




[PHP] Re: auto_increment

2002-04-27 Thread Yuri Petro

MySQL:
create table foo (
   id int not null auto_increment primary key,
   state  enum('enabled', 'disabled')
);
PostgreSQL:
create table foo (
   id int not null primary key default nextval('foo_id_seq'),
   state  varchar(8) check (state in ('enabled', 'disabled'))
);
create sequence foo_id_seq;
select setval('foo_id_seq', (select max(id) from foo));

More: http://www.ca.postgresql.org/docs/faq-english.html#4.15.1
-- Kind regards,Yuri.
 www.AceHoster.com  Quality web hosting



"Webmaster" <[EMAIL PROTECTED]>

> I'm using PHP v.4.0.6. and PostgreSQL 7.2.  Does any one know the
> equivilant of auto_increment for postgresSQL?  For example when creating
> a table:
>
> $query = "CREATE table $tablename (id INT UNSIGNED NOT NULL
> AUTO_INCREMENT PRIMARY KEY, firstname TEXT, lastname TEXT, emailaddress
> TEXT, )";
>
> this works fine in MySQL, but I keep getting errors with PostgreSQL.
>
> thanks for any help,
> -Elkan
>



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




[PHP] Re: BBS system

2002-04-27 Thread Yuri Petro

PHPBB is REALLY best! :-)
http://www.phpbb.com/

--
Kind regards,
Yuri.


 www.AceHoster.com  Quality web hosting


"R" <[EMAIL PROTECTED]>
> Hey all,
>
> Just a small q,
> does anybody know of any particular good BBS system that is free?  (I aint
> rich :-(   ) Been to hotscripts.com can you recomend any?
>
> (Actually if i were rich I would not care a damn for
> PHP-MySql-Apache-Java-ASP-JSP hell, i wouldnt even touch a computer,
> would be happy being computer illiterate, would have been partying with a
> lot of babes instead...hehhehe maybe thats why i aint rich...have too
> wicked a mind? )
>
> Ohh well
> Cheers,
> -Ryan.
>



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




[PHP] Re: Stop to fast caching/parsing

2002-04-27 Thread Yuri Petro

http://www.php.net/manual/en/function.flush.php

flush -- Flush the output buffer

Flushes the output buffers of PHP and whatever backend PHP is using (CGI, a web 
server, etc). This effectively tries to push all the output so far to the user's 
browser. 

-- 
Kind regards,
Yuri.

 www.AceHoster.com  Quality web hosting


"Jan Peuker" <[EMAIL PROTECTED]> ???/ ?  ?: 
001801c1edfa$be7ca050$7164a8c0@toshiba">news:001801c1edfa$be7ca050$7164a8c0@toshiba...
> Hi List,
> 
> my Problem is, on the second line of my script I validate a session. If it's
> false, it dies. But in the first line, I require a header(html,body,title
> etc.). Now, if a session fails, my die-Message ends in a "

[PHP] Re: Counter ?

2002-04-27 Thread Yuri Petro

http://www.hotscripts.com/PHP/Scripts_and_Programs/Counters/Text_Based/

--
Kind regards,
Yuri.

 www.AceHoster.com  Quality web hosting

"Cms" <[EMAIL PROTECTED]> ???/ ?  ?:
news:r01050100-0922-9FEB9500593A11D68F37DC65D4C7C8B9@[192.168.0.14]...
>
> I am looking for a php counter,
> that can do this:
> ___
>
> Total Visits: 8,585,230
> Visits Today: 2,521
>
> Today Date: Friday Jan 1, 2002
>
> __
> And the kicker,
> to have the ability to put this counter, on
> any page, to have it count that page sperate
>
>
> Thanks-
> Richard
>



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




[PHP] Re: POST/GET is not working for PHP 4.2.0 on W2K Advanced Server

2002-04-27 Thread Yuri Petro

Just set register_globals to On in php.ini file.

--
Kind regards,
Yuri.

 www.AceHoster.com  Quality web hosting

"Jaseyx" <[EMAIL PROTECTED]> ???/ ?  ?:
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi there,
>
> Anyone else having trouble with vanished form
> posts/gets with the new PHP 4.2.0 on Windows 2000
> Advanced Server?
>
> I re-installed 4.1.1 and everything worked again...
>
> Regs,
> Jason
>
> __
> Do You Yahoo!?
> Yahoo! Health - your guide to health and wellness
> http://health.yahoo.com



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




[PHP] Re: passing variables to scripts

2002-04-28 Thread Yuri Petro

Which version of PHP you're running? May be you need to set register_globals
= On in your php.ini file.

--
Kind regards,
Yuri.

 www.AceHoster.com  Quality web hosting


"Mark Gallagher" <[EMAIL PROTECTED]> ÓÏÏÂÝÉÌ/ÓÏÏÂÝÉÌÁ × ÎÏ×ÏÓÔÑÈ
ÓÌÅÄÕÀÝÅÅ: [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> (yes, newbie - but I *have* tried everything I know, I swear)
>
> I'm trying to write a "comments" system for my site (because I think I
> can).  Basically, the script receives the ID of a particular entry (the
> site is a blog) via "?entry_id=".  It checks to see if there's
> a corresponding text file (.txt) and if so, it prints the
> contents of the text file and invites the user to input a comment.  If
> not, it prints "no comments" and invites the user... yadda yadda.
>
> Now, unless I'm mistaken, passing the arguments are done like so:
> http://www.foo.com/comments.php?entry_id=test
> Right?
>
> Unfortunately, it doesn't work.  That is to say, everything about the
> script works, except recognition of the $entry_id variable.  Something
> as simple as: comments for entry " ?>" returns "comments for entry "".
>
> Saving the text file's URL to a variable:
>  $filename = http://www.foo.com/$entry_id; .txt;
> ?>
>
> Doesn't work either.
>
> I had a semi-hunch (brought on by my own inexperience, no doubt) that
> maybe I had to start a session or something on the referring page. Tried
> that (session_start();), didn't have any effect.  Bah.
>
> Can anyone point out what I'm doing wrong?
>
> TIA
>
> --
> Mark Gallagher
>



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




[PHP] Re: date problem

2002-04-28 Thread Yuri Petro

You can include date formatting function in your SQL statement:
DATE_FORMAT(date,format)
http://www.mysql.com/doc/D/a/Date_and_time_functions.html

--
Kind regards,
Yuri.

 www.AceHoster.com  Quality web hosting


"Nick Wilson" <[EMAIL PROTECTED]> ???/ ?  ?:
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
> Hi all
> I have a field in MySQL db like this: date TIMESTAMP,
> and it looks pretty regular like this: 20020428011911
>
> when I come to use php date("D M Y", $myTimeStamp) though I get
>
> TUE JAN 2038!
>
> I see something in the manual re this date but I'm afraid I still can't
> work it out so some advice/help would be greatly appreciated :-)
>
> - --
> Nick Wilson //  www.explodingnet.com
>
>
>
> -BEGIN PGP SIGNATURE-
> Version: GnuPG v1.0.6 (GNU/Linux)
>
> iD4DBQE8y++SHpvrrTa6L5oRAh3xAJ9lfFdB1VW3KUHCWxnnksN+Uw950QCYpfg6
> OCdApC0Nh/8hi8MYQY3OTQ==
> =FnlM
> -END PGP SIGNATURE-



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




[PHP] Re: Changing field size

2002-04-28 Thread Yuri Petro

"ALTER TABLE works by making a temporary copy of the original table. The
alteration is performed on the copy, then the original table is deleted and
the new one is renamed. This is done in such a way that all updates are
automatically redirected to the new table without any failed updates. While
ALTER TABLE is executing, the original table is readable by other clients.
Updates and writes to the table are stalled until the new table is ready."
http://www.mysql.com/doc/A/L/ALTER_TABLE.html

So, I think your data will be saved.

--
Kind regards,
Yuri.

 www.AceHoster.com  Quality web hosting


"Anthony Rodriguez" <[EMAIL PROTECTED]> ???/ ? 
?:
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I've a VARCHAR(4) field that I want to change to a VARCHAR(6) field.
>
> What would happen to the existing data in MySQL db?
>
> Thanks!
>
> Tony
> ([EMAIL PROTECTED])
>



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




[PHP] Re: NameVirtualHost breaks PHP

2002-04-28 Thread Yuri Petro

Can you indicate Apache settings regarding php and virtualhosts?

--
Kind regards,
Yuri.

 www.AceHoster.com  Quality web hosting


"Greg Blakely" <[EMAIL PROTECTED]> ???/ ?  ?:
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
Hello.

I'm new to this list, though not new to PHP.  I'm hoping that my
question hasn't been answered a thousand times before, and I did at
least search on NameVirtualHost and read all those archived messages
before getting to this point.

I have an Apache web server (1.0.38) that has been peacefully
co-existing with php4 for quite some time.  I've interfaced it to mySQL,
and life was great.

Then, I came up with the brilliant idea to used Named Virtual Hosts
rather than using up all my IP addresses.  I did all according to the
instructions I had, and the "virtual" part of things worked fine.
www.hostone.net showed its proper page, as did www.hosttwo.net.

But  It broke php.  When I go to a php page now, it show's the code
rather than executing it.  I've verified that this behavior happens
across all the web pages, incuding the "main" one that isn't
"virtualized."

Can anyone point me in the right direction?

Thanks in advance.



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




[PHP] Re: Header question

2002-04-28 Thread Yuri Petro

Just replace the last line with:

@mail ($To,$Subject,$Message,"From: $EmailSender\nReply-To:
$EmailSender);

--
Kind regards,
Yuri.

 www.AceHoster.com  Quality web hosting


"Dean Ouellette" <[EMAIL PROTECTED]> ???/ ?  ?:
000e01c1eef4$07cbeb40$0200a8c0@yoda">news:000e01c1eef4$07cbeb40$0200a8c0@yoda...
>
> I have a tell a friend script and got the php script from a friend to
> make it work.  I am a newbie so still do not fully udners stand it.
> Here is the problem, it puts the following at the top of each e-mail:
> X-Mailer: PHP/4.1.2
>
>
> Here is the script:
>
>  $Subject = "Look at this, I think you will like it"; //The Emails
> subject
> $Email[] = "[EMAIL PROTECTED]";
> reset ($Email);
> while (list(, $To) = each ($Email)) {
> @mail ($To,$Subject,$Message,"From: $EmailSender\nReply-To:
> $EmailSender\nX-Mailer: PHP/".phpversion());
> }
>
> ?>
>
>



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




Re: [PHP] Re: NameVirtualHost breaks PHP

2002-04-28 Thread Yuri Petro

You need to specify IP address in NameVirtualHost directive:

NameVirtualHost 127.0.0.1


  DocumentRoot /home/tcrc/www/forum
  ServerName forum.tcrconline.com
  ErrorLog /home/tcrc/logs/error_log
  CustomLog /home/tcrc/logs/access_log combined


--
Kind regards,
Yuri.

>>>> www.AceHoster.com <<<< Quality web hosting


"Greg Blakely" <[EMAIL PROTECTED]> ???/ ?  ?:
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
Yuri Petro asked:




> Can you indicate Apache settings regarding php and virtualhosts?

In the "main" server configuration area, I have:

# The following is for PHP4 (conficts with PHP/FI, below):

  AddType application/x-httpd-php .php4 .php3 .phtml .php
  AddType application/x-httpd-php-source .phps


# The following is for PHP3:

  AddType application/x-httpd-php3 .php3
  AddType application/x-httpd-php3-source .phps


# The following is for PHP/FI (PHP2):

  AddType application/x-httpd-php .phtml


### and the, further on down, there is:

NameVirtualHost *

### and then, under the "VirtualHost" area, I have:


Port 80
AddType application/x-httpd-php .php4 .php3 .phtml .php
AddType application/x-httpd-php-source .phps
ServerAdmin [EMAIL PROTECTED]
DocumentRoot /home/tcrc/www/forum
ServerName forum.tcrconline.com
ErrorLog /home/tcrc/logs/error_log
CustomLog /home/tcrc/logs/access_log combined


###

### By the way, I tried it with and without the "AddType" statements in
the VirtualHost area.



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




[PHP] Re: i cannot pass variables to php script...

2002-05-01 Thread Yuri Petro

Just set register_globals = On in your php.ini file.

--
Kind regards,
Yuri.


 www.AceHoster.com  Quality web hosting



"Efa" <[EMAIL PROTECTED]> ???/ ?  ?:
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi!
> I have a problem with passing variables to php script with simple GET.
> example:
>
> --- hello.html -
> 
> 
> hello
> 
> 
>
>
>
> --- hello.php --
>  printf("arg=$arg");
> ?>
>
>
> output from clicking on the link is:
>
> arg=
>
>
> I should mention that I use mod_userdir and the script/html are lying in
> home directory for the user ( /home/username/public_html/...), and
> URL=http://server/~username/hello.html
>
>
> I am attaching output of phpinfo() and a copy of httpd.conf
> .htaccess file is empty btw.
>
>
> Cheers
>
> --
> /admir efendic, stockholm, sweden
>
>



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




[PHP] Re: mail() says: Warning: Server Error

2002-04-09 Thread Yuri Petro

If you use PHP on Windows you need to configure SMTP settings in php.ini
file.

--
Kind regards,
Yuri.

 www.AceHoster.com  Quality web hosting


"Genesis Designs" <[EMAIL PROTECTED]> ÓÏÏÂÝÉÌ/ÓÏÏÂÝÉÌÁ × ÎÏ×ÏÓÔÑÈ
ÓÌÅÄÕÀÝÅÅ: [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hello,
>
> Evert time I run a mail function it gives me this:
>
> Warning: Server Error
>
> What's wrong here?
> Thanks,
> -Sean
>
> P.S. I use Apache 1.3.23 and have PHP 4.1.1 installed.
>
> _
> MSN Photos is the easiest way to share and print your photos:
> http://photos.msn.com/support/worldwide.aspx
>



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




[PHP] Re: MySQL persistent links

2002-04-09 Thread Yuri Petro

Hello,

You can just put disable_functions=mysql_pconnect in php.ini file.

--
Kind regards,
Yuri.

 www.AceHoster.com  Quality web hosting


"Robert Abbate" <[EMAIL PROTECTED]> ÓÏÏÂÝÉÌ/ÓÏÏÂÝÉÌÁ × ÎÏ×ÏÓÔÑÈ ÓÌÅÄÕÀÝÅÅ:
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi. I'm trying to disable persistent database connections to MySQL, and I
> disabled the php.ini file settings, but for some reason, they can still
> connect with persistent connections. I changed the following settings in
> php.ini:
>
>
> [MySQL]
> mysql.allow_persistent = Off ; allow or prevent persistent link
> mysql.max_persistent = 0 ;
>
> I'm using Linux Mandrake 8.1 system.
>
> Anyone run into this problem before?
>
> Thanks!
> Robert
>
>



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




[PHP] Re: asking about .exe file

2002-04-09 Thread Yuri Petro

Yes. system() - Execute an external program and display output.

--
Kind regards,
Yuri.

 www.AceHoster.com  Quality web hosting


"Wong" <[EMAIL PROTECTED]> ÓÏÏÂÝÉÌ/ÓÏÏÂÝÉÌÁ × ÎÏ×ÏÓÔÑÈ ÓÌÅÄÕÀÝÅÅ:
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
Can php execute .exe file under dos and view result on the browser ?

Rizal




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




[PHP] Re: Downloading files

2002-04-09 Thread Yuri Petro

When you serve a document from a Web server, you might want to immediately
prompt the user to save the file directly to the user's disk, without
opening it in the browser. However, for known MIME (Multipurpose Internet
Mail Extensions) types such as Microsoft Word ("application/ms-word"), the
default behavior is to open the document in Internet Explorer.

You can use the content-disposition header to override this default
behavior. Its format is:

Content-disposition: attachment; filename=fname.ext
http://support.microsoft.com/support/kb/articles/Q260/5/19.ASP

--
Kind regards,
Yuri.

 www.AceHoster.com  Quality web hosting


"Declan Kenny" <[EMAIL PROTECTED]> ÓÏÏÂÝÉÌ/ÓÏÏÂÝÉÌÁ × ÎÏ×ÏÓÔÑÈ
ÓÌÅÄÕÀÝÅÅ: [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi folks,
>
> Ok I am trying to make a download area for files (including word files).
> How do I force a download of a word document rather than have it opening
in
> IE?
>
> Declan
>
>



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




[PHP] Re: string reverse ??

2002-04-09 Thread Yuri Petro

strrev -- Reverse a string
http://www.php.net/manual/en/function.strrev.php

--
Kind regards,
Yuri.

 www.AceHoster.com  Quality web hosting

"Scott Fletcher" <[EMAIL PROTECTED]> ÓÏÏÂÝÉÌ/ÓÏÏÂÝÉÌÁ × ÎÏ×ÏÓÔÑÈ ÓÌÅÄÕÀÝÅÅ:
news:[EMAIL PROTECTED]...
> Hi!
>
> Is there a PHP code or function that would reverse the data in the
> string?
>
> THanks,
>  Scott
>
>



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




[PHP] Re: order of evaluation

2002-04-09 Thread Yuri Petro

I think that set_password() will not be processed.

--
Kind regards,
Yuri.

 www.AceHoster.com  Quality web hosting

"Erik Price" <[EMAIL PROTECTED]> ???/ ?  ?:
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> A quick question about evaluation:
>
> I have the following line in the middle of a large if/elseif/else
> statement:
>
> elseif (!empty($_POST['newpassword']) &&
> !$user->set_password($_POST['newpassword']))
>
> I am simply wondering whether or not the set_password() method will be
> processed if the first test, !empty(), fails.  I certainly don't want to
> set the password to an empty string!  (Actually the method requires at
> least 8 characters or it fails, but I was wondering for the sake of
> curiosity what would happen.)
>
>
> Thank you,
>
> Erik
>
>
>
>
>
> 
>
> Erik Price
> Web Developer Temp
> Media Lab, H.H. Brown
> [EMAIL PROTECTED]
>



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