[PHP] Passing Serialized Array via Hidden field

2003-07-21 Thread aka MacGuru
Hi,

I am need to pass serialized assotiative array via form hidden field 
(not GET or POST). In order to do it, I did the following: 
urlencode(serialize($my_array)). However, after retrieving data from 
hidden field and unserialize I've got junk.

Someone can explain me what I did wrong?

Also, do I need to do addslashes/stripslashes with serialized (or 
encoded ?) data?

Thanks in advance for any suggestion.

*
*   Best Regards   ---   Andrei Verovski
*
*   Personal Home Page
*   http://snow.prohosting.com/guru4mac
*   Mac, Linux, DTP, Development, IT WEB Site
*
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: Passing Serialized Array via Hidden field

2003-07-21 Thread Sam Baum
am Monday 21 July 2003 09:24 schrieb Andrei Verovski:

> I am need to pass serialized assotiative array via form hidden field
> (not GET or POST). 

What does this mean? If you dont use GET or POST your form cant be
submitted.

> In order to do it, I did the following:
> urlencode(serialize($my_array)). However, after retrieving data from
> hidden field and unserialize I've got junk.

Just guessing: tried it w/o urlencode?


Sam

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



Re: [PHP] Passing Serialized Array via Hidden field

2003-07-21 Thread Mirek Novak
Andrei Verovski (aka MacGuru) napsal(a):
Hi,

I am need to pass serialized assotiative array via form hidden field 
(not GET or POST). In order to do it, I did the following: 
urlencode(serialize($my_array)). However, after retrieving data from 
hidden field and unserialize I've got junk.

Someone can explain me what I did wrong?

Also, do I need to do addslashes/stripslashes with serialized (or 
encoded ?) data?

Thanks in advance for any suggestion.
try to encodedata with base64_encode http://cz.php.net/base64-encode
and retrieved data base64_decode
Ha :) here http://cz.php.net/serialize - in the wiki it is already said :)
--
Mirek Novak
jabberID: [EMAIL PROTECTED]
ICQ: 119499448
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] PHP 5 and COM problem

2003-07-21 Thread Aaron
I just updated my binaries to their PHP 5 counterparts (from 
http://kromann.info/php4.php) and im getting issues with COM.

The following line:

$foo=new COM("GnucDNA.Core");

Generates this error:

Fatal error: Class 'com' not found in  on line 

The COM object has been registered and if it means anything im a PHPGTK 
developer. Any help appreicated.

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


[PHP] regex help?

2003-07-21 Thread John Herren
Can't seem to get this to work...

trying to yank stuff xxx from
xxx
and stuff yyy from

 yyy

preg_match(" (.*)$|i", $l, $regs);

works for the second example, even though it isn't the correct way, but 
nothing works for for me for the first example.

Any help is appreciated!

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


[PHP] regex help?

2003-07-21 Thread John Herren
Can't seem to get this to work...

trying to yank stuff xxx from
xxx
and stuff yyy from

 yyy

preg_match("| (.*)$|i", $l, $regs);

works for the second example, even though it isn't the correct way, but 
nothing works for for me for the first example.

Any help is appreciated!

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


[PHP] Re: Mail From option in PHP.ini

2003-07-21 Thread Ivo Fokkema
Hi,

Paul is right, you can't change the Return-Path header. On a windows server
you could use the 'sendmail_from' setting in php.ini, but that doesn't work
on Linux/Unix. Also, the -f 5th argument of the mail() function does not
function with safe_mode on in php. It also generates a
X-Authentication-error in the emailheader (for me, at least) and I am told
it can lead to dangerous security problems.

I gave up some time ago to try and fix this problem. When my emails don't
reach the target because visitors don't fill in their correct emailaddress,
I won't receive any delivery errors. I used Reply-To, Error-To and whatever
more, but I couldn't fix it. Maybe something can be added to a later release
of PHP to fix this? I for one would be extremely happy with that.

--
[Win2000 | Apache/1.3.23]
[PHP/4.2.3 | MySQL/3.23.53]

Ivo Fokkema
PHP & MySQL programmer
Leiden University Medical Centre
Netherlands


"Brian S. Drexler" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Ok, I want to specify who the mail is coming from by using the
sendmail_path
> option in the PHP.ini.  I've added the [EMAIL PROTECTED] to it, but I want
> to be able to dynmaically change [EMAIL PROTECTED] to [EMAIL PROTECTED] or
> whatever else.  Anyone have any ideas how I can do this?  I'm pulling the
> e-mail I'd like to change it to from a MySQL database but can I rewrite
the
> php.ini file on the fly or am I stuck.  Any help is greatly appreciated.
> Thanks!
>
> Brian
>



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



Re: [PHP] Re: Passing Serialized Array via Hidden field

2003-07-21 Thread aka MacGuru
On Monday, Jul 21, 2003, at 10:38 Europe/Helsinki, Sam Baum wrote:

am Monday 21 July 2003 09:24 schrieb Andrei Verovski:

I am need to pass serialized assotiative array via form hidden field
(not GET or POST).
What does this mean? If you dont use GET or POST your form cant be
submitted.
I am need to pass serialized assotiative arrays (qty of 3) TO form 
without GET, using hidden fields, but of course, I will use POST to 
acquire form data.

In order to do it, I did the following:
urlencode(serialize($my_array)). However, after retrieving data from
hidden field and unserialize I've got junk.
Just guessing: tried it w/o urlencode?
Yes, I did. I've got junk on my web page, because of special chars and 
sequences in "serialized" data.

*
*   Best Regards   ---   Andrei Verovski
*
*   Personal Home Page
*   http://snow.prohosting.com/guru4mac
*   Mac, Linux, DTP, Development, IT WEB Site
*
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Passing Serialized Array via Hidden field

2003-07-21 Thread Jacob Vennervald Madsen
Just tried it out and you should use htmlspecialchars() instead of
urlencode(). When you put it in a hidden field the browser is
responsable for urlencoding the data.

Jacob

On Mon, 2003-07-21 at 09:24, Andrei Verovski wrote:
> Hi,
> 
> I am need to pass serialized assotiative array via form hidden field 
> (not GET or POST). In order to do it, I did the following: 
> urlencode(serialize($my_array)). However, after retrieving data from 
> hidden field and unserialize I've got junk.
> 
> Someone can explain me what I did wrong?
> 
> Also, do I need to do addslashes/stripslashes with serialized (or 
> encoded ?) data?
> 
> Thanks in advance for any suggestion.
> 
> 
> *
> *   Best Regards   ---   Andrei Verovski
> *
> *   Personal Home Page
> *   http://snow.prohosting.com/guru4mac
> *   Mac, Linux, DTP, Development, IT WEB Site
> *
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
-- 
Venlig hilsen / Best regards,
Jacob Vennervald
System Developer
Proventum Solutions ApS
Tuborg Boulevard 12
2900 Hellerup
Denmark
Phone:  +45 36 94 41 66
Mobile: +45 61 68 58 51



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



Re: [PHP] Sending email with the windows version of php

2003-07-21 Thread Ivo Fokkema
> > hello,
> >
> > My client is wanting to transfer their web site from a system that uses:
freebsd, apache, mysql and php, to a windows based hosting service.
> >
> Did you tell them this is a bad idea.
:)

> > So I was wondering if the Windows version of PHP sends e-mail with the
same commands as Sendmail or do I have to re-write the scripts. Or can you
tell me what form of email sending windows would use.
> >
> if you use the php mail command, you shouldn't have any problems.  In
> the unix version the mail command uses sendmail where the windows
> version connects to a smtp server and sends the message its self.
You would need to set 'SMTP' and 'sendmail_from' in your php.ini. The
'sendmail_path' doesn't work for Windows, so you can leave that blank.

Nothing else changes then...

--
[Win2000 | Apache/1.3.23]
[PHP/4.2.3 | MySQL/3.23.53]

Ivo Fokkema
PHP & MySQL programmer
Leiden University Medical Centre
Netherlands



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



[PHP] Re: mail function

2003-07-21 Thread Ivo Fokkema
> I put this PHP script on web server:
>
>   if (mail("[EMAIL PROTECTED]", "brati", "peda", "From: Peda")== TRUE)
> print("U redu je");
>  else
> print("Greska");
> ?>
>
> But It seems that mail function doesn't work. I don't get any e-mail.
>
> Can anyone tell me what is wrong.

Does mail() return true? I mean, do you get printed "U redu je"? If so, your
email should've been sent by PHP.

You are really missing a bunch of headers. I'm not sure if this is your
problem, but I think it's not a bad idea to include more headers, also
because more and more ISP's add some kind of spamfilter which might drop
your email. So maybe by adding more headers, you can solve this.

I use this:

$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: text/plain; charset=iso-8859-1\r\n";
$headers .= "X-Priority: 3\r\n";
$headers .= "X-MSMail-Priority: Normal\r\n";
$headers .= "X-Mailer: PHP/".phpversion()."\r\n";
$headers .= "From: Name <[EMAIL PROTECTED]>\r\n";

$body = "Whatever is in your email";

$to = "Name <[EMAIL PROTECTED]>";
$check_mail = mail($to, "Subject", $body, $headers);

--
[Win2000 | Apache/1.3.23]
[PHP/4.2.3 | MySQL/3.23.53]

Ivo Fokkema
PHP & MySQL programmer
Leiden University Medical Centre
Netherlands



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



Re: [PHP] Re: mail function

2003-07-21 Thread Chris Hayes
At 10:39 21-7-03, you wrote:
> I put this PHP script on web server:
>
>   if (mail("[EMAIL PROTECTED]", "brati", "peda", "From: Peda")== TRUE)
> print("U redu je");
>  else
> print("Greska");
> ?>
>
> But It seems that mail function doesn't work. I don't get any e-mail.
>
> Can anyone tell me what is wrong.
Does mail() return true? I mean, do you get printed "U redu je"? If so, your
email should've been sent by PHP.
You are really missing a bunch of headers. I'm not sure if this is your
problem, but I think it's not a bad idea to include more headers, also
because more and more ISP's add some kind of spamfilter which might drop
your email. So maybe by adding more headers, you can solve this.
I use this:

$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: text/plain; charset=iso-8859-1\r\n";
$headers .= "X-Priority: 3\r\n";
$headers .= "X-MSMail-Priority: Normal\r\n";
$headers .= "X-Mailer: PHP/".phpversion()."\r\n";
$headers .= "From: Name <[EMAIL PROTECTED]>\r\n";
$body = "Whatever is in your email";

$to = "Name <[EMAIL PROTECTED]>";
$check_mail = mail($to, "Subject", $body, $headers);
When PHP sends an email to a non existing email address such as 
[EMAIL PROTECTED], the warning mail you normally get returned often does not 
arrive in your mailbox. Therefore I add two additional headers:

."Reply-To: [EMAIL PROTECTED]"
."Return-path: <[EMAIL PROTECTED]"
and now I do get the notification mail when mail bounces.



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


[PHP] Re: mail function

2003-07-21 Thread Peda
Thank you!!!
Headers solved my problem.



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



[PHP] Help?

2003-07-21 Thread chenqi1
I installed apache1.3.12 as the web server and php5 beta version,I write a
test.html and test.php like this:
//test.htm


Name:


//test.php

the same source works well with php4 and apache 1.3.27
but it doesn't work well in my new enviroment, until I modified test.php
like this
//new test.php


who can tell me which one cause this problem,Is the version php5 not
satisfy or the apache 1.3.12?


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



Re: [PHP] Re: mail function

2003-07-21 Thread Ivo Fokkema
> >Does mail() return true? I mean, do you get printed "U redu je"? If so,
your
> >email should've been sent by PHP.
> >
> >You are really missing a bunch of headers. I'm not sure if this is your
> >problem, but I think it's not a bad idea to include more headers, also
> >because more and more ISP's add some kind of spamfilter which might drop
> >your email. So maybe by adding more headers, you can solve this.
> >
> >I use this:
> >
> >$headers = "MIME-Version: 1.0\r\n";
> >$headers .= "Content-Type: text/plain; charset=iso-8859-1\r\n";
> >$headers .= "X-Priority: 3\r\n";
> >$headers .= "X-MSMail-Priority: Normal\r\n";
> >$headers .= "X-Mailer: PHP/".phpversion()."\r\n";
> >$headers .= "From: Name <[EMAIL PROTECTED]>\r\n";
> >
> >$body = "Whatever is in your email";
> >
> >$to = "Name <[EMAIL PROTECTED]>";
> >$check_mail = mail($to, "Subject", $body, $headers);
>
> When PHP sends an email to a non existing email address such as
> [EMAIL PROTECTED], the warning mail you normally get returned often does not
> arrive in your mailbox. Therefore I add two additional headers:
>
>  ."Reply-To: [EMAIL PROTECTED]"
>  ."Return-path: <[EMAIL PROTECTED]"
>
> and now I do get the notification mail when mail bounces.
That's funny, because I always had that problem, too. By adding Reply-To and
Return-path, it did not fix my problem. Boucing emails never got back to me.
Return-path was overwritten by my hostingserver to '[EMAIL PROTECTED]' and Reply-To
was apparently ignored by the server bouncing the email. Do you think
servers differ in this a lot?

--
[Win2000 | Apache/1.3.23]
[PHP/4.2.3 | MySQL/3.23.53]

Ivo Fokkema
PHP & MySQL programmer
Leiden University Medical Centre
Netherlands



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



Re: [PHP] Help?

2003-07-21 Thread Ryan Gibson
See archive posts about register_globals which came in php 4.1 (I think) if
you don't want to change your scripts you can turn off register_globals in
the .htaccess or php.ini files

On 21/7/03 10:34 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:

> I installed apache1.3.12 as the web server and php5 beta version,I write a
> test.html and test.php like this:
> //test.htm
> 
> 
> Name:
> 
> 
> //test.php
>  echo "Hello!".$name ;
> ?>
> the same source works well with php4 and apache 1.3.27
> but it doesn't work well in my new enviroment, until I modified test.php
> like this
> //new test.php
>  echo "Hello!".$_POST['name'] ;
> ?>
> 
> who can tell me which one cause this problem,Is the version php5 not
> satisfy or the apache 1.3.12?
> 

Ryan Gibson
---
[EMAIL PROTECTED]


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



[PHP] Re: Help?

2003-07-21 Thread Ivo Fokkema
<[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I installed apache1.3.12 as the web server and php5 beta version,I write a
> test.html and test.php like this:
> //test.htm
>
> 
> Name:
> 
> 
> //test.php
>echo "Hello!".$name ;
> ?>
> the same source works well with php4 and apache 1.3.27
> but it doesn't work well in my new enviroment, until I modified test.php
> like this
> //new test.php
>echo "Hello!".$_POST['name'] ;
> ?>
>
> who can tell me which one cause this problem,Is the version php5 not
> satisfy or the apache 1.3.12?
Check your php.ini for this setting : 'register_globals'. With your new
installation, it is set to off, causing $_POST['name'] (the original
variable!) not to be registered to $name. With register_globals set to on,
you can use your first script.

I want to warn you though, PHP depricates the use of register_globals = On,
so it would be recommendable to use your modified script and keep coding
using $_POST, $_GET and these kind of global variables.

--
[Win2000 | Apache/1.3.23]
[PHP/4.2.3 | MySQL/3.23.53]

Ivo Fokkema
PHP & MySQL programmer
Leiden University Medical Centre
Netherlands



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



[PHP] SQL select

2003-07-21 Thread Jiří Němec
heloo,

i have got a MySQL table:

id_comp id_goods type

cooler aa1256 n
cooler aa1255 n
cooler aa1317 f
cooler aa1196 n

cpu cpu183 n
cpu cpu177 f
cpu cpu190 n

gk gk1265 f
gk gk1258 n
gk NULL i
gk gk1193 n
gk gk1257 n

mb mb f

ram mem713 n
ram me1112 f
ram mem704 n
ram me1081 n

and I need only first row of each component order by type. so:

cooler aa1317 f
cpu cpu177 f
gk NULL i
mb mb f
ram me1112 f

has somebody some idea hot to select?

jiří němec, ICQ: 114651500
www.menea.cz - www stránky a aplikace


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



Re: [PHP] scoring/sorting db search results based on score

2003-07-21 Thread Marek Kilimajer
I use mysql, so this was for mysql - LIKE is case insesitive and returns 
0 for false and 1 for true.

Dean E. Weimer wrote:
Try
SELECT , (((keywords LIKE '%$search%') * 5) + ((title LIKE
'%$search%') * 3) + (description LIKE '%$search%')) score FROM .
ORDER BY score DESC


PostgreSQL cannot type cast the Boolean type so you have to use a case
statement, also changing like to ilike will get results regardless of
case.
SELECT , ((CASE WHEN (keywords ILIKE '%$search%') THEN 5 ELSE 0 END) +
(CASE WHEN (title ILIKE '%$search%') THEN 3 ELSE 0 END) + (CASE WHEN
(description ILIKE '%$search%') THEN 1 ELSE 0 END)) AS score FROM 
ORDER BY score DESC


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


Re: [PHP] scoring/sorting db search results based on score

2003-07-21 Thread Marek Kilimajer
I don't know how postgres server would optimize the query, but in teory 
there should be only a slight overhead as the (I)LIKE results should be 
cached. How much takes to order by depends on the number of rows returned.

Dave [Hawk-Systems] wrote:
Appreciate the responses...

We are talking a db of under 10k records where the search would take place on.
what are the ramifications of this as a load on the postgres server?  Wouldn't
want to have a great search query that grinds the server to a halt everytime
someone searches regardless of the accuracy of the end result :)
Thanks

Dave





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


Re: [PHP] ANY ONE CAN TELL ME WHAT PORT mssql_connect uses?

2003-07-21 Thread Nabil
Dear Michael;

I am Requesting your help, Redhat 7.3 to connect to the remote windows MS
SQL 7.0
Days and trying to use FreeTDS..

can you help please how to confiure php with sybase as you said?? because it
told me mssql_connect call for undefined function... but actualy i need to
use odbc_connect from linux...

more info:
-I need to connect from Linux box ( www server) and retrieve the data from a
remote MS SQL 7 , that located on the same network..
-please note that their is a CISCO firewall between the two.. and it only
allowed tcp/ip with ports 80, 443 , 1433 for ODBC... ( from windows to
windows I managed, but from LINUX)
-I spent a lot of time trying to use unixODBC with php-odbc ,  iODBC ,
freeTDS .. and whatever I could do, and until now I didn't find a way to
connect.. and I was getting so much errors like unixODBC DSN not found ...
so much painful story..

PLEASE HELP ME COZ I M GOING TO PULL MY HAIR OFF



"Michael Sims" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
On Tue, 15 Jul 2003 19:36:42 +0300, you wrote:

>how can i specify the port for the direct connection
>mssql_connect()

I've never had the need to do this, so I cannot verify that this
works, but I believe you can supply a port number in the servername
argument:

mssql_connect('192.168.0.1:1433', 'someuser', 'somepass');

You can also define this in the FreeTDS "interfaces" file, I believe,
but again I'm not sure as I use the default port.

>can u give me some hints regarding the FreeTDS

Read this article, it helped me out immensely when I set it all up:

http://www.phpbuilder.com/columns/alberto2919.php3

>if i used it then i have to confugure the DSN in liunx am i wrong?

Not sure what you mean here.  If you're referring to a Windows "Data
Source Name" then that is not really relevant on a Linux platform.  If
you have access to port 1433 on the SQL server all you need to do is
to download and install FreeTDS (follow the article above for help,
and when all else fails read the FreeTDS documentation), then rebuild
PHP with the "--with-sybase" option.  After you have done that you can
simply supply an IP address or hostname to the mssql_connect() call.

Give it a shot and if you run into problems I'd be glad to try an
answer any specific questions you may have.



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



Re: [PHP] SQL select

2003-07-21 Thread David Nicholson
Hello,

This is a reply to an e-mail that you wrote on Mon, 21 Jul 2003 at
11:08, lines prefixed by '>' were originally written by you.

> heloo,
> i have got a MySQL table:
> id_comp id_goods type
> has somebody some idea hot to select?

This is off topic for this list but here goes...

SELECT * FROM tablename GROUP BY id_comp

will probably do it.

David.

--
phpmachine :: The quick and easy to use service providing you with
professionally developed PHP scripts :: http://www.phpmachine.com/

  Professional Web Development by David Nicholson
http://www.djnicholson.com/

QuizSender.com - How well do your friends actually know you?
 http://www.quizsender.com/
(developed entirely in PHP)

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



Re: [PHP] Image Stored in DB has errors

2003-07-21 Thread Marek Kilimajer
I'm not sure if this solves you problem, but addslashes escapes BOTH 
single and double quotes. Use str_replace("'", "\\'", ) instead

Guru Geek wrote:

Hello,

I went to bed last night and this was working.  I woke up this morning
and something has happened or someone has tampered with it.  I have
noticed that the LONGBLOB in the database which stores the actual binary
of the image states that it contains 25.3k and the actual 'image_size'
field states 25.9k and I'm wondering if something is trimming part of
the image off.  Can anyone out there in PHP land spot an error in my
code that would create a problem like this?  When I try to view the
photos it returns "the picture you are trying to view contains errors".
HERE'S THE CODE FOR INSERTING PHOTOS INTO THE DATABASE:

if ($userpic != "none")
  {
$image = addslashes (fread(fopen
($HTTP_POST_FILES["userpic"]["tmp_name"], "r"),
   filesize
($HTTP_POST_FILES["userpic"]["tmp_name"])));
$File_name = strtolower($HTTP_POST_FILES["userpic"]["name"]);
$File_size = $HTTP_POST_FILES["userpic"]["size"];
$File_type = strtolower($HTTP_POST_FILES["userpic"]["type"]);
function filecheck($File_name)
{
 $ext = strrchr($File_name, ".");
 $image_type = array (".png", ".jpg", ".jpeg", ".bmp", ".gif",
".tif", ".tiff", ".pcx");
 if ( in_array ($ext, $image_type) )
{
global $goodext;
 $goodext = 1;
}
}
filecheck($File_name);
if (!$goodext)
{
echo "Your photo is not in a valid format.";
   exit;
}
  } else {
  $File_name = " ";
  }
$db_host="localhost";
$db_user="";
$db_pass="";
$db_db="main";
mysql_connect($db_host,$db_user,$db_pass) or die(mysql_error());
mysql_select_db($db_db) or die(mysql_error());
$do= "INSERT INTO table
(name,email,age,location,interests,about,image,image_type,image_size,image_name)
VALUES
('$name','$email','$dobtimestamp','$location','$interests','$about','$image','$File_type','$File_size','$File_name')";
$r=mysql_query($do) or die(mysql_error());

HERE'S THE CODE FOR VIEWING SAID PHOTOS:
$r=mysql_query("SELECT
name,email,age,location,interests,about,image_size FROM table WHERE
name='$name'");
$a=mysql_fetch_array($r);
if ($a['image_size'] > 0)
  {
   print "";
  }
HERE'S THE CODE FOR getimage.php:

Thank all of you in advance,
Rog




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


Re: [PHP] regex help?

2003-07-21 Thread David Nicholson
Hello,

This is a reply to an e-mail that you wrote on Mon, 21 Jul 2003 at
08:59, lines prefixed by '>' were originally written by you.
> Can't seem to get this to work...
> trying to yank stuff xxx from
> xxx

Try this:

preg_match("/]*>(.*)/i", $l, $regs);

HTH

David.

--
phpmachine :: The quick and easy to use service providing you with
professionally developed PHP scripts :: http://www.phpmachine.com/

  Professional Web Development by David Nicholson
http://www.djnicholson.com/

QuizSender.com - How well do your friends actually know you?
 http://www.quizsender.com/
(developed entirely in PHP)

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



[PHP] Re: regex help?

2003-07-21 Thread sven
hi john,
try a regex like this:
'/]*>(.*)/i'
ciao SVEN

John Herren wrote:
> Can't seem to get this to work...
>
> trying to yank stuff xxx from
> xxx
>
> and stuff yyy from
>
>  yyy
>
> preg_match("| (.*)$|i", $l, $regs);
>
> works for the second example, even though it isn't the correct way,
> but nothing works for for me for the first example.
>
> Any help is appreciated!



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



[PHP] help with ad serving

2003-07-21 Thread electroteque
hi there my next project at work is to build an ad server for both image and
flash , i am storing each ad entry into a banner_ads table then another
table media to store each of the banners into which links to the banner ,
although in the created admin tool i allow for multiple uploads so a flash
file can be uploaded for the banner entry and a animated gif version can
also be uploaded for the banner entry , or just an animated gif banner
version , ok so when i select for a banner with a start and end date range
which is valid and is to be shown on a selected site id i grab the files
associated with it which are the flash and image, so in my while loop i end
up with to rows of results how would it be possible to display this and how
am i able to tell if the banner is a flash file with the animated gif
version of if the banner is just an animated gif and display it differently
? let me know thankyou


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



Re: [PHP] popping up download dialog box

2003-07-21 Thread Michael Müller
try this:





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



[PHP] How to..

2003-07-21 Thread Haseeb






hi,
i have heard a lot of people commenting about the coding style of other programmers. i think everyone has his own style. but i also say that there should be a standard that should be followed by everyone. i know that there are many good tutorials that explain how to code. anyway i have my own style. i like keeping all the functions in one file and the include the file whenever i need any function. now there are few problems  in that. i prefer writing functions for almost everything sometimes the functions file grows to over 5,000 lines. now this is not good. when ever i need one simple function i had to include all the file. now i also don't like keeping functions in every file that uses it. this is becoming a big problem for me. also i have seen some programmer that prefer to use only one file as front end and place switch or if conditions and include other files depending on the condition. i think its good way of doing things but when the magnitude of the projects grows i find it very difficult for me to keep working. i find it very hard to concentrate.
 
this is the problem, i have thought of the solution i.e. divide the functions into files. and then include only that file that has the function. but i thought i would ask you people how you handle this. may be i would find something that suits me more then this solution.
 
thanx in advance.
Haseeb







  IncrediMail - Email has finally evolved - Click Here

[PHP] constants

2003-07-21 Thread Michael Müller
hi,
why should I use constants?
thx for help

Michael



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



Re: [PHP] GD2 makes black thumbnails

2003-07-21 Thread Marek Kilimajer
Use imagecreatetruecolor() instead of imagecreate()

Jiří Němec wrote:

hello everyone,

i have got a question about creating thumbnails from original JPG
files. users upload their own pohotos in JPG format to server, and
system makes a thumbnails.
these thumbnails are sometime black. probably there is problem in
uploaded image files, bacaues if I open and save "for web" this file
in AP there is no problem.
have somebody idea how to solve this problem??

jiri nemec, ICQ: 114651500
www.menea.cz - www stránky a aplikace



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


Re: [PHP] How to..

2003-07-21 Thread Jon Haworth
Hi Haseeb,

> i.e. divide the functions into files. and then include
> only that file that has the function.

That's how I usually do it - for example, I have a file called
"dates.lib.php" which contains all my functions for handling dates and
times, a file called "db.lib.php" which has my database stuff, etc etc.

You may also want to look into classes, which provide a neat way to
compartmentalise your code. Personally I don't find them very useful unless
the project is large or has many programmers, though.

Cheers
Jon


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



[PHP] Register Globals

2003-07-21 Thread Daryl Meese
I would like to rewrite my scripts to work when register globals is off.
The problem is that my scripts encompass several thousand files.  Does
anyone have any suggestions for an effective tool to help in this process?

Daryl Meese


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



[PHP] News Reader

2003-07-21 Thread David Goodchild
Could someone advise me of a good news reader. I'm using MS Outlook at the
moment, and if I reply to any post it sends it to the users email and not to
the news server. Plus, its not that great in general terms.

Thanks

Dave



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



Re: [PHP] Register Globals

2003-07-21 Thread skate
a good editor with a good find and replace tool...

i know dreamweaver MX can do a find and replace for an entire site once
you've defined it.


- Original Message -
From: "Daryl Meese" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, July 21, 2003 1:17 PM
Subject: [PHP] Register Globals


> I would like to rewrite my scripts to work when register globals is off.
> The problem is that my scripts encompass several thousand files.  Does
> anyone have any suggestions for an effective tool to help in this process?
>
> Daryl Meese
>
>
> --
> 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] Register Globals

2003-07-21 Thread stfmoreau
Hi,

include this code in your header file :
// _GET
if (isset($_GET))
while (list($key, $val) = each($_GET))
{
eval ("$".$key." = '".$val."';");
}
// _POST
if (isset($_POST))
while (list($key, $val) = each($_POST))
{
eval ("$".$key." = '".$val."';");
}
// _SESSION
if (isset($_SESSION))
while (list($key, $val) = each($_SESSION))
{
eval ("$".$key." = '".$val."';");
}
It may works (I have not expirimence it)

Stf

-Message d'origine-
De : Daryl Meese [mailto:[EMAIL PROTECTED]
Envoyé : lundi 21 juillet 2003 14:18
À : [EMAIL PROTECTED]
Objet : [PHP] Register Globals


I would like to rewrite my scripts to work when register globals is off.
The problem is that my scripts encompass several thousand files.  Does
anyone have any suggestions for an effective tool to help in this process?

Daryl Meese


--
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] Register Globals

2003-07-21 Thread Petre Agenbag
a simple extract($_POST) or extract($_GET) would also work

On Mon, 2003-07-21 at 14:22, stfmoreau wrote:
> Hi,
> 
> include this code in your header file :
>   // _GET
>   if (isset($_GET))
>   while (list($key, $val) = each($_GET))
>   {
>   eval ("$".$key." = '".$val."';");
>   }
>   // _POST
>   if (isset($_POST))
>   while (list($key, $val) = each($_POST))
>   {
>   eval ("$".$key." = '".$val."';");
>   }
>   // _SESSION
>   if (isset($_SESSION))
>   while (list($key, $val) = each($_SESSION))
>   {
>   eval ("$".$key." = '".$val."';");
>   }
> It may works (I have not expirimence it)
> 
> Stf
> 
> -Message d'origine-
> De : Daryl Meese [mailto:[EMAIL PROTECTED]
> Envoyé : lundi 21 juillet 2003 14:18
> À : [EMAIL PROTECTED]
> Objet : [PHP] Register Globals
> 
> 
> I would like to rewrite my scripts to work when register globals is off.
> The problem is that my scripts encompass several thousand files.  Does
> anyone have any suggestions for an effective tool to help in this process?
> 
> Daryl Meese
> 
> 
> --
> 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] News Reader

2003-07-21 Thread Jon Haworth
Hi David,

> Could someone advise me of a good news reader.

Agent is pretty good:
http://www.forteinc.com/agent/

Mozilla has a mail and news component, which you can download on its own if
you don't want the browser, IRC client, HTML editor, etc:
http://www.mozilla.org/projects/thunderbird/

Cheers
Jon


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



RE: [PHP] Register Globals

2003-07-21 Thread Ford, Mike [LSS]
> -Original Message-
> From: stfmoreau [mailto:[EMAIL PROTECTED]
> Sent: 21 July 2003 13:23
> 
> include this code in your header file :
>   // _GET
>   if (isset($_GET))
>   while (list($key, $val) = each($_GET))
>   {
>   eval ("$".$key." = '".$val."';");
>   }

Whoa! Nasty and inefficient!!

I can understand if you decide initially to use a brute-force drop-in
replacement for register_globals, and leave modifying the rest of your code
until later, but really:

(i) Better:

// _GET
if (isset($_GET))
foreach ($_GET as $key=>$val)
{
$$key = $val;
}

(ii) Even better:

// _GET
if (isset($_GET))
extract($_GET);

Cheers!

Mike

-
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730  Fax:  +44 113 283 3211 

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



RE: [PHP] free hosting

2003-07-21 Thread electroteque
spam !

-Original Message-
From: Bang Dodi [mailto:[EMAIL PROTECTED]
Sent: Monday, July 21, 2003 3:55 PM
To: [EMAIL PROTECTED]
Subject: [PHP] free hosting


http://cmax.port5.com





__
Mau ringtones yang gaya ? --> http://www.ponselgaya.com

-- 
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] constants

2003-07-21 Thread Haseeb






hi,
you can use constants whenever you want something whose value you don't want changed accidently.for e.g. i use a constant to keep track of the path.
if i am at the root level then i store "./" in it. and if i am one folder under the root then i store "../"  in it. now as i tend to name variables like this strPath (str for string) i often end up changing the value of strPath to something else in the script. to stop this from happening i use constants
 
HTH,
Haseeb
 
 
---Original Message---
 

From: Michael Müller
Date: Monday, July 21, 2003 04:22:03 PM
To: [EMAIL PROTECTED]
Subject: [PHP] constants
 
hi,
why should I use constants?
thx for help
 
Michael
 
 
 
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
 







  IncrediMail - Email has finally evolved - Click Here

RE: [PHP] Register Globals

2003-07-21 Thread stfmoreau
OK, sorry, I tried to help... and finaly I learn (I didn't know extract...)

-Message d'origine-
De : Ford, Mike [LSS] [mailto:[EMAIL PROTECTED]
Envoyé : lundi 21 juillet 2003 14:35
À : 'stfmoreau'; Daryl Meese; [EMAIL PROTECTED]
Objet : RE: [PHP] Register Globals


> -Original Message-
> From: stfmoreau [mailto:[EMAIL PROTECTED]
> Sent: 21 July 2003 13:23
>
> include this code in your header file :
>   // _GET
>   if (isset($_GET))
>   while (list($key, $val) = each($_GET))
>   {
>   eval ("$".$key." = '".$val."';");
>   }

Whoa! Nasty and inefficient!!

I can understand if you decide initially to use a brute-force drop-in
replacement for register_globals, and leave modifying the rest of your code
until later, but really:

(i) Better:

// _GET
if (isset($_GET))
foreach ($_GET as $key=>$val)
{
$$key = $val;
}

(ii) Even better:

// _GET
if (isset($_GET))
extract($_GET);

Cheers!

Mike

-
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730  Fax:  +44 113 283 3211

--
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] Help with Date

2003-07-21 Thread Elliot Tobin
I need a function to create the dates of previous Fridays, in
21-JUL-2003 format.  

I figure this has already been done, so I wanted to ask before I
continued writing my own. 

Thanks, Elliot

=

-[ Elliot Tobin, [EMAIL PROTECTED] ]-

"America has never been united by blood or birth or soil. We are bound by ideals that 
move us beyond our backgrounds, lift us above our interests and teach us what it means 
to be citizens. Every child must be taught these principles. Every citizen must uphold 
them. And every immigrant, by embracing these ideals, makes our country more, not 
less, American."  -- President Bush


__
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com

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



Re: [PHP] Passing Serialized Array via Hidden field

2003-07-21 Thread John Nichel
Andrei Verovski (aka MacGuru) wrote:
Hi,

I am need to pass serialized assotiative array via form hidden field 
(not GET or POST). In order to do it, I did the following:
Uis there a third form method that I'm not aware of?

urlencode(serialize($my_array)). However, after retrieving data from 
hidden field and unserialize I've got junk.
Why are you urlencode'ing it?

Someone can explain me what I did wrong?


Did you urldecode it before you unserialized it?  Better yet, don't 
urlencode it at all.

Also, do I need to do addslashes/stripslashes with serialized (or 
encoded ?) data?
You shoudn't, but if you add on the submit, don't forget to strip on the 
retrival.

Thanks in advance for any suggestion.

*
*   Best Regards   ---   Andrei Verovski
*
*   Personal Home Page
*   http://snow.prohosting.com/guru4mac
*   Mac, Linux, DTP, Development, IT WEB Site
*


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


Re: [PHP] Register Globals

2003-07-21 Thread John Manko
whoa, i didn't know that.  i love this mailing list! :)

Petre Agenbag wrote:

a simple extract($_POST) or extract($_GET) would also work
 



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


[PHP] Generating .rtf file

2003-07-21 Thread Aliaksei Kurets
This is my problem:

I have a text in my DB in HTML format (with some tags, such as , 
and other). I need to include DB' text in .rtf file. And my question: is
there any beautifull way to convert my HTML text to a plain text (with
formatting).

Maybe someone can advise me a good converting php class???...




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



Re: [PHP] Help with Date

2003-07-21 Thread John Manko
I'd settle for a function that will generate a date for this upcoming 
friday. ;)

Elliot Tobin wrote:

I need a function to create the dates of previous Fridays
 



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


Re: [PHP] Help with Date

2003-07-21 Thread Jon Haworth
Hi Elliot,

> I need a function to create the dates of previous
> Fridays, in 21-JUL-2003 format.

It'll be different depending on what you want to happen if you pass a Friday
timestamp to the function, but it should be something like:

function friday($ts)
{

  while (date("w", $ts) != 5)
$ts -= 86400;

  return date("d-m-Y", $ts);

}

Cheers
Jon


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



Re: [PHP] Help with Date

2003-07-21 Thread Adam Voigt
Umm.

echo(date('U',strtotime('next Friday')));

Notice the strtotime part.


On Mon, 2003-07-21 at 09:25, John Manko wrote:
> I'd settle for a function that will generate a date for this upcoming 
> friday. ;)
> 
> Elliot Tobin wrote:
> 
> >I need a function to create the dates of previous Fridays
> >  
> >
-- 
Adam Voigt ([EMAIL PROTECTED])
Linux/Unix Network Administrator
The Cryptocomm Group


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



RE: [PHP] Help with Date

2003-07-21 Thread Ford, Mike [LSS]
> -Original Message-
> From: Adam Voigt [mailto:[EMAIL PROTECTED]
> Sent: 21 July 2003 14:29
> 
> echo(date('U',strtotime('next Friday')));

Actually, for this upcoming Friday, that'd just be

   echo(date('U',strtotime('Friday')));

Slightly confusingly, 'next Friday' would be the Friday after that (because
'next' is defined to be equivalent to '2nd' -- no, I don't understand why
either, I just know it is!!)


Cheers!

Mike

-
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730  Fax:  +44 113 283 3211 

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



Re: [PHP] Help with Date

2003-07-21 Thread John Manko
Ha.  Not what I have in mind. :)

Adam Voigt wrote:

Umm.

echo(date('U',strtotime('next Friday')));

Notice the strtotime part.

On Mon, 2003-07-21 at 09:25, John Manko wrote:
 

I'd settle for a function that will generate a date for this upcoming 
friday. ;)

Elliot Tobin wrote:

   

I need a function to create the dates of previous Fridays

 



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


Re: [PHP] Auto session timeout

2003-07-21 Thread Hardik Doshi
Hi John,

Thanks for your response.

Actually i am thinking on the same way except saving
the URL of the page. You gave me a really good tip of
storing the URL with all other information.
Additionally, i was thinking to implement the "Save"
feature of MS word. So user can keep saving his/her
work after some period of time..

There is still one problem. On so many forms on my
education intranet application, students are
submitting the final projects with the supporting
documents and images. Once they submit the final
project, my script is performing serveral error
checking for the file size, extension etc. What should
i have to do for those kind of stuff? Because if
someone submits a very large file then my script won't
be able to upload the file (because of PHP file upload
limit set into the php.ini)

Let me know if you have any suggestion for improving
this functionality a little bit more.

Thanks again for your positive reply.

Hardik
--- "John W. Holmes" <[EMAIL PROTECTED]> wrote:
> Hardik Doshi wrote:
> 
> > Hi,
> > 
> > I have implemented the Auto session timeout after
> the
> > specific period of time. 
> > 
> > What i am doing is..At the time of login to the
> > system, my script is storing the current unix time
> > into the session and later on at every user click,
> It
> > (my script) is checking the stored unix time with
> the
> > current time. So, if you want to auto logout the
> user
> > after 30 minutes of inactivity then you need to
> store
> > auto session timeout interval to 30 min. 
> > 
> > Algorith is..If session stored time + auto session
> > timeout interval > current time then my script
> > automatically logout the user from the system
> > otherwise my script stores the current unix time
> in
> > the session.
> > 
> > My problem is.. If user is doing some work on the
> > particular page (Ex. user is writing some stuff on
> the
> > specific page) but my script is counting this
> thing to
> > inactive period.. so after 31 minutes if user is
> > completing the writing and hit submit button then
> he
> > is getting the session expired screen and he is
> > loosing all the contents on that particular page..
> > Please let me know if any one has solution for
> this.
> 
> What you could do, at the point you realize the
> session has times out, 
> is save the contents of $_GET, $_POST, or $_REQUEST
> (depending upon your 
> script) and the current URL of the page in the
> session. Have the user 
> log in again. The "login validation" page then
> checks for the saved 
> values, and if they are there, redirects back to
> that page. Then the 
> user doesn't lose anything. It'll require a little
> work, but short of 
> increasing your time-out limit, that's the best
> option. There's no way 
> to tell if a user is working on filling out a page
> or has left the 
> browser open.
> 
> -- 
> ---John Holmes...
> 
> Amazon Wishlist:
> www.amazon.com/o/registry/3BEXC84AB3A5E/
> 
> PHP|Architect: A magazine for PHP Professionals –
> www.phparch.com
> 
> 
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


__
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com

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



Re: [PHP] Help with Date

2003-07-21 Thread John Manko
More like:

echo(date('Jennifer Lopez',strtotime('next Friday')));

John Manko wrote:

Ha.  Not what I have in mind. :)

Adam Voigt wrote:

Umm.

echo(date('U',strtotime('next Friday')));

Notice the strtotime part.

On Mon, 2003-07-21 at 09:25, John Manko wrote:
 

I'd settle for a function that will generate a date for this 
upcoming friday. ;)

Elliot Tobin wrote:

  

I need a function to create the dates of previous Fridays








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


RE: [PHP] Help with Date

2003-07-21 Thread Ford, Mike [LSS]
> -Original Message-
> From: Elliot Tobin [mailto:[EMAIL PROTECTED]
> Sent: 21 July 2003 14:08
> 
> 
> I need a function to create the dates of previous Fridays, in
> 21-JUL-2003 format.  
> 
> I figure this has already been done, so I wanted to ask before I
> continued writing my own. 

Take a look at strtotime() -- http://www.php.net/strtotime

Some combination of words using the word 'Friday' should get you what you want -- try 
something like strtotime('last Friday') ('-2 Friday', '-3 Friday', etc.,) to see if it 
does what you want; if not, you may need something like 'last week Friday', '-2 weeks 
Friday', etc., or some other more complex combination.

Cheers!

Mike

-
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730  Fax:  +44 113 283 3211 

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



[PHP] PHP POSTGRESQL AND WML

2003-07-21 Thread haydo hassan
Hi.

I am trying to send two variables from login.wml to auth.php.
But auth.php gets empty variables.

here is the code for login.wml:



http://www.wapforum.org/DTD/wml_1.1.xml";>

  

  
Name:

Password:

  
  
Login

  
  

  
  




  

  


and here is the code for auth.php:



What do i wrong?
Please can you help me?

__
ComputerBild (15-03) empfiehlt den besten Spam-Schutz:
WEB.DE FreeMail - Deutschlands beste E-Mail - http://s.web.de/?mc=021125


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



Re: [PHP] News Reader

2003-07-21 Thread Steve
David Goodchild wrote:

Could someone advise me of a good news reader. I'm using MS Outlook at the
moment, and if I reply to any post it sends it to the users email and not to
the news server. Plus, its not that great in general terms.
XNews, slrn, Fortitude and of course Thunderbird (Gecko client).



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


[PHP] Print help

2003-07-21 Thread Ron Allen
What I would like to do is to make an optional page that can print
information to a specified printer.  Can PHP do this?
If so how???

Please help!!!



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



[PHP] File download by php header...

2003-07-21 Thread Scott Fletcher
Hi!

I'm using PHP 4.3.2 and IIS 5.0.  I'm using the PHP header to cause the
webserver to download the file to the web browser.  Some of the time it work
and some of the other time, it doesnt.  I haven't figured out why until I
looked in the error log which showed hte problem...   See two clipping
below.

--snip--
  //Send Downloadable File(s) To Browsers...
$total=$DownloadUpdateArray[$_REQUEST['dw_code']][0];
header ("Content-Type: application/octet-stream");
header ("Content-Length: ".filesize($total));
header ("Content-Disposition: attachment;
filename=".$DownloadUpdateArray[$_REQUEST['dw_code']][1]);
readfile($total);
--snip--

--snip--
[21-Jul-2003 09:15:33] PHP Fatal error:  Maximum execution time of 30
seconds exceeded in
D:\<>\menu\tech_support.php on line 47
--snip

So, how does the php header("content-disposition:attachment;
filename='***'") cause the php timeout in the first place, what seem to be
the problem?

Thanks,
 Scott



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



RE: [PHP] Print help

2003-07-21 Thread Jay Blanchard
[snip]
What I would like to do is to make an optional page that can print
information to a specified printer.  Can PHP do this?
If so how???
[/snip]

Start by RTFM at http://us3.php.net/printer

HTH!

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



Re: [PHP] File download by php header...

2003-07-21 Thread Chris Hayes
At 16:15 21-7-03, you wrote:
Hi!

I'm using PHP 4.3.2 and IIS 5.0.  I'm using the PHP header to cause the
webserver to download the file to the web browser.  Some of the time it work
and some of the other time, it doesnt.  I haven't figured out why until I
looked in the error log which showed hte problem...   See two clipping
below.
--snip--
  //Send Downloadable File(s) To Browsers...
$total=$DownloadUpdateArray[$_REQUEST['dw_code']][0];
header ("Content-Type: application/octet-stream");
header ("Content-Length: ".filesize($total));
header ("Content-Disposition: attachment;
filename=".$DownloadUpdateArray[$_REQUEST['dw_code']][1]);
readfile($total);
--snip--
--snip--
[21-Jul-2003 09:15:33] PHP Fatal error:  Maximum execution time of 30
seconds exceeded in
D:\<>\menu\tech_support.php on line 47
--snip
So, how does the php header("content-disposition:attachment;
filename='***'") cause the php timeout in the first place, what seem to be
the problem?
It seems like $DownloadUpdateArray[$_REQUEST['dw_code']][1] takes so long. 
Or the previous code alwyas takes 29.9 secs, who knows.

You can tell php.ini that scripts can take some time longer dan 30 secs, or 
you can add a line to prolong the script time 
(http://nl2.php.net/function.set-time-limit) or you can try to make that 
function faster.

I have some extra headers to prevent several problems:

header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");   // Date in 
the past
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");  // always 
modified
header("Cache-Control: no-store, no-cache, must-revalidate");   // HTTP/1.1
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache"); // HTTP/1.0

header("Content-type: text/csv");   //adapt to 
your file type
header('Content-Disposition: inline; filename="filename.ext"');

Note that internet explorer 5.5 does not accept the 'attachment' part so 
for your header with 'attachement;' in it consider to add this conditional:
if (strstr($_SERVER["HTTP_USER_AGENT"],"MSIE 5.5")) {$att = "";} else {$att 
= " attachment;";}






Thanks,
 Scott


--
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] Re: mail function

2003-07-21 Thread Curt Zirzow
* Thus wrote Ivo Fokkema ([EMAIL PROTECTED]):
> > >Does mail() return true? I mean, do you get printed "U redu je"? If so,
> >
> > When PHP sends an email to a non existing email address such as
> > [EMAIL PROTECTED], the warning mail you normally get returned often does not
> > arrive in your mailbox. Therefore I add two additional headers:
> >
> >  ."Reply-To: [EMAIL PROTECTED]"
> >  ."Return-path: <[EMAIL PROTECTED]"
> >
> > and now I do get the notification mail when mail bounces.
> That's funny, because I always had that problem, too. By adding Reply-To and
> Return-path, it did not fix my problem. Boucing emails never got back to me.
> Return-path was overwritten by my hostingserver to '[EMAIL PROTECTED]' and Reply-To
> was apparently ignored by the server bouncing the email. Do you think
> servers differ in this a lot?

So much confusion on mail.

Return-Path: inserted by all smtp servers on delivery.
Reply-To:handled by client
Errors-To:   Maybe handled by smtp server.


Curt
-- 
"I used to think I was indecisive, but now I'm not so sure."

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



Re: [PHP] File download by php header...

2003-07-21 Thread Curt Zirzow
* Thus wrote Scott Fletcher ([EMAIL PROTECTED]):
> Hi!
> 
> I'm using PHP 4.3.2 and IIS 5.0.  I'm using the PHP header to
> cause the webserver to download the file to the web browser.  Some
> of the time it work and some of the other time, it doesnt.  I
> haven't figured out why until I looked in the error log which
> showed hte problem...   See two clipping below.
> 
> --snip-- //Send Downloadable File(s) To Browsers...
> $total=$DownloadUpdateArray[$_REQUEST['dw_code']][0]; header
> ("Content-Type: application/octet-stream"); header ("Content-Length:
> ".filesize($total)); header ("Content-Disposition: attachment;
> filename=".$DownloadUpdateArray[$_REQUEST['dw_code']][1]);
> readfile($total); --snip--
> 
> --snip-- [21-Jul-2003 09:15:33] PHP Fatal error:  Maximum execution
> time of 30 seconds exceeded in D:\<>\menu\tech_support.php
> on line 47 --snip
> 
> So, how does the php header("content-disposition:attachment;
> filename='***'") cause the php timeout in the first place, what
> seem to be the problem?

It doesn't.  Your script is taking over 30 seconds to run you will need
to find out why and where its taking to long or extend your time-out
setting.

btw, also on the content-disposition, not only will some browsers not
honor that, they will just use the name of the script as the 'save-as'
filename.  

Curt
-- 
"I used to think I was indecisive, but now I'm not so sure."

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



[PHP] Re: Error - when trying to connect to postgresql

2003-07-21 Thread Peter Torraca
When I try to connect to postresql with my php script below I got hhis eror:
I can insert into the table from psql.  Please help
Thanks,

---
Warning: pg_exec() query failed: ERROR: invention: permission denied 
in /home/pptun/public_html/invention.php on line 9
---

$conn = pg_connect("dbname=pptun port=5432");

My first guess is that your problem comes from the fact that 
pg_connect is missing at least a username and password.

From http://us4.php.net/pg_connect :

$dbconn3 = pg_connect ("host=sheep port=5432 dbname=mary user=lamb 
password=foo");
//connect to a database named "mary" on the host "sheep" with a 
username and password

Good luck

peter
--
Peter Torraca
[EMAIL PROTECTED]
<><
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Mail From option in PHP.ini

2003-07-21 Thread Peter Torraca
On 07/18/2003 12:00 PM, Brian S. Drexler wrote:
 Ok, I want to specify who the mail is coming from by using the sendmail_path
 option in the PHP.ini.  I've added the [EMAIL PROTECTED] to it, but I want
 to be able to dynmaically change [EMAIL PROTECTED] to [EMAIL PROTECTED] or
 whatever else.  Anyone have any ideas how I can do this?  I'm pulling the
 e-mail I'd like to change it to from a MySQL database but can I rewrite the
 php.ini file on the fly or am I stuck.  Any help is greatly appreciated.
Why not just add the From: header to the fourth mail() param? 
Something like this:

$email = "[EMAIL PROTECTED]";
$admin_email = "[EMAIL PROTECTED]";
$body = "blah blah blah";
$mail = mail($email, "Information you requested", $body, "From: $admin_email");

I've found that this sets the headers the way most clients expect to 
see them.  We use it a lot to tidy up emails set from "reset your 
password" functions and the like.  It should be trivial to set the 
From: header based on a db result or whatever.

There is a much expanded version of this solution regarding sending 
emails with attachments through mail() on in the online php manual, 
check out "kieran dot huggins at rogers dot com"'s comments and some 
others on the http://us4.php.net/mail page (it's a 06-Nov-2002 
comment).

I'm coming in a bit late to this conversation -- hopefully I'm not 
too far off base with this reply.  If I am, sorry!

peter

--
Peter Torraca
Webmaster, Math Department
Purdue Univ., Math 813
765-494-9998
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] File download by php header...

2003-07-21 Thread Scott Fletcher
Um, problem is I don't have any scripts before this sample header function.
So, something is up.  Does the file size 49 MB have something to do with it?

Okay, saw both of the replies, so will check them out.

Thanks,
 Scott

"Curt Zirzow" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> * Thus wrote Scott Fletcher ([EMAIL PROTECTED]):
> > Hi!
> >
> > I'm using PHP 4.3.2 and IIS 5.0.  I'm using the PHP header to
> > cause the webserver to download the file to the web browser.  Some
> > of the time it work and some of the other time, it doesnt.  I
> > haven't figured out why until I looked in the error log which
> > showed hte problem...   See two clipping below.
> >
> > --snip-- //Send Downloadable File(s) To Browsers...
> > $total=$DownloadUpdateArray[$_REQUEST['dw_code']][0]; header
> > ("Content-Type: application/octet-stream"); header ("Content-Length:
> > ".filesize($total)); header ("Content-Disposition: attachment;
> > filename=".$DownloadUpdateArray[$_REQUEST['dw_code']][1]);
> > readfile($total); --snip--
> >
> > --snip-- [21-Jul-2003 09:15:33] PHP Fatal error:  Maximum execution
> > time of 30 seconds exceeded in D:\<>\menu\tech_support.php
> > on line 47 --snip
> >
> > So, how does the php header("content-disposition:attachment;
> > filename='***'") cause the php timeout in the first place, what
> > seem to be the problem?
>
> It doesn't.  Your script is taking over 30 seconds to run you will need
> to find out why and where its taking to long or extend your time-out
> setting.
>
> btw, also on the content-disposition, not only will some browsers not
> honor that, they will just use the name of the script as the 'save-as'
> filename.
>
> Curt
> -- 
> "I used to think I was indecisive, but now I'm not so sure."



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



[PHP] Re: How to..

2003-07-21 Thread Paul Chvostek
On Tue, Jul 22, 2003 at 04:08:35AM +0500, Haseeb wrote:
> 
>i like keeping all the functions in one file and the
>include the file whenever i need any function.
...
>some programmer that prefer to use only one file as front end and place
>switch or if conditions and include other files depending on the condition.
...
>divide the functions into files. and then include only that file
>that has the function.

I do a little of all three, myself.  But, it depends on the project.

If the project is small enough, a single function file will do.  I start
to segregate functions by category when I see logical divisions between
the functions.  (I.e. billing things, statistical things, etc.)  Then I
choose which function libaries to call based on whatever criteria I have
on hand -- usually user input.

Often it's simpler than that -- a project could have a "billing.php"
script that calls "functions-billing.php", and "stats.php" that calls
"functions-stats.php".  And if a particular billing function wants to
use something out of stats, it can simply include that library.

Another thing I've done from time to time (though I wouldn't recommend
it) is name your function library after a variable that's used to denote
the part of the program you're running in.  For example:

  if (ereg('^[a-z]+$',$sect)) @include("functions-" . $sect . ".php");

That way, you're basing your include on something that you're already
managing, perhaps as a form or session variable.  YMMV.  Don't forget to
do your sanity checking.  This method may be prone to security problems.

-- 
  Paul Chvostek <[EMAIL PROTECTED]>
  it.canadahttp://www.it.ca/
  Free PHP web hosting!http://www.it.ca/web/


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



Re: [PHP] Passing Serialized Array via Hidden field

2003-07-21 Thread Chris Shiflett
--- Andrei Verovski <[EMAIL PROTECTED]> wrote:
> I am need to pass serialized assotiative array via form hidden
> field (not GET or POST).

This is impossible. A hidden form field is simply a form field that is not
displayed to the user. Form actions must be GET or POST.

> In order to do it, I did the following: urlencode(serialize($my_array)).

Don't URL encode the value of the form field, since the browser will take care
of that. You should probably use POST rather than GET, because serializing an
array might yield a very long string and make the URL too large for the Web
browser and/or Web server to handle.

Hope that helps.

Chris

=
Become a better Web developer with the HTTP Developer's Handbook
http://httphandbook.org/

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



[PHP] a good PHP free forum?

2003-07-21 Thread Denis L. Menezes
Hello friends.

Can someone suggest a very good and easy to customise forum?

Thanks
Denis



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



[PHP] need help with mysql union

2003-07-21 Thread r-militante
hi, i'm trying to select * through 3 tables - is the following syntax correct?

$sql="(SELECT * FROM mjp_cc)";
$sql="UNION";
$sql="(SELECT * FROM imc_cc)";
$sql="UNION";
$sql="(SELECT * FROM pmp_cc)";
$sql.=" ORDER BY savedccactivity DESC";

i basically just want to spit out the contents of these tables...

also - how would this type of query work if the name 'savedccactivity' is 
different in all 3 
tables?

thanks
redmond



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



RE: [PHP] a good PHP free forum?

2003-07-21 Thread Dan Joseph
phpBB is pretty good.

-Dan Joseph

> -Original Message-
> From: Denis L. Menezes [mailto:[EMAIL PROTECTED]
> Sent: Monday, July 21, 2003 11:57 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] a good PHP free forum?
> 
> 
> Hello friends.
> 
> Can someone suggest a very good and easy to customise forum?
> 
> Thanks
> Denis
> 
> 
> 
> -- 
> 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] a good PHP free forum?

2003-07-21 Thread Jonathan Villa
www.phpbb.com

-Original Message-
From: Denis L. Menezes [mailto:[EMAIL PROTECTED] 
Sent: Monday, July 21, 2003 10:57 AM
To: [EMAIL PROTECTED]
Subject: [PHP] a good PHP free forum?

Hello friends.

Can someone suggest a very good and easy to customise forum?

Thanks
Denis



-- 
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] need help with MySQL full text searching!!!!

2003-07-21 Thread Angelo Zanetti
Hi

I have a table which contains 3 fields (ID, Title, Abstract) the title and abstract 
fields have been fulltext indexes like this:

ALTER TABLE biblio ADD FULLTEXT (title,abstract);

that worked fine, however my problem is whenever I want to do a select statement only 
comparing 1 of the columns to inputted data ( in a Select statement):

$result = mysql_query("SELECT * FROM Biblio WHERE MATCH (title) AGAINST 
('$searchString')");

It gives me this error: Can't find FULLTEXT index matching the column list. It appears 
that i cant just compare a single fulltext indexed column if there are other fulltext 
indexed columns. When I try it with both columns then it works but I just want to 
compare 1 column. eg: 
$result = mysql_query("SELECT * FROM Biblio WHERE MATCH (title, abstract) AGAINST 
('$searchString')");

So is there anyway that I can just compare 1 column with text entered? Do I have t 
make some sort of temporary table to do this? All the examples I have found show the 
select statement with 2 columns or if they use 1 coumn its because there is only 1 
column in their table.

Any help would be appreciated!

TIA

Angelo

ps. sorry that this may be a bit off topic


Re: [PHP] Passing Serialized Array via Hidden field

2003-07-21 Thread John Manko
Just a small point, you can have both GET and POST.

-- search.html -





- page.php 
$sid = $_GET['sid'];
session_id($sid);
session_start();
$search = $_POST['search'];

Also, for those who don't know, you can even reference hash links


Hope that helps.

Chris

=
Become a better Web developer with the HTTP Developer's Handbook
http://httphandbook.org/
 



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


Re: [PHP] a good PHP free forum?

2003-07-21 Thread Step Schwarz
> Hello friends.
> 
> Can someone suggest a very good and easy to customise forum?
> 
> Thanks
> Denis

No disrespect intended, but this question gets asked every week. For a
complete history just search the archives for "free php forum" -- take a
look at a thread like "[PHP] Need a forum" and it should tell you everything
you need to know: http://marc.theaimsgroup.com/?l=php-general

Good luck!, -Step


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



Re: [PHP] Register Globals

2003-07-21 Thread Curt Zirzow
* Thus wrote stfmoreau ([EMAIL PROTECTED]):
> Hi,
> 
> include this code in your header file :
>   // _GET
>   if (isset($_GET))
>   while (list($key, $val) = each($_GET))
>   {
>   eval ("$".$key." = '".$val."';");
>   }
>   // _POST
>   if (isset($_POST))
>   while (list($key, $val) = each($_POST))
>   {
>   eval ("$".$key." = '".$val."';");
>   }
>   // _SESSION
>   if (isset($_SESSION))
>   while (list($key, $val) = each($_SESSION))
>   {
>   eval ("$".$key." = '".$val."';");
>   }
> It may works (I have not expirimence it)

You can shorten it down a bit:
if (isset($_REQUEST) ) {
  foreach($_REQUEST as $key => $val) {
$$key = $val;
  }
}

I'm not sure if session is there but I know the $_REQUEST has all GET,
POST and COOKIE vars. Of course this isn't completely compatible with
how register_globals works.  There is GPC ordering of where to get the
variables from.

$GPC = "GPC"
for($i = 0; i < strlen($GPC); $i++) {
  switch($GPC{$i}) {
case 'G': $VAR = '_GET'; break;
case 'P': $VAR = '_POST'; break;
case 'C': $VAR = '_COOKIES'; break;
  }
  if (isset($$VAR) ) {
foreach($$VAR as $key => $val) {
  eval("global $$key"); //make it global if this is in a function
  $$key = $val; //set value
}
  }
}

Curt
-- 
"I used to think I was indecisive, but now I'm not so sure."

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



Re: [PHP] File download by php header...

2003-07-21 Thread Scott Fletcher
> btw, also on the content-disposition, not only will some browsers not
> honor that, they will just use the name of the script as the 'save-as'
> filename.

That's okay with the 'save as' filename because no one know hte real
filename on the webserver because it is renamed when it is download anyway.

"Curt Zirzow" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> * Thus wrote Scott Fletcher ([EMAIL PROTECTED]):
> > Hi!
> >
> > I'm using PHP 4.3.2 and IIS 5.0.  I'm using the PHP header to
> > cause the webserver to download the file to the web browser.  Some
> > of the time it work and some of the other time, it doesnt.  I
> > haven't figured out why until I looked in the error log which
> > showed hte problem...   See two clipping below.
> >
> > --snip-- //Send Downloadable File(s) To Browsers...
> > $total=$DownloadUpdateArray[$_REQUEST['dw_code']][0]; header
> > ("Content-Type: application/octet-stream"); header ("Content-Length:
> > ".filesize($total)); header ("Content-Disposition: attachment;
> > filename=".$DownloadUpdateArray[$_REQUEST['dw_code']][1]);
> > readfile($total); --snip--
> >
> > --snip-- [21-Jul-2003 09:15:33] PHP Fatal error:  Maximum execution
> > time of 30 seconds exceeded in D:\<>\menu\tech_support.php
> > on line 47 --snip
> >
> > So, how does the php header("content-disposition:attachment;
> > filename='***'") cause the php timeout in the first place, what
> > seem to be the problem?
>
> It doesn't.  Your script is taking over 30 seconds to run you will need
> to find out why and where its taking to long or extend your time-out
> setting.
>
> btw, also on the content-disposition, not only will some browsers not
> honor that, they will just use the name of the script as the 'save-as'
> filename.
>
> Curt
> -- 
> "I used to think I was indecisive, but now I'm not so sure."



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



[PHP] Re: need help with MySQL full text searching!!!!

2003-07-21 Thread James Rodenkirch
You need to use mysql 4.0.10-gamma for full text searching to work

Angelo Zanetti wrote:

Hi

I have a table which contains 3 fields (ID, Title, Abstract) the title and abstract fields have been fulltext indexes like this:

ALTER TABLE biblio ADD FULLTEXT (title,abstract);

that worked fine, however my problem is whenever I want to do a select statement only comparing 1 of the columns to inputted data ( in a Select statement):

$result = mysql_query("SELECT * FROM Biblio WHERE MATCH (title) AGAINST ('$searchString')");

It gives me this error: Can't find FULLTEXT index matching the column list. It appears that i cant just compare a single fulltext indexed column if there are other fulltext indexed columns. When I try it with both columns then it works but I just want to compare 1 column. eg: 
$result = mysql_query("SELECT * FROM Biblio WHERE MATCH (title, abstract) AGAINST ('$searchString')");

So is there anyway that I can just compare 1 column with text entered? Do I have t make some sort of temporary table to do this? All the examples I have found show the select statement with 2 columns or if they use 1 coumn its because there is only 1 column in their table.

Any help would be appreciated!

TIA

Angelo

ps. sorry that this may be a bit off topic



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


RE: [PHP] jpeg photo file upload problem

2003-07-21 Thread motorpsychkill
You may want to try getimagesize(), as this is more consistent in
determining mime types.  That is what I wound up doing as it appears to
override the browser/platform idiosyncracies.

-m

> -Original Message-
> From: John T. Beresford [mailto:[EMAIL PROTECTED]
> Sent: Thursday, July 17, 2003 5:51 PM
> To: motorpsychkill; [EMAIL PROTECTED]
> Subject: RE: [PHP] jpeg photo file upload problem
>
>
>
> You're exactly right.
>
> I did a test on a win box and it reported image/pjpeg
> I ran tests on other browsers/platforms, and for a .jpg image, only a
> handful of win boxes reported the 'pjpeg' thing.
>
> I also did tests using 'regular jpegs' and 'progressive jpegs' and
> that had no effect.
>
> Apparently the ms browser on a win box calls a 'jpeg a 'pjpeg'
>
> Anyway, to all, thanks for all the help, it's all working now.
>
> John
>
>
> At 5:43 PM -0700 7/17/03, motorpsychkill wrote:
> >I suspect this may be a browser/platform issue.  I've recently run some
> >tests and below are the most interesting results (mime types):
> >
> >IE 6 on PC:
> >something.jpg->  image/pjpeg
> >something.tif (pc format) -> application/octet-stream
> >something.tif (mac format) ->image/tiff
> >
> >IE 5 on Mac:
> >something.bmp -> application/octet-stream
> >something.jpg -> image/jpeg
> >
> >
> >NS 4.7 on Mac:
> >something.bmp->  image/x-MS-bmp
> >
> >Opera 7 on PC:
> >something.bmp->  image/x-windows-bmp
> >
> >I suspect if you want to validate jpgs, use image/jpeg and image/pjpeg or
> >validate by examining the extention (ie ".jpg").  I don't know
> how safe the
> >latter is.
> >
> >HTH,
> >
> >m
> >
> >
> >>  -Original Message-
> >>  From: John T. Beresford [mailto:[EMAIL PROTECTED]
> >>  Sent: Wednesday, July 16, 2003 7:49 PM
> >>  To: [EMAIL PROTECTED]
> >>  Subject: [PHP] jpeg photo file upload problem
> >>
> >>
> >>  Hi All,
> >>
> >>  I have a system that allows a person to upload photos to the server
> >>  via an admin web form.
> >>
> >>  I have been using the code for about a year with no problem. I
> >>  designed it specifically for a client of mine that has just started
> >>  cruising on a sailboat for a few years.
> >>
> >>  They tryed uploading a photo from a public library via the web form
> >>  and they got the error message that it was not a jpeg file.
> >>
> >>  The relevent PHP code from my system for the checking is:
> >>
> >>  if ($type != "image/jpeg") {
> >>  $ReturnSaying = "!! The file is not a JPEG picture. Please try again";
> >>  include("photo_error.php");
> >>  exit;
> >>
> >>  Anyway, this system has been tested and tested again on multiple
> >>  platforms and conditions, except a public library.
> >>
> >>  Question: Is it possible that the library is using some proxy system
> >>  that is messing with the file so it comes out bad?
> >>
> >>  Also, I have confirmed that the file is a jpeg file.
> >>
> >>  Any ideas are greatly appreciated,
> >>  John
> >>
> >>  --
> >>  ===
> >>  John T. Beresford, Owner
> >>  Digital Studio Design
> >>  Edmond, OK
> >>  http://www.digitalstudiodesign.com/
> >>  405.760.0794
> >>
> >>  --
> >>  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
>
> --
> ===
> John T. Beresford, Owner
> Digital Studio Design
> Edmond, OK
> http://www.digitalstudiodesign.com/
> 405.760.0794
>
> --
> 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: Print help

2003-07-21 Thread Kevin Stone

"Ron Allen" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> What I would like to do is to make an optional page that can print
> information to a specified printer.  Can PHP do this?
> If so how???
>
> Please help!!!

Look in the manual under 'printer'..
http://www.php.net/manual/en/ref.printer.php

Printer functions are server-side and work on Windows operating systems
only.

- Kevin



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



[PHP] CSV import

2003-07-21 Thread jwulff
When using something like this:
LOAD DATA LOCAL INFILE '/tmp/phpKBjUWb' INTO TABLE `indoma` FIELDS
TERMINATED BY ',' LINES TERMINATED BY '\r\n'

How do I also insert a field not in the CSV.  For example there are 8 fields
in the CSV and 9 in the table.  I want the ninth field to be the name of the
CSV file.  How do I do this?  Can't find any mention of it on mysql.com.

John



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



[PHP] Changing numbers

2003-07-21 Thread zavaboy
I have the following numbers:

12.400
666.75
23
369.2
3.234

How can I make them have at least 2 decimal places?
So, they will output:

12.40
666.75
23.00
269.20
3.234

Thanks in advance!

-- 

- Zavaboy
[EMAIL PROTECTED]
www.zavaboy.com



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



RE: [PHP] Changing numbers

2003-07-21 Thread Jay Blanchard
[snip]
How can I make them have at least 2 decimal places?
[/snip]

RTFM at http://www.php.net/number_format

HTH!

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



RE: [PHP] CSV import

2003-07-21 Thread Jay Blanchard
[snip]
When using something like this:
LOAD DATA LOCAL INFILE '/tmp/phpKBjUWb' INTO TABLE `indoma` FIELDS
TERMINATED BY ',' LINES TERMINATED BY '\r\n'

How do I also insert a field not in the CSV.  For example there are 8
fields
in the CSV and 9 in the table.  I want the ninth field to be the name of
the
CSV file.  How do I do this?  Can't find any mention of it on mysql.com.
[/snip]

Instead of LOAD DATA INFILE see 

http://www.php.net/fgetcsv 

HTH!

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



Re: [PHP] Changing numbers

2003-07-21 Thread zavaboy
What about if I had 2.856 that function will make it 2.86.


"Jay Blanchard" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
[snip]
How can I make them have at least 2 decimal places?
[/snip]

RTFM at http://www.php.net/number_format

HTH!



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



Re: [PHP] Changing numbers

2003-07-21 Thread James Rodenkirch
try rounding it first

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

Zavaboy wrote:

What about if I had 2.856 that function will make it 2.86.

"Jay Blanchard" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
[snip]
How can I make them have at least 2 decimal places?
[/snip]
RTFM at http://www.php.net/number_format

HTH!




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


Re: [PHP] Changing numbers

2003-07-21 Thread zavaboy
*Sigh*, lets say I have:

2.65
3.3
5.2670
12.030

I would like it at least 2 decimal places.. So, 5.2670 would be 5.267 not
5.27:

2.65
3.30
5.267
12.03

"James Rodenkirch" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> try rounding it first
>
> http://www.php.net/manual/en/function.round.php
>
> Zavaboy wrote:
>
> > What about if I had 2.856 that function will make it 2.86.
> >
> >
> > "Jay Blanchard" <[EMAIL PROTECTED]> wrote in message
> > news:[EMAIL PROTECTED]
> > [snip]
> > How can I make them have at least 2 decimal places?
> > [/snip]
> >
> > RTFM at http://www.php.net/number_format
> >
> > HTH!
> >
> >
>



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



Re: [PHP] need help with MySQL full text searching!!!!

2003-07-21 Thread CPT John W. Holmes
I think you need to make a second index that just consists of the one column

ALTER TABLE biblio ADD FULLTEXT (title)

if you want to search on just that one column.

---John Holmes...

- Original Message - 
From: "Angelo Zanetti" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, July 21, 2003 12:09 PM
Subject: [PHP] need help with MySQL full text searching


Hi

I have a table which contains 3 fields (ID, Title, Abstract) the title and
abstract fields have been fulltext indexes like this:

ALTER TABLE biblio ADD FULLTEXT (title,abstract);

that worked fine, however my problem is whenever I want to do a select
statement only comparing 1 of the columns to inputted data ( in a Select
statement):

$result = mysql_query("SELECT * FROM Biblio WHERE MATCH (title) AGAINST
('$searchString')");

It gives me this error: Can't find FULLTEXT index matching the column list.
It appears that i cant just compare a single fulltext indexed column if
there are other fulltext indexed columns. When I try it with both columns
then it works but I just want to compare 1 column. eg:
$result = mysql_query("SELECT * FROM Biblio WHERE MATCH (title, abstract)
AGAINST ('$searchString')");

So is there anyway that I can just compare 1 column with text entered? Do I
have t make some sort of temporary table to do this? All the examples I have
found show the select statement with 2 columns or if they use 1 coumn its
because there is only 1 column in their table.

Any help would be appreciated!

TIA

Angelo

ps. sorry that this may be a bit off topic


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



Re: [PHP] need help with mysql union

2003-07-21 Thread CPT John W. Holmes
> hi, i'm trying to select * through 3 tables - is the following syntax
correct?
>
> $sql="(SELECT * FROM mjp_cc)";
> $sql="UNION";
> $sql="(SELECT * FROM imc_cc)";
> $sql="UNION";
> $sql="(SELECT * FROM pmp_cc)";
> $sql.=" ORDER BY savedccactivity DESC";
>
> i basically just want to spit out the contents of these tables...
>
> also - how would this type of query work if the name 'savedccactivity' is
> different in all 3
> tables?

This is a MySQL question, first of all.

Second, you need to rename the column in each table to 'savedccactivity' if
you want to order the whole result by that.

(SELECT foo AS column FROM table1)
UNION
(SELECT bar AS column FROM table2)
UNION
(SELECT abc AS column FROM table3)
ORDER BY column DESC

---John Holmes...


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



[PHP] IE Issues

2003-07-21 Thread Stephen
Hello,

This is a little off topic but I do need some help. I have had IE 6 for
about a month now (just got a new computer in June and have been using IE6
since). When I first started running it, it was fine. A few weeks ago,
though, all my fonts have greatly increased and I have done nothing that
would cause this.

If I make a webpage that has  then IE will display the font
at size 3 or 4. I have no idea why either. I have put a default style sheet
on IE to make all the fonts a certain size but this is getting annoying
since only some are getting resized.

I have run the Accessibilty wizard on Windows XP Pro but it did nothing. For
reference, here is my accessibility settings in IE6:

http://www.melchior.us/ieissues/acc.gif

If I turn off the style sheet option, then here is what all the fonts look
like:

http://www.melchior.us/ieissues/font_big.gif

Now if I turn on the style sheet, this is what the fonts look like:

http://www.melchior.us/ieissues/font_small.gif

If anyone has any ideas how to fix this, please let me know! I've already
tried uninstalling and reinstalling IE but there was no luck. Please reply
soon.

Thank you,
Stephen Craton
Senior Executive Web Developer
Mophus.com, Inc.
Lead Programmer/Webmaster
WiredPHP (http://php.melchior.us)



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



Re: [PHP] Passing Serialized Array via Hidden field

2003-07-21 Thread CPT John W. Holmes
> --- Andrei Verovski <[EMAIL PROTECTED]> wrote:
> > I am need to pass serialized assotiative array via form hidden
> > field (not GET or POST).
>
> This is impossible. A hidden form field is simply a form field that is not
> displayed to the user. Form actions must be GET or POST.
>
> > In order to do it, I did the following: urlencode(serialize($my_array)).
>
> Don't URL encode the value of the form field, since the browser will take
care
> of that. You should probably use POST rather than GET, because serializing
an
> array might yield a very long string and make the URL too large for the
Web
> browser and/or Web server to handle.

I didn't see the original thread, but judging from the title, this is how
you'd do it:



And to retrieve:

$array = unserialize(stripslashes($_POST['serialized_array']));
(assuming magic_quotes_gpc is ON)

---John Holmes...


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



RE: [PHP] Changing numbers

2003-07-21 Thread Jay Blanchard
[snip]
I would like it at least 2 decimal places.. So, 5.2670 would be 5.267
not
5.27:
[/snip]

RTFM for formatted string http://us3.php.net/sprintf or
http://us3.php.net/printf

HTH

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



Re: [PHP] Passing Serialized Array via Hidden field

2003-07-21 Thread Chris Shiflett
--- John Manko <[EMAIL PROTECTED]> wrote:
> Just a small point, you can have both GET and POST.
> 
> -- search.html -
>  action='page.php?...

Notice your form method is POST, not both GET and POST. The HTTP request sent
after a user submits this form will be a POST request, even though you do have
GET variables. Try not to confuse GET/POST variables with GET/POST request
methods.

Chris

=
Become a better Web developer with the HTTP Developer's Handbook
http://httphandbook.org/

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



Re: [PHP] IE Issues

2003-07-21 Thread Stephen
Thank you so much! I now have to wonder how it got set to that. Probably my
brothers or that power surge a while back. Anyway, thanks again!

Thank you,
Stephen Craton
Senior Executive Web Developer
Mophus.com, Inc.
Lead Programmer/Webmaster
WiredPHP (http://php.melchior.us)


- Original Message - 
From: "Chris W. Parker" <[EMAIL PROTECTED]>
To: "Stephen" <[EMAIL PROTECTED]>
Sent: Monday, July 21, 2003 1:13 PM
Subject: RE: [PHP] IE Issues


Stephen 
on Monday, July 21, 2003 11:11 AM said:

> If I make a webpage that has  then IE will display the
> font at size 3 or 4. I have no idea why either. I have put a default
> style sheet on IE to make all the fonts a certain size but this is
> getting annoying since only some are getting resized.

Is your text scaled? That's the only reason I think of.

View > Text Size > Medium (default)

You might be on Larger or Largest.


c.

p.s. FIRST POST!!





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



RE: [PHP] IE Issues

2003-07-21 Thread Jaime Bozza
Ctrl-MouseWheel will increase or decrease the text size in an IE browser
window.  I've found that I've accidentally increased the font size since I
use the Mouse Wheel quite a bit.  (As well as CTRL-W to close an IE window
if one pops up)


Jaime Bozza


> -Original Message-
> From: Stephen [mailto:[EMAIL PROTECTED] 
> Sent: Monday, July 21, 2003 1:21 PM
> To: Chris W. Parker
> Cc: PHP List
> Subject: Re: [PHP] IE Issues
> 
> 
> Thank you so much! I now have to wonder how it got set to 
> that. Probably my
> brothers or that power surge a while back. Anyway, thanks again!
> 
> Thank you,
> Stephen Craton
> Senior Executive Web Developer
> Mophus.com, Inc.
> Lead Programmer/Webmaster
> WiredPHP (http://php.melchior.us)
> 
> 
> - Original Message - 
> From: "Chris W. Parker" <[EMAIL PROTECTED]>
> To: "Stephen" <[EMAIL PROTECTED]>
> Sent: Monday, July 21, 2003 1:13 PM
> Subject: RE: [PHP] IE Issues
> 
> 
> Stephen 
> on Monday, July 21, 2003 11:11 AM said:
> 
> > If I make a webpage that has  then IE will 
> display the
> > font at size 3 or 4. I have no idea why either. I have put a default
> > style sheet on IE to make all the fonts a certain size but this is
> > getting annoying since only some are getting resized.
> 
> Is your text scaled? That's the only reason I think of.
> 
> View > Text Size > Medium (default)
> 
> You might be on Larger or Largest.
> 
> 
> c.
> 
> p.s. FIRST POST!!
> 
> 
> 
> 
> 
> -- 
> 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] regexp help...

2003-07-21 Thread Doug La Farge
Hi all,

I have a string that for all practical purposes should probably be a 
list (array).  I need one line from the string and need to send the 
rest to /dev/null.

The string starts:
HTTP/1.1 200 OK
Date: Tue, 22 Jul 2003 01:34:12 GMT
Server: Apache/1.3.27 (Unix) mod_jk/1.1.0 mod_ssl/2.8.12 OpenSSL/0.9.6g
Set-Cookie: JSESSIONID=mngtpma6i1;Path=/Interface
Connection: close
Content-Type: text/html;charset=ISO-8859-1








 blah blah blah  



The String ends on the line above (white space line).

If I'm not mistaken the blank lines are actually a combo of unix and 
dos line returns.

any help is much appreciated.

thanks,

Re: [PHP] Changing numbers

2003-07-21 Thread John Nichel
zavaboy wrote:
*Sigh*, lets say I have:

2.65
3.3
5.2670
12.030
I would like it at least 2 decimal places.. So, 5.2670 would be 5.267 not
5.27:
2.65
3.30
5.267
12.03
"James Rodenkirch" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
try rounding it first

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

Zavaboy wrote:


What about if I had 2.856 that function will make it 2.86.

"Jay Blanchard" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
[snip]
How can I make them have at least 2 decimal places?
[/snip]
RTFM at http://www.php.net/number_format

HTH!




*Sigh*

RTFM - http://us4.php.net/sprintf

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


Re: [PHP] regexp help...

2003-07-21 Thread Doug La Farge
I guess I should point out that the line i want is the XML line 
'

On Monday, July 21, 2003, at 11:44 AM, Doug La Farge wrote:

Hi all,

I have a string that for all practical purposes should probably be a 
list (array).  I need one line from the string and need to send the 
rest to /dev/null.

The string starts:
HTTP/1.1 200 OK
Date: Tue, 22 Jul 2003 01:34:12 GMT
Server: Apache/1.3.27 (Unix) mod_jk/1.1.0 mod_ssl/2.8.12 OpenSSL/0.9.6g
Set-Cookie: JSESSIONID=mngtpma6i1;Path=/Interface
Connection: close
Content-Type: text/html;charset=ISO-8859-1








 blah blah blah  



The String ends on the line above (white space line).

If I'm not mistaken the blank lines are actually a combo of unix and 
dos line returns.

any help is much appreciated.

thanks,


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


Re: [PHP] Changing numbers

2003-07-21 Thread bob parker
On Tue, 22 Jul 2003 04:03, zavaboy wrote:
> *Sigh*, lets say I have:
>
> 2.65
> 3.3
> 5.2670
> 12.030
>
> I would like it at least 2 decimal places.. So, 5.2670 would be 5.267 not
> 5.27:
>

5.267 is 3 decimal places - count them

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



Re: [PHP] Changing numbers

2003-07-21 Thread John Nichel
bob parker wrote:
On Tue, 22 Jul 2003 04:03, zavaboy wrote:

*Sigh*, lets say I have:

2.65
3.3
5.2670
12.030
I would like it at least 2 decimal places.. So, 5.2670 would be 5.267 not
5.27:


5.267 is 3 decimal places - count them

He said "at least 2 decimal places", not "exactally two decimal places".

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


Re: [PHP] IE Issues

2003-07-21 Thread Stephen
Hmm, yeah, you're probably right. I probably did push CTRL+MouseWheel since
I use it a lot and CTRL+C. Thanks for the info.

The power surge did do a lot of funky stuff to my files. I found bits of
messed up code here and there and my date was set to 2069. Thank goodness
for System Restore. ^_^ Thanks again!

Thank you,
Stephen Craton
Senior Executive Web Developer
Mophus.com, Inc.
Lead Programmer/Webmaster
WiredPHP (http://php.melchior.us)


- Original Message - 
From: "Chris W. Parker" <[EMAIL PROTECTED]>
To: "Stephen" <[EMAIL PROTECTED]>
Sent: Monday, July 21, 2003 1:29 PM
Subject: RE: [PHP] IE Issues


Stephen 
on Monday, July 21, 2003 11:21 AM said:

> Thank you so much! I now have to wonder how it got set to that.
> Probably my brothers or that power surge a while back. Anyway, thanks
> again!

Maybe it was your brothers but definitely not a power surge. If a power
surge were to interfere with your computer in a negative way it wouldn't
change the size of your font in IE.

Do you have a scroll wheel on your mouse? Is it possible you pressed
Ctrl-Scroll up/down at the same time at any point? Probably. That's the
most likely situation. It's really a handy tool, try it out.


c.





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



[PHP] can't restart session

2003-07-21 Thread Chris W. Parker
Hello,

PHP 4.2.2

I'm working on a cart program right now and I can't properly log the
user out. The only way I've been able to get a different session id is
by closing all browser windows and reloading the site.

Scenario:

I go the site I'm working on and click the login page. I have 'echo
session_id();' in the login page so I can see the session id. I fill in
my username and password and click "login". I'm then sent to a
processing page that actually fills in the session variable with some
data (i.e. username, session id, security level, etc.). I then redirect
back to the login page with header("Location: login.php");.

Now that I'm back at the login page I still see my session id (and as
expected it is the same). Then I click "logout" and am taken to a logout
page. The logout page is as follows:



Here is another version of the same file that I've tried using:




As far as I have been able to find out (by surveying other people and
RTFM'ing) I'm doing it correctly, but for some it's just not working.

After I click logout I would expect to be sent back to the login page
and see a different session id displayed, but instead I'm presented with
the same session id. The only way I can get a different session id is by
closing all the browser windows and starting over.


Anyone have any ideas?


Thanks,
Chris.

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



  1   2   >