|
Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com |
From: php-general-digest-help
lists.php.netDate: Wed Mar 07 2001 - 04:21:47 CST
php-general Digest 7 Mar 2001 10:21:47 -0000 Issue 552
Topics (messages 42815 through 42886):
Problem with either timing or large data structures...
42815 by: Eric Nielsen
Re: Please Help!!!! - Really BASIC stuff!
42816 by: Jon Snell
Problem using readfile
42817 by: Matias Pelenur
passing variables
42818 by: george
42820 by: Hoover, Josh
e-commerce software
42819 by: Justin French
42822 by: rui.websolut.net
Please Help....
42821 by: Jeff Pearson
Q: php4,cache,performance,mod_perl,zend cache, APC
42823 by: Joe Rice
adding support to previous build with apxs
42824 by: Brett
2 questions about performance...
42825 by: Joe Sheble \(Wizaerd\)
42833 by: Chris Lee
passing a variable
42826 by: george
42827 by: Rick St Jean
Re: Oppinion on get_meta_tags
42828 by: Sean R. Bright
are sessions single threaded?
42829 by: Bill Rausch
42830 by: Ernest E Vogelsinger
Still an Almost working Regex
42831 by: Murray Shields
42851 by: CC Zona
MIME and headers
42832 by: Peter Houchin
42834 by: David Robley
more imap problems, spec speed
42835 by: Chris Lee
File Upload
42836 by: Cedric Veilleux
Test if File Exist, if not, use default file name
42837 by: Andrew V. Romero
42838 by: Alan Ward
Templates - Perl to PHP
42839 by: Marco Aurélio
42840 by: Michael Kimsal
How to sort a 2D array?
42841 by: Zenith
Creating a gif thumbnail, without the libgd1.6 or earlier version!
42842 by: Zenith
42843 by: Philip Murray
obtain IP from other site ( or domain name)
42844 by: Jacky.lilst
42845 by: Nuno Silva
42846 by: Philip Olson
42848 by: Jason Murray
Uploading files
42847 by: Daniel Lynn
42876 by: Ankur Verma
MySQL help URGENT
42849 by: Deependra B. Tandukar
42853 by: David Robley
Re: members page
42850 by: Scott Brown
Re: removing and item out of a string
42852 by: CC Zona
Next month
42854 by: Tyler Longren
42856 by: Jason Brooke
Value of if(isset(X)) problem
42855 by: Martin Skjöldebrand
Re: exec timing out, want to leave process running in bg
42857 by: Mukul Sabharwal
42873 by: Christian Reiniger
Re: Session not destroying properly
42858 by: Mike Yuen
42859 by: Andrew Halliday
42860 by: Robert Cooper
How to get oid after table insert? [postgresql]
42861 by: Allen Unrau
Installation on RH6.2: help!
42862 by: Les Neste
42863 by: David Robley
session_start
42864 by: Jacky.lilst
42866 by: Nick Norton
42867 by: Matthieu Le Corre
42868 by: Matthieu Le Corre
42871 by: Ankur Verma
session continue
42865 by: Jacky.lilst
42869 by: Matthieu Le Corre
session in php3
42870 by: Jacky.lilst
42874 by: Maxim Derkachev
How to completly remove a file?
42872 by: Jan Grafström
42875 by: Ankur Verma
Re: PHP & Apache 2.0 - NOT WORKING ?
42877 by: Benoit
$B!ZCmL\%5%$%H$N$40FFb![(B
42878 by: Mail-In
problem in downloading mysql
42879 by: B Satish , Gurgaon
Re: ezmlm response
42880 by: B Satish , Gurgaon
search
42881 by: AJDIN BRANDIC
ldap
42882 by: Alain ROMERO
PHP dll on NT - more reliable with Apache than IIS?
42883 by: Greig, Euan
Error with ldap
42884 by: Alain ROMERO
file access(mpeg) only for authenticated people
42885 by: Thorsten Gutermuth
42886 by: Mukul Sabharwal
Administrivia:
To subscribe to the digest, e-mail:
php-general-digest-subscribe
lists.php.net
To unsubscribe from the digest, e-mail:
php-general-digest-unsubscribe
lists.php.net
To post to the list, e-mail:
php-general
lists.php.net
----------------------------------------------------------------------
attached mail follows:
I'm not exactly sure what is causing the behavior, but I suspect its either
a timing or memory issue. My development machine is stronger than the
server the code is being deployed on which is what leads to me to suspect
one of the above problems.
I have a function that creates a very large html table from several sql
calls. It returns the table as a string to the calling page, which then
displays it. This table currently has a max size of about 45Kb with larger
html tables possible. On my production machine everything went fine. On
the server the table ends early. But the loops runs to the end, apparently
it stops concatenating at some point.
To get around this I tried splitting the single string into an array of
strings with each cell in the array holding one row of the table, with two
additional rows holding the table/heading tags and close table tags. Once
again everything works on the development machine. On the server however,
in two locations the table rows are corrupted. In one case it ends the row
early (an echo of the value before it is assigned to the array is correct).
In the other case it concatenates two rows, which is similarly not supported
by my debug echo's. Neither case is a boundary case, occurring in the later
half of the table.
Can anyone offer any advice?
Eric
attached mail follows:
Be very careful with this construct. It is generally a bad idea to do any
sort of file opening/loading where the file name comes directly from user
input.
If you were naive enough to use this line:
include("$page.txt");
I could call your php script with ?page=http://mysite.com/dumpyourdatabase
PHP would then load and execute something like this:
http://mysite.com/dumpyourdatabase.txt
An entry could be added to the MySQL.User table from the code in this script
allowing remote access or many other things.
If you decide you really want something like this, it would be a great idea
to run a regular expression on $page and erase any non-letter characters.
Also, as a general reminder, make sure your database permissions are set up
properly for the MySQL user your database is running under (generally they
should not have access to the MySQL table, and only be allowed to
insert/select/update to the database the website works with).
Jon Snell
-----Original Message-----
From: Nick Norton [mailto:norton
azsites.com]
Sent: Tuesday, March 06, 2001 3:57 PM
To: php-general
lists.php.net
Subject: RE: [PHP] Please Help!!!! - Really BASIC stuff!
Just put the following instead of a long switch and keep your file naming
conventions consistent
include("side_$page.txt");
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribelists.php.net For additional commands, e-mail: php-general-help
lists.php.net To contact the list administrators, e-mail: php-list-admin
lists.php.net
attached mail follows:
Hi, I'm trying to use readfile to send a file to the browser. The code I'm using is:
header("Content-length: $size"); header("Content-type: $type"); header("Content-disposition: attachment;filename=$filename"); readfile($filename);
It works fine for very small files, but for larger files it seems to send only the first 600 bytes and then hang... I tried with both IE and Netscape and have the same problem.
I'm using Apache 1.3.14 and PHP/4.0.4pl1 on Win2000 (using the PHP module for Apache)
Any hints appreciated. Thanks! --Matias
If you reply via email, please remove the -nospam- from the address.
attached mail follows:
I am trying to build a dynamic form, and I am using the code below to let the user ,name the fields that are generated,but i want to give the user the option of changing the field size but I cant get it to work.
TIA george
for ($i=0; $i < $fields; $i++) { $fieldName = "field$i";
echo "<tr><td><input type=text name=\"$fieldName\" value=\"${$fieldName}\">\n";
}
echo "<input type=hidden name=\"fields\" value=\"$fields\">\n</td></tr>";
attached mail follows:
Do you mean you want them to be able to say how long a text field should be? If so, try this:
for ($i=0; $i < $fields; $i++) { $fieldName = "field$i";
echo "<tr><td><input type=text name=\"$fieldName\" value=\"${$fieldName}\" size=\"$size\">\n"; }
$size would be a form parameter that you allow the user to set along with the field name and value.
Josh Hoover KnowledgeStorm, Inc.
Searching for a new IT solution for your company? Need to improve your product marketing? Visit KnowledgeStorm at www.knowledgestorm.com to learn how we can simplify the process for you. KnowledgeStorm - Your IT Search Starts Here
> I am trying to build a dynamic form, and I am using the code > below to let > the user ,name the fields that are generated,but i want to > give the user the > option of changing the field size but I cant get it to work.
attached mail follows:
Hi,
I'm currently using a perl/CGI developed e-commerce/website management tool which incorporates sessions (the ability to shop anywhere in the site, not just in a shop), members, member management, rewards points, mailing lists, statistics, and a complete separation of code and layout (so that the same code can be reconfigured for a new client with maybe only a day or hour of work).
It uses DB Files instead of a database. It also uses a windows GUI, which I want to replace with a web GUI for adding and deleting products, making categories, etc etc, maybe tied in with an excell spreadsheet or a windows based dbase.
The problem is, I didn't write the code, i'm only buying a license to use it on each site, which is eating a bit chunk of my profit away. On top of that, the developer is looking at selling the code to someone else soon, which will make it harder, if not impossible to get the code. So, before that happens, i'm looking into other options, including writing new code, or extending pre-existing code.
So far I've been looking at pre-existing apps and code snippets available at zend.com, but I'm hoping that some developers out there either have an app, or have used/extended an app to suit their needs, which they may be able to recommend.
Yes, I'm prepared to pay for decent code, it doesn't have to be free, but I would have to spend a long time evaluating it before buying it.
At this stage (unless people advise me otherwise), I plan to use FreeBSD, PHP4 and MySQL as the platform.
I'm not realy interested in anything that relies on javascript, java or cookies to run (i'd preffer sessions and server-side calculations), and i'd prefer something that is website based, not shop based (sessions can be used site wide, etc etc).
Yeah yeah, I know I'm asking a lot :)
Has anyone got any recommendations, or maybe anyone in Australia want to start developing one with me?
Kind Regards,
Justin French Creative Director Indent.com.au
attached mail follows:
hi, i think what you're looking for is something like phpshop you may find it in www.edikon.org, and it's free.
On 06-Mar-2001 Justin French wrote:
> Hi,
>
> I'm currently using a perl/CGI developed e-commerce/website management
> tool which incorporates sessions (the ability to shop anywhere in the
> site, not just in a shop), members, member management, rewards points,
> mailing lists, statistics, and a complete separation of code and layout
> (so that the same code can be reconfigured for a new client with maybe
> only a day or hour of work).
>
> It uses DB Files instead of a database. It also uses a windows GUI,
> which I want to replace with a web GUI for adding and deleting products,
> making categories, etc etc, maybe tied in with an excell spreadsheet or
> a windows based dbase.
>
>
> The problem is, I didn't write the code, i'm only buying a license to
> use it on each site, which is eating a bit chunk of my profit away. On
> top of that, the developer is looking at selling the code to someone
> else soon, which will make it harder, if not impossible to get the code.
> So, before that happens, i'm looking into other options, including
> writing new code, or extending pre-existing code.
>
>
> So far I've been looking at pre-existing apps and code snippets
> available at zend.com, but I'm hoping that some developers out there
> either have an app, or have used/extended an app to suit their needs,
> which they may be able to recommend.
>
> Yes, I'm prepared to pay for decent code, it doesn't have to be free,
> but I would have to spend a long time evaluating it before buying it.
>
>
> At this stage (unless people advise me otherwise), I plan to use
> FreeBSD, PHP4 and MySQL as the platform.
>
>
> I'm not realy interested in anything that relies on javascript, java or
> cookies to run (i'd preffer sessions and server-side calculations), and
> i'd prefer something that is website based, not shop based (sessions can
> be used site wide, etc etc).
>
>
> Yeah yeah, I know I'm asking a lot :)
>
>
> Has anyone got any recommendations, or maybe anyone in Australia want to
> start developing one with me?
>
>
> Kind Regards,
>
> Justin French
> Creative Director
> Indent.com.au
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
Rui Barreiros Software Developer
WEBSOLUT - Soluções Internet
Emailto: rui
websolut.net
Personal Info: http://websolut.net/people/rui.html
As informações contidas neste email são confidenciais e destinam-se apenas à(s) pessoa(s) a quem foi enviado: http://websolut.net/confidencialidade-responsabilidade.html
attached mail follows:
Warning: SQL error: [Microsoft][ODBC Driver Manager] Invalid string or buffer length, SQL state S1090 in SQLConnect in z:\webspace\1001010\tijerascanyonward.org\www\default.php on line 30 Couldn't make a connection!
I have a MS Access db setup as a DSN on a web server running NT and PHP. When I try to connect with the following code(obviously the *'s in the code are the real information), I get the above error message. Any help would be GREATLY appreciated if anyone could help me figure out why......
$connection = odbc_connect("DSN=*******;UID=*********;PWD=*********","",""); if (!$connection) { echo "Couldn't make a connection!"; exit; }
Thanks againg for any help that can be offered.
Jeff Pearson
attached mail follows:
Hi, As you might gather from the subject, i'm trying to make a decision. Before that i'm doing research to find out what best fits. My question is;
From what i've read php4 does post-compilation caching, is this right? If so, what is the point of Zend Cache or APC (Alternative PHP Cache)? I know from experience that mod_perl does copy and run from a compiled version of the script into memory. From the description of Zend Cache and APC they sound like the equivalent for php4. I guess what i'm getting at is is php4 as fast as mod_perl or do i need something like zend cache? also, is there anywhere with stated benchmarks that i can see to compare?
Thanks, joe
attached mail follows:
About a year ago Rasmus gave instructions on how to add support to a php binary without recompiling using apxs. It was something like configure, make and copy files to somewhere or something like that. He also said it was documented in the manual but I have not been able to find any instructions. So does anyone have some instructions on how this is done. I would appreciate any input.
Thanks, Brett
attached mail follows:
Is it in-efficient to use shuffle()? I have a simple 6 element array with 6 strings (URLs to images) and I'm using shuffle() to display all of them in random order upon each page load. The images take a long time (of course is relative, it's mere seconds) but when I remove the call to shuffle, they appear much much faster...
Also, is there an efficient number or limit of queries one should call in a singular PHP page? On average, I'll make 7-10 seperate queries to display a page (a graphics related portal and content management system)... I have a singular database connection (with mysql_pconnect()) and use that same connection throughout the script. Sometimes it appears to load quickly, than other times it doesn't, and I'm afraid that as more and more content get put into the databases, the slower it will perform.
user authentication navigation (link definitions) form dropdowns (dynamic selects) banner rotation (2 sets, big and small) activity tracker headline or story retrieval comments
Joseph E. Sheble a.k.a. Wizaerd Wizaerd's Realm Canvas, 3D, Graphics, ColdFusion, PHP, and mySQL http://www.wizaerd.com =================================
attached mail follows:
simplest answer is find out yourself. every machine will depending on config and hardware will be difffernet.
<?php
function mtime()
{
$mtime = microtime();
$mtime = str_replace('.', '', $mtime);
$mtime = explode(' ', $mtime);
$mtime = $mtime[1] . $mtime[0];
return($mtime);
}
class debug
{
function debug()
{
$this->start = mtime();
}
function reset()
{
$all_vars = get_object_vars($this);
foreach($all_vars as $pos => $val)
if ($pos != 'error')
unset($this->$pos);
}
function time($text = '')
{
$this->break = mtime();
$time = ($this->break - $this->start) / 1000000000;
echo number_format($time, 4) .' '. $text ."<br>\n";
$this->start = $this->break;
}
}
$debug = new debug;
//-------------------------------------------------------------------
$debug->time('start');
// code snippit
$debug->time('end');
?>
works great or me. you can find out exactly where your code is slowing you down, only thing is now to find out how to improve that :)
--
Chris Lee
Mediawaveonline.com
ph. 250.377.1095
ph. 250.376.2690
fx. 250.554.1120
lee
mediawaveonline.com
""Joe Sheble (Wizaerd)"" <JustForMailingLists
wizaerd.com> wrote in message news:NEBBJIOOOLABHKDFACGHKEEPDMAA.JustForMailingLists
wizaerd.com...
Is it in-efficient to use shuffle()? I have a simple 6 element array with 6
strings (URLs to images) and I'm using shuffle() to display all of them in
random order upon each page load. The images take a long time (of course is
relative, it's mere seconds) but when I remove the call to shuffle, they
appear much much faster...
Also, is there an efficient number or limit of queries one should call in a
singular PHP page? On average, I'll make 7-10 seperate queries to display a
page (a graphics related portal and content management system)... I have a
singular database connection (with mysql_pconnect()) and use that same
connection throughout the script. Sometimes it appears to load quickly,
than other times it doesn't, and I'm afraid that as more and more content
get put into the databases, the slower it will perform.
user authentication
navigation (link definitions)
form dropdowns (dynamic selects)
banner rotation (2 sets, big and small)
activity tracker
headline or story retrieval
comments
Joseph E. Sheble
a.k.a. Wizaerd
Wizaerd's Realm
Canvas, 3D, Graphics,
ColdFusion, PHP, and mySQL
http://www.wizaerd.com
=================================
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
For additional commands, e-mail: php-general-help
lists.php.net
To contact the list administrators, e-mail: php-list-admin
lists.php.net
attached mail follows:
I am trying to build a dynamic form, and I am using the code below to let the user ,name the fields that are generated,but i want to give the user the option of changing individual field sizes but I cant get it to work.
TIA george
for ($i=0; $i < $fields; $i++) { $fieldName = "field$i";
echo "<tr><td><input type=text name=\"$fieldName\" value=\"${$fieldName}\">\n";
}
echo "<input type=hidden name=\"fields\" value=\"$fields\">\n</td></tr>";
attached mail follows:
George you are doing this backwards. Someone posted the code to do this the right way last night. I would use the concatination of a third variable.
$field = "blah"; $loops = 10; for ($i=0; $i < $loops; $i++) { $displayField = $field . $i; echo "<tr><td><input type=text name=\"$field\" value=\"$displayField\">\n"; }
Rick
At 11:31 PM 3/6/01 +0000, george wrote:
>I am trying to build a dynamic form, and I am using the code below to let
>the user ,name the fields that are generated,but i want to give the user the
>option of changing individual field sizes but I cant get it to work.
>
>TIA
>george
>
>for ($i=0; $i < $fields; $i++)
>{ $fieldName = "field$i";
>
> echo "<tr><td><input type=text name=\"$fieldName\"
> value=\"${$fieldName}\">\n";
>
>}
>
> echo "<input type=hidden name=\"fields\"
> value=\"$fields\">\n</td></tr>";
>
>
>
>
>
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
>For additional commands, e-mail: php-general-help
lists.php.net
>To contact the list administrators, e-mail: php-list-admin
lists.php.net
##########################################################
# Rick St Jean,
# rstjean
internet.look.ca
# President of Design Shark,
# http://www.designshark.com/
# Quick Contact: http://www.designshark.com/messaging.ihtml
# Tel: 905-684-2952
##########################################################
attached mail follows:
Ladies/Gents:
I recently fixed a long standing bug in get_meta_tags and have been asked by users to fix some other issues as well. I am curious to know how many of you are actually using this function and in what way. Currently, get_meta_tags returns an associative array, like this:
$resultval["keywords"] = "these,are,my,keywords" $resultvar["something"] = "something else"
My changes would result in change to the return value so that instead of returning a single dimensional array, you would get a multidimensional array as follows:
$returnval[0]["http-equiv"] == "refresh" $returnval[0]["content"] == "10;http://www.php.net/"
$returnval[1]["name"] == "keywords" $returnval[1]["content"] == "hello" $returnval[1]["lang"] == "en"
$returnval[2]["name"] == "keywords" $returnval[2]["content"] == "hola" $returnval[3]["lang"] == "es"
Where each index (0, 1, 2) refer to the 1st, 2nd and 3rd META tags on the page.
All and all, my new implementation will support all of the attributes for META tags, including HTTP-EQUIV, NAME, CONTENT, LANG, and DIR.
If I could get a general feel for how many PHP users out there are using this function, it would save me some time in the long run.
Thanks,
===================================================================
Sean Bright
elixer
erols.com / sean
seanbright.com / http://www.seanbright.com/
===================================================================
attached mail follows:
What I mean is, if a user is connected to a php page that uses sessions and that is involved in a time consuming operation (say 20 seconds or more) before returning an answer, and the user also opens a second window in the same browser to connect to another page in the same site that uses sessions the second window will hang till the first operation is complete.
While testing, I was able to show that if I don't use sessions this doesn't happen.
I need to use sessions and would like to allow users to have multiple windows connected to my site (it is an intranet application).
Apache 1.3.12 with PHP 4.0RC2 (it's just a test site at the moment)
--- Bill Rausch, Software Development, Unix, Mac, Windows Numerical Applications, Inc. 509-943-0861 billnumerical.com
attached mail follows:
At 00:56 07.03.2001, Bill Rausch said: --------------------[snip]-------------------- >What I mean is, if a user is connected to a php page that uses sessions and >that is involved in a time consuming operation (say 20 seconds or more) >before returning an answer, and the user also opens a second window in the >same browser to connect to another page in the same site that uses sessions >the second window will hang till the first operation is complete. > >While testing, I was able to show that if I don't use sessions this doesn't >happen. > >I need to use sessions and would like to allow users to have multiple >windows connected to my site (it is an intranet application). --------------------[snip]--------------------
try not to use cookies - use session keys via URL/hidden form fields. This way multiple browser connects can have multiple session keys, and you won't "hang"
...ebird
>O Ernest E. Vogelsinger (\) http://www.1-at-web.at/ ^ ICQ# 13394035
attached mail follows:
I have a working regex as below, used for validating data input:
$Status = (ereg("^(^[A-Za-z0-9` !
#$%&()=:;\"\'.?/^|{}-]*)(.*)$", $String,
$List));
It is definitely working as expected.
I need to add the square brackets [ ] to the above list of allowed characters. However, this does not work. The regex does not produce an error message, but instead accepts all characters as valid.
I have tried escaping them, ie: \[\]
I have tried encoding them as HEX, ie: \x5b\x5d
However, the same problem occurs in both circumstances.
Can anyone please help me?
======================================================================
Murray Shields Email: murray
globalcat.com.au
MU Systems Pty Ltd Phone: +61 7 3351 6677
Global Catalogs Pty Ltd Phone: +61 7 3351 4777
attached mail follows:
In article <002d01c0a69a$ea2c9aa0$1e01a8c0
mu.com.au>,
murray
mu.com.au ("Murray Shields") wrote:
> $Status = (ereg("^(^[A-Za-z0-9` !
#$%&()=:;\"\'.?/^|{}-]*)(.*)$", $String,
> $List));
>
> It is definitely working as expected.
>
> I need to add the square brackets [ ] to the above list of allowed
> characters.
According to the manual <http://php.net/manual/en/ref.regex.php>,
"These functions all take a regular expression string as their first argument. PHP uses the POSIX extended regular expressions as defined by POSIX 1003.2. For a full description of POSIX regular expressions see the regex man pages included in the regex directory in the PHP distribution. It's in manpage format, so you'll want to do something along the lines of man /usr/local/src/regex/regex.7 in order to read it. "
If you do not have access to manpages at the commandline, note that they are also widely republished on the web. A quick search on <http://www.google.com/search?q=posix+1003%2E2+regular+expressions> reveals:
"A bracket expression is a list of characters enclosed in `[ ]'. It normally matches any single character from the list (but see below). If the list begins with `^', it matches any single character (but see below) not from the rest of the list." <snip>
"To include a literal `]' in the list, make it the first character (following a possible `^')."
-- CC
attached mail follows:
Can some one please tell me what the relationship between mime and email headers is ....I have not been able to find a straight answer off the net ..so if any one knows of a good site can you please give me the url so i can look at it .. thanks
Peter Houchin
Sun Rentals
peterh
sunrentals.com.au
attached mail follows:
On Wed, 7 Mar 2001 10:46, Peter Houchin wrote:
> > Can some one please tell me what the relationship between mime and
> email headers is ....I have not been able to find a straight answer off
> the net ..so if any one knows of a good site can you please give me the
> url so i can look at it .. thanks
Peter Houchin
> Sun Rentals
> peterh
sunrentals.com.au
>
You might want to dig into the RFCs to get the real lowdown here. RFC822 is the original for email (Updated by RFC1123, RFC1138, RFC1148, RFC1327, RFC2156), and 1344 and 1522 might be starting points for MIME.
This URL is an index of all the RFCs (big document ~400Kb) http://mirror.aarnet.edu.au/pub/rfc/rfc-index.txt
-- David Robley | WEBMASTER & Mail List Admin RESEARCH CENTRE FOR INJURY STUDIES | http://www.nisu.flinders.edu.au/ AusEinet | http://auseinet.flinders.edu.au/ Flinders University, ADELAIDE, SOUTH AUSTRALIA
attached mail follows:
ok, Ive now been able to fetch news headers, but boy is it slow. to fetch 10 out of 430 headers your looking at 19sec.
news://news.php.net/php.gtk
$headers = imap_fetch_overview($this->mail_stream, "427:437");
is slow... oi. any ideas on speed ?
--
Chris Lee
Mediawaveonline.com
ph. 250.377.1095
ph. 250.376.2690
fx. 250.554.1120
lee
mediawaveonline.com
attached mail follows:
Hi,
I have problems with Post File Uploads... When trying to upload very small files it works, although my browser timeouts or I get a Server Hangup Description: Server Hangup message
Is it Apache that times out?
I am wondering what is causing this and what can be done..
Thank you,
Cedric Veilleux
attached mail follows:
Lately I have been working on a script and my plan is to have the URL pass an initial variable to the script. So for example, the URL would be http://WhereEverServer.com?questionFileName=testQA. This variable called questionFileName is the name of a file (without the extension) that the script will use to pull a series of questions from.
What I would like to have the script do is to check if a variable was passed, and to check if the file name passed actually exist. If either case is false then I would like to have it check if the file testQA exist and if so then the script would run using this test file, if not then the script would just terminate giving the user an error message. I was wondering how you would do this?
Right now I have it semi-working, but it is very convoluted and if the variable is not passed it displays a "Warning: Undefined variable: questionFileName in c:\server\apache\htdocs\survey\questionanswer.phtml". Ideally it would not display this message and just check if the testQA file is around and if not then just terminate with an error message of my choice.
-Thanks for any ideas, Andrew V. Romero To reply personally, remove all numbers from my address.
attached mail follows:
Try this:
if (file_exists("filename")) { echo "Error"; }
-AL
>
> What I would like to have the script do is to check if a variable was
> passed, and to check if the file name passed actually exist. If either
> case is false then I would like to have it check if the file testQA
> exist and if so then the script would run using this test file, if not
> then the script would just terminate giving the user an error message.
> I was wondering how you would do this?
>
> Right now I have it semi-working, but it is very convoluted and if the
> variable is not passed it displays a "Warning: Undefined variable:
> questionFileName in
> c:\server\apache\htdocs\survey\questionanswer.phtml". Ideally it
> would not display this message and just check if the testQA file is
> around and if not then just terminate with an error message of my
> choice.
>
> -Thanks for any ideas,
> Andrew V. Romero
> To reply personally, remove all numbers from my address.
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
>
attached mail follows:
Hello!
Do you know Links 2.0 by Gossamer-Threads ?
Well, this perl script uses a template engine(annexed file) based in a modification of CGI::FastTemplate that give a useful flexibility for webdesigners. The facilities are that webdesigners can use logical functions in his tags on templates (actually if, if not, >, <, = =, != ) eg:
{IF IMAGE} <p> <img src="{IMAGE}"> <br> <br> {ENDIF}
Thus all code between the if statement will be printed if $image is set else nothing will be.
This is very useful when you have a list of elements that someone have some elements and others not, eg:
1) The template without this enhancement:
<p> <img src="{IMAGE}"><br><br> {NAME}<br> {EMAIL}
Thus if the current user doesn't have a image the <p>, <img> and <br><br> tags will be printed in any way.
2) The template with the enhancement:
{IF IMAGE} <p> <img src="{IMAGE}"> <br> <br> {ENDIF} {NAME}<br> {EMAIL}
Thus if the current user doesn't have a image the <p>, <img> and <br><br> tags will not be printed in any way, maintaining the desired design. THIS IS GREAT !!!
Note)
Also, would be excellent if we have the following options on tags:
1) include a file not parsed (straight include of HTML) (allows php code) 2) include a file parsed (parse the include file for tags) (allows php code)
Is possible to convert the Template.pm (see annexed file) by Gossamer to php class ???
Kindest Regards,
Marco Aurélio
Brazil
marco
twd.com.br
BTW(a), I tried dozen based FastTemplates engines but anyone have the functions of Template.pm.
BTW(b): 1) Can you understand me ??? (sorry for my poor english.) 2) If have any cost, please tell me. 3) Please answer me, I really need it.
attached mail follows:
Hola - your English is mucho better than my Spanish (or is it Portguese in Brazil?) sorry!
I assume you're looking for PHP code equivalents for this, correct?
Is there any reason you can't just put the code in your template?
<? if ($image) { ?> <p> <img src="<?=$image;?>"> <br> <br> <? } else { ?> <?=$name;?> <? } ?>
That would do it just as well. Admittedly, there's more < > and ? than you might like, but it's as functional (if not more so) and it's one less thing for your script to process at the end of the day.
Marco Aurélio wrote:
> Hello! > ... > {IF IMAGE} > <p> > <img src="{IMAGE}"> > <br> > <br> > {ENDIF} > > Thus all code between the if statement will be printed if $image is set else > nothing will be. > > This is very useful when you have a list of elements that someone have some > elements and others not, eg: > > 1) The template without this enhancement: > > <p> > <img src="{IMAGE}"><br><br> > {NAME}<br> > {EMAIL} > > Thus if the current user doesn't have a image the <p>, <img> and <br><br> > tags will be printed in any way. > > 2) The template with the enhancement: > > {IF IMAGE} > <p> > <img src="{IMAGE}"> > <br> > <br> > {ENDIF} > {NAME}<br> > {EMAIL} > > Thus if the current user doesn't have a image the <p>, <img> and <br><br> > tags will not be printed in any way, maintaining the desired design. THIS IS > GREAT !!! > > Note) > > Also, would be excellent if we have the following options on tags: > > 1) include a file not parsed (straight include of HTML) (allows php code) > 2) include a file parsed (parse the include file for tags) (allows php code) > > Is possible to convert the Template.pm (see annexed file) by Gossamer > to php class ???
It probably is, if anyone wants to take a stab, but we generally just use the method I described above.
attached mail follows:
IF: $2D[] = array ( 'name'=>"Jacky", 'year'=>"2001", 'tel'=>"982736", 'gender'=>"Male" ); $2D[] = array ( 'name'=>"Jessica", 'year'=>"1999", 'tel'=>"349291", 'gender'=>"Felmale" );
How can I sort the array by 'name' or 'year', or other key efficiently?
attached mail follows:
How to create some thumbnail, from orginally a GIF image, to a GIF thumbnail. I dun't the libgd 1.6 or before. Or can we just use libgd1.8 , open a GIF image, and create a thumbnail with PNG format?
attached mail follows:
Try using ImageMagick on the command line via System() or Exec() or whatever.
================================-=--==- -- - --
Philip Murray
me
philth.net.nz
----- Original Message -----
From: "Zenith" <zenith
linuxmail.org>
To: <php-general
lists.php.net>
Sent: Monday, March 06, 2000 3:12 PM
Subject: [PHP] Creating a gif thumbnail, without the libgd1.6 or earlier
version!
> How to create some thumbnail, from orginally a GIF image, to a GIF
> thumbnail.
> I dun't the libgd 1.6 or before.
> Or can we just use libgd1.8 , open a GIF image, and create a thumbnail
with
> PNG format?
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
>
>
attached mail follows:
Hi people
I have exchange link business program with other sites, basically I give a hyper link to come to our store to them and when user click on the link on their site to come to us, they will genrate income from it too.
The question is that how do I know that when a user click on the link to come to my site that a user come from the link from their site , or from their IP or something. So that I can tell where a user come from.
Is this something to do with http header?
Jack
jacky
activelifestyle.com
"There is nothing more rewarding than reaching the goal you set for yourself"
attached mail follows:
Hi, you can that a look at the REFERER header... but some browsers don't include it and is very easy to modify...
If it isn't a problem for you, add the site id to the link: http://my.site.com/exchange?site=friend
...this tell's you the ID, but someone can enter it directly in the browser, too :)
Search this months archive for REFERER and you'll find some solutions, but none is bullet proof, IMHO.
Good luck :) Nuno Silva
Jacky
lilst wrote:
> Hi people
> I have exchange link business program with other sites, basically I give a hyper link to come to our store to them and when user click on the link on their site to come to us, they will genrate income from it too.
> The question is that how do I know that when a user click on the link to come to my site that a user come from the link from their site , or from their IP or something. So that I can tell where a user come from.
> Is this something to do with http header?
> Jack
> jacky
activelifestyle.com
> "There is nothing more rewarding than reaching the goal you set for yourself"
attached mail follows:
A couple ways are :
1. Setup an affiliate link for them to use :
http://www.you.com/foo.php?affiliate=them
They'd stick that link on their site. Variable $affiliate will tell you the hit came from their (them) site. You log this information and analyze and fight over the validity of it with them. No doubt they'll also track outgoing hits so they may do something like :
go.php?url=http://www.you.com/foo.php?affiliate=them
But I digress.
2. Use HTTP_REFERER and watch your server logs. See above.
3. Use a third party such as linkshare or befree or something similar to track such information for you. Although don't think you're at this point yet :-)
The variable your subject is requesting is : HTTP_REFERER. Search google for this variable and much information will come about. It'll *usually* give you the exact referring url.
Regards,
Philip Olson http://www.cornado.com/
On Wed, 7 Mar 2001, Jacky
lilst wrote:
> Hi people I have exchange link business program with other sites,
> basically I give a hyper link to come to our store to them and when
> user click on the link on their site to come to us, they will genrate
> income from it too. The question is that how do I know that when a
> user click on the link to come to my site that a user come from the
> link from their site , or from their IP or something. So that I can
> tell where a user come from. Is this something to do with http
> header? Jack jacky
activelifestyle.com "There is nothing more
> rewarding than reaching the goal you set for yourself"
>
attached mail follows:
> I have exchange link business program with other sites, > basically I give a hyper link to come to our store to them > and when user click on the link on their site to come to us, > they will genrate income from it too. > The question is that how do I know that when a user click on > the link to come to my site that a user come from the link > from their site , or from their IP or something. So that I > can tell where a user come from. > Is this something to do with http header?
You can look at $HTTP_REFERER, but its not reliable. Better to tell them to use linking code that specifically has a parameter in it that your receiving PHP script can pick up.
Instead of http://www.yoursite.com/ give them that with ?linkid=X so you could track clickthroughs.
Jason
attached mail follows:
I seem to be having a lot of trouble uploading a file using the post method.
I've read through a good amount of code and tutorials and can't seem to find anything wrong with my code. We're running this in the latest PHP 3 version on two different servers (one NT and the other OpenBSD). Now, it works if we are using the page from the actual NT server, but not from any other computers on he LAN. We haven't been able to get it to work at all on the OpenBSD server, though we can't test it drectly from that computer.
ok, here is the code I'm using for the form to upload the file:
<FORM ENCTYPE="multipart/form-data" ACTION="index.php3" METHOD=POST> <INPUT TYPE="hidden" name="MAX_FILE_SIZE" value="1000000"> <input type="hidden" name="SCREEN" value="uploadimage"> <input type="hidden" name="faction" value="createimages">
<?php
print("<input type=\"hidden\" name=\"item\" value=\"" . $item . "\">\n"); print("<input type=\"hidden\" name=\"department\" value=\"" . $department . "\">\n");
?>
Send this file: <INPUT NAME="userfile" TYPE="file"> <INPUT TYPE="submit" VALUE="Send File"> </FORM>
and I open the file, but get an error because there is nothing in the file -- code below:
$file1 =
fopen($userfile,"r");
if (!$file1) {
print("I'm sorry, but we cannot open the file that you have
uploaded.");
}
We also checked the permissions multiple times and the server's error log, but nothing... so, if anyone sees anythign wrong, please let me know. . thanks
-Daniel Lynn
attached mail follows:
have you checked the permissions on the temp directory on your server? make sure that the directory has appropriate permissions
for locating the temp directory in which php is uploading the files, use
<?php phpinfo(); ?>
amd look for upload_tmp_dir setting.
hope that helps
Ankur Verma
----- Original Message -----
From: "Daniel Lynn" <waylund
fast.net>
To: "PHP Mailing List" <php-general
lists.php.net>
Sent: Wednesday, March 07, 2001 9:17 AM
Subject: [PHP] Uploading files
> I seem to be having a lot of trouble uploading a file using the post
> method.
>
> I've read through a good amount of code and tutorials and can't seem to
> find anything wrong with my code. We're running this in the latest PHP 3
> version on two different servers (one NT and the other OpenBSD). Now, it
> works if we are using the page from the actual NT server, but not from
> any other computers on he LAN. We haven't been able to get it to work at
> all on the OpenBSD server, though we can't test it drectly from that
> computer.
>
> ok, here is the code I'm using for the form to upload the file:
>
> <FORM ENCTYPE="multipart/form-data" ACTION="index.php3" METHOD=POST>
> <INPUT TYPE="hidden" name="MAX_FILE_SIZE" value="1000000">
> <input type="hidden" name="SCREEN" value="uploadimage">
> <input type="hidden" name="faction" value="createimages">
>
> <?php
>
> print("<input type=\"hidden\" name=\"item\" value=\"" . $item .
> "\">\n");
> print("<input type=\"hidden\" name=\"department\" value=\"" .
> $department . "\">\n");
>
> ?>
>
> Send this file: <INPUT NAME="userfile" TYPE="file">
> <INPUT TYPE="submit" VALUE="Send File">
> </FORM>
>
> and I open the file, but get an error because there is nothing in the
> file -- code below:
>
> $file1 =
fopen($userfile,"r");
> if (!$file1) {
> print("I'm sorry, but we cannot open the file that you have
> uploaded.");
> }
>
> We also checked the permissions multiple times and the server's error
> log, but nothing... so, if anyone sees anythign wrong, please let me
> know. . thanks
>
> -Daniel Lynn
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
attached mail follows:
Greetings!
I am trying to compile MySQL. what I did are: tar -xvzf mysql-3.23.33.tar.gz cd mysql-3.23.33 ./configure --prefix=/usr/local/mysql then it startx to work and inerrupt and says testing gcc working: no configure: error: installation or configure problem: c compiler can not create executables
what should I do?
Looking forward to hearing from you.
warm regards, DT http://www.icimod.org.np
attached mail follows:
On Thu, 8 Mar 2001 02:38, Deependra B. Tandukar wrote: > Greetings! > > I am trying to compile MySQL. what I did are: > tar -xvzf mysql-3.23.33.tar.gz > cd mysql-3.23.33 > ./configure --prefix=/usr/local/mysql > then it startx to work and inerrupt and says > testing gcc working: no > configure: error: installation or configure problem: c compiler can not > create executables > > what should I do?
The mysql list would be a good place for mysql problems, no? But you a) may not have access to the c compiler or b) may not have permission to create files in the particular directory or....
-- David Robley | WEBMASTER & Mail List Admin RESEARCH CENTRE FOR INJURY STUDIES | http://www.nisu.flinders.edu.au/ AusEinet | http://auseinet.flinders.edu.au/ Flinders University, ADELAIDE, SOUTH AUSTRALIA
attached mail follows:
> If you're authenticating via .htaccess you can use the > environment variable "REMOTE_USER" to use as the > username to do the select on the db. Something > like: > > $user = getenv("REMOTE_USER"); > $sql = "Select * from usertable where username = '$user'";
I'm (currently) using PHP3.0.15 and finding that the variable $REMOTE_USER gets reset to null on subsequent pages inside the secured area... so I've been assigning it to another variable and then passing this through form posts to subsequent pages... I'm guessing this getenv("REMOTE_USER") will also clear ... am I correct?
Of course, I may need to rethink everything as I found a snag tonight... If I try to post a form back to my /index.php page (the one which originally triggered the authentication) the webserver throws up an Authentication Required error on me... because the browser (IE 5.01) has forgotten what it's said previously.
(I think I'm going to have to use the index.php page as an intermediate page, and put the menu structures that I want to return to on a different page)
Have I hit on a bug, or is this happening by design???
attached mail follows:
In article
<5.0.2.1.2.20010306130512.09cee620
pop.internal.mindspring.com>,
doyleb
corp.earthlink.net ("Brian C. Doyle") wrote:
> I need to remove a comma from inside of 2 quotes ie "1,234.56" I need to > change that to "1234.56" > Unfortunatly I can not do reg_replace(",","","1,234.56");
Possibly because the function is called ereg_replace() <g>...
But since you're not doing any special pattern matching, you might as well use a simple str_replace(',','','1,234.56') instead.
-- CC
attached mail follows:
Hello,
How do I get the number of the next month (Ex: 4). And when the current month reaches 12, the next month would be 1 and the next year would be 2002. Anybody know how I can accomplish this?
Thanks, Tyler Longren
attached mail follows:
Hi Tyler - did you check the date functions in the manual?
date() with the 'n' format let's you grab the month's ordinal from a unix timestamp, and mktime() let's you easily create unix timestamps
$next_mon = date("n", mktime(0,0,0,date("m")+1));
jason
> Hello, > > How do I get the number of the next month (Ex: 4). And when the current > month reaches 12, the next month would be 1 and the next year would be 2002. > Anybody know how I can accomplish this? > > Thanks, > Tyler Longren
attached mail follows:
Sorry bout the length .... I'm a newbie to PHP/MySQL so bare with me ... Here's a snippet of an app I'm hacking. I have a form that should update a client form. the cl_XXXX are taken from a database table and works nicely. The point of this that they should possibly be replaced by txtXXX and put back in the table.
As far as I can tell this _should_ work but it doesn't. I suspect that cmdFinish is never set if (isset($cmdFinish)) isn't true ....
Any suggestions?
8< ------------- code -------------------------->8
<tr> <td width="50%" valign=center align=right>Computer ID: </td> <td width="50%"> <input type=text name="txtCompID" size=10 value = "<?echo $cl_compID?>"> </td> </tr> <tr> <td width="50%" valign=center align=right> <font size=3>Email:</font> </td> <td width="50%"> <input type=text name="txtEmail" size=20 value = "<?echo $cl_email?>"> </td> </tr> </table> <p align=center> <center> <input type="submit" value="Modify client" name="cmdFinish"> </td> </center> </tr> </table> </center> </div> </form>
<?php //OK we can commit our changes ... if (isset($cmdFinish)) { $query = "UPDATE client SET "; $query .= "cl_login ='$txtLogin', "; $query .= "cl_firstname ='$txtFirstname', "; $query .= "cl_secondname ='$txtSecondname', "; $query .= "cl_phone = '$txtPhone', "; $query .= "cl_type = '$txtType', "; $query .= "cl_dept = '$txtDept', "; $query .= "cl_compID = '$txtCompID', "; $query .= "cl_email = '$txtEmail' "; $query .= "WHERE cl_login = '$lstModifyClient';"; $mysql_result = mysql_query($query, $mysql_link); print "<CENTER><BR><BR>\n"; print "$txtLogin has been successfully modified!<BR><BR></CENTER>\n"; exit; }
?>
<? } else { print "<CENTER><BR><BR><B>The Client: </B>$lstModifyClient has "; print "<b>not</b> been modified<BR></CENTER>\n"; } }
?>
attached mail follows:
Hi,
Well there are many ways to run a process in the background, my favorite way is detaching the process or the program or process from within, so if it's a c program pretty easy, but incase you dont have the source, then you can use this:
exec("mp3123 -y -Z --all 1>/dev/null/ 2>&1 &");
well that simply puts the stdout and stderr in the same file /dev/null, and puts it into the background.
--- pkshifted
slackin.com wrote: >
> I'm trying to develop a front-end using php for
> mpg123 so that various members of my household don't
> need to access a shell to start/play music. I'm
> using something similiar to exec('$null'), w/ $null
> being equal to "mpg123 -y -Z --all >/dev/null/ &".
> The problem I'm having, is about 5 minutes after it
> starts, it dies, with no core dump or anything, the
> process just stops. I'm sure this is done so that a
> process won't run forever in the background
> (bonus/bug), but what if that's what I want? Is
> there any work around?
>
> This is using php4.0.4pl1 and FreeBSD 4.0 release
> with apache 1.3.12. Thanks in advance.
>
> PKnull
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail:
> php-general-unsubscribe
lists.php.net
> For additional commands, e-mail:
> php-general-help
lists.php.net
> To contact the list administrators, e-mail:
> php-list-admin
lists.php.net
>
=====
To find out more about me : http://www.geocities.com/mimodit
My bookmarks are available
http://mukul.free.fr
__________________________________________________ Do You Yahoo!? Get email at your own domain with Yahoo! Mail. http://personal.mail.yahoo.com/
attached mail follows:
On Wednesday 07 March 2001 06:37, you wrote: > Hi, > > Well there are many ways to run a process in the > background, my favorite way is detaching the process > or the program or process from within, so if it's a c > program pretty easy, but incase you dont have the > source, then you can use this: > > exec("mp3123 -y -Z --all 1>/dev/null/ 2>&1 &");
better add "nohup" to that: exec("nohup mp3123 -y -Z --all 1>/dev/null/ 2>&1 &");
> well that simply puts the stdout and stderr in the > same file /dev/null, and puts it into the background.
-- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/)What luck for the rulers that men do not think.
- Adolf Hitler
attached mail follows:
Thanks for the suggestion, I tried that and it still doesn't seem to be working. Here's what i've got so far on my page (index.php).
<?PHP if(session_is_registered("CUserName")) { session_destroy(); unset($CUserName); header("Location: $PHP_SELF"); } else { session_register("CUserName"); $CUserNameSession="CUserName"; } //SNIP ?>
Hope you can see something I don't. Thanks, Mike
On Tue, 6 Mar 2001, trogers wrote:
>
> Hi
> You will need to kill the session data on the exit of your failed login not
> on entry to the login page as the data will already be overwritten by the
> previous session value.
> I use
> unset($name);
> unset($password);
> ...
>
> Tom
>
>
> At 04:24 PM 6/03/01 +0900, Yasuo Ohgaki wrote:
> >Do you use custom session handlers?
> >Try session_unset() also. It may help.
> >
> >Regards,
> >Yasuo Ohgaki
> >
> >
> > > Got a problem with sessions.
> > >
> > > On my index page, there's a place for people to login. Well, when I test
> > > with two different user names (ie: mike and jlo) it reverts to the first
> > > one when login fails. For example:
> > > I enter in the username "myuen" and a wrong password. I get my
> > > "Password/Username invalid" message which is what I want.
> > >
> > > The page refreshes, the username slot already has myuen in it from the
> > > last entry, I erase it, enter in a new username "jlo" and the correct
> > > password and it will not log me in.
> > >
> > > I know once you attempt to login, it saves the username as a session
> > > variable. On my index.php page, I have a script that checks if a session
> > > exists (particularly the Username), if it exists, destroy it otherwise,
> > > continue on. Obviously it's not destroying it once we enter in a wrong
> > > username and try to login again.
> > >
> > > Any ideas on how to fix this?
> > >
> > > Here's my coding:
> > > <?PHP
> > > if(session_is_registered("CUserName"))
> > > session_destroy();
> > >
> > > session_register("CUserName");
> > > $CUserNameSession="CUserName";
> > >
> > > //SNIP
> > > ?>
> >
> >
> >--
> >PHP General Mailing List (http://www.php.net/)
> >To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> >For additional commands, e-mail: php-general-help
lists.php.net
> >To contact the list administrators, e-mail: php-list-admin
lists.php.net
>
>
attached mail follows:
try session_start(); before the if statement - otherwise it will always be FALSE...btw the 'unset()' is redundant i think.
----- Original Message -----
From: "Mike Yuen" <myuen
ucalgary.ca>
To: "trogers" <trogers
ats.com.au>
Cc: "Yasuo Ohgaki" <yohgaki
hotmail.com>; <php-general
lists.php.net>
Sent: Wednesday, March 07, 2001 5:11 PM
Subject: Re: [PHP] Session not destroying properly
> Thanks for the suggestion, I tried that and it still doesn't seem to be
> working.
> Here's what i've got so far on my page (index.php).
>
> <?PHP
> if(session_is_registered("CUserName"))
> {
> session_destroy();
> unset($CUserName);
> header("Location: $PHP_SELF");
> }
> else
> {
> session_register("CUserName");
> $CUserNameSession="CUserName";
> }
> //SNIP
> ?>
>
> Hope you can see something I don't. Thanks,
> Mike
>
> On Tue, 6 Mar 2001, trogers wrote:
>
> >
> > Hi
> > You will need to kill the session data on the exit of your failed login
not
> > on entry to the login page as the data will already be overwritten by
the
> > previous session value.
> > I use
> > unset($name);
> > unset($password);
> > ...
> >
> > Tom
> >
> >
> > At 04:24 PM 6/03/01 +0900, Yasuo Ohgaki wrote:
> > >Do you use custom session handlers?
> > >Try session_unset() also. It may help.
> > >
> > >Regards,
> > >Yasuo Ohgaki
> > >
> > >
> > > > Got a problem with sessions.
> > > >
> > > > On my index page, there's a place for people to login. Well, when I
test
> > > > with two different user names (ie: mike and jlo) it reverts to the
first
> > > > one when login fails. For example:
> > > > I enter in the username "myuen" and a wrong password. I get my
> > > > "Password/Username invalid" message which is what I want.
> > > >
> > > > The page refreshes, the username slot already has myuen in it from
the
> > > > last entry, I erase it, enter in a new username "jlo" and the
correct
> > > > password and it will not log me in.
> > > >
> > > > I know once you attempt to login, it saves the username as a session
> > > > variable. On my index.php page, I have a script that checks if a
session
> > > > exists (particularly the Username), if it exists, destroy it
otherwise,
> > > > continue on. Obviously it's not destroying it once we enter in a
wrong
> > > > username and try to login again.
> > > >
> > > > Any ideas on how to fix this?
> > > >
> > > > Here's my coding:
> > > > <?PHP
> > > > if(session_is_registered("CUserName"))
> > > > session_destroy();
> > > >
> > > > session_register("CUserName");
> > > > $CUserNameSession="CUserName";
> > > >
> > > > //SNIP
> > > > ?>
> > >
> > >
> > >--
> > >PHP General Mailing List (http://www.php.net/)
> > >To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> > >For additional commands, e-mail: php-general-help
lists.php.net
> > >To contact the list administrators, e-mail:
php-list-admin
lists.php.net
> >
> >
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
>
attached mail follows:
I'm running the following to kill a session, and haven't had any problems with it yet... <? session_start(); session_unset(); session_destroy(); echo "Session gone."; etc...
At 05:16 PM 3/7/01 +1030, you wrote:
>try
>session_start();
>before the if statement - otherwise it will always be FALSE...btw the
>'unset()' is redundant i think.
>
>----- Original Message -----
>From: "Mike Yuen" <myuen
ucalgary.ca>
>To: "trogers" <trogers
ats.com.au>
>Cc: "Yasuo Ohgaki" <yohgaki
hotmail.com>; <php-general
lists.php.net>
>Sent: Wednesday, March 07, 2001 5:11 PM
>Subject: Re: [PHP] Session not destroying properly
>
>
> > Thanks for the suggestion, I tried that and it still doesn't seem to be
> > working.
> > Here's what i've got so far on my page (index.php).
> >
> > <?PHP
> > if(session_is_registered("CUserName"))
> > {
> > session_destroy();
> > unset($CUserName);
> > header("Location: $PHP_SELF");
> > }
> > else
> > {
> > session_register("CUserName");
> > $CUserNameSession="CUserName";
> > }
> > //SNIP
> > ?>
> >
> > Hope you can see something I don't. Thanks,
> > Mike
> >
> > On Tue, 6 Mar 2001, trogers wrote:
> >
> > >
> > > Hi
> > > You will need to kill the session data on the exit of your failed login
>not
> > > on entry to the login page as the data will already be overwritten by
>the
> > > previous session value.
> > > I use
> > > unset($name);
> > > unset($password);
> > > ...
> > >
> > > Tom
> > >
> > >
> > > At 04:24 PM 6/03/01 +0900, Yasuo Ohgaki wrote:
> > > >Do you use custom session handlers?
> > > >Try session_unset() also. It may help.
> > > >
> > > >Regards,
> > > >Yasuo Ohgaki
> > > >
> > > >
> > > > > Got a problem with sessions.
> > > > >
> > > > > On my index page, there's a place for people to login. Well, when I
>test
> > > > > with two different user names (ie: mike and jlo) it reverts to the
>first
> > > > > one when login fails. For example:
> > > > > I enter in the username "myuen" and a wrong password. I get my
> > > > > "Password/Username invalid" message which is what I want.
> > > > >
> > > > > The page refreshes, the username slot already has myuen in it from
>the
> > > > > last entry, I erase it, enter in a new username "jlo" and the
>correct
> > > > > password and it will not log me in.
> > > > >
> > > > > I know once you attempt to login, it saves the username as a session
> > > > > variable. On my index.php page, I have a script that checks if a
>session
> > > > > exists (particularly the Username), if it exists, destroy it
>otherwise,
> > > > > continue on. Obviously it's not destroying it once we enter in a
>wrong
> > > > > username and try to login again.
> > > > >
> > > > > Any ideas on how to fix this?
> > > > >
> > > > > Here's my coding:
> > > > > <?PHP
> > > > > if(session_is_registered("CUserName"))
> > > > > session_destroy();
> > > > >
> > > > > session_register("CUserName");
> > > > > $CUserNameSession="CUserName";
> > > > >
> > > > > //SNIP
> > > > > ?>
> > > >
> > > >
> > > >--
> > > >PHP General Mailing List (http://www.php.net/)
> > > >To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> > > >For additional commands, e-mail: php-general-help
lists.php.net
> > > >To contact the list administrators, e-mail:
>php-list-admin
lists.php.net
> > >
> > >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> > For additional commands, e-mail: php-general-help
lists.php.net
> > To contact the list administrators, e-mail: php-list-admin
lists.php.net
> >
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
>For additional commands, e-mail: php-general-help
lists.php.net
>To contact the list administrators, e-mail: php-list-admin
lists.php.net
attached mail follows:
Hello.
I am working on a site using PHP (obviously) and PostgreSQL. I am currently using the oid as a key on a table. I would like to return the user to the same record after INSERTing it, but I cannot figure out how to get the oid of the record after doing an INSERT. Ideally, I would like something like:
So, how do I insert a new record into the database, and get the oid of the record I just inserted?
thanks
attached mail follows:
Hi all,
I'm in the process of my first installation of PHP and running into a problem. Any experts, feel free to chime in with your knowledge.
After I unzip it, I run the configure script. Here's the command line I use and the error I get:
./configure --with-mysql=/var/lib/mysql --with-apxs ... lots of output ... Checking for MySQL support: yes configure: error: Cannot find header files under /var/lib/mysql
I've tried lots of different directories, none of which seem to work. Which header files is it looking for?
BTW, I'm attempting to install php 4.0.4 pl1, as an apache module (rather than statically linked with apache). I've already installed MySQL 3.22 and it appears to have been successfully installed.
Any help much appreciated.
............................................................................ Les Neste 678-778-0382 http://www.lesneste.com
attached mail follows:
On Wed, 7 Mar 2001 17:54, Les Neste wrote: > Hi all, > > I'm in the process of my first installation of PHP and running into a > problem. Any experts, feel free to chime in with your knowledge. > > After I unzip it, I run the configure script. Here's the command line > I use and the error I get: > > ./configure --with-mysql=/var/lib/mysql --with-apxs > ... lots of output ... > Checking for MySQL support: yes > configure: error: Cannot find header files under /var/lib/mysql > > I've tried lots of different directories, none of which seem to work. > Which header files is it looking for? > > BTW, I'm attempting to install php 4.0.4 pl1, as an apache module > (rather than statically linked with apache). I've already installed > MySQL 3.22 and it appears to have been successfully installed. > > Any help much appreciated. > > ....................................................................... >..... Les Neste 678-778-0382 http://www.lesneste.com
IANARH expert but: it'll be looking for /var/lib/mysql/include/*.h and I belive that if you have installed mysql from an rpm that you don't get that stuff by default - there is another RPM with mysql source and library stuff in it.
If you don't need any other mysql related stuff you could try using the php builtin mysql support by using just --with-mysql and not specifying a path.
-- David Robley | WEBMASTER & Mail List Admin RESEARCH CENTRE FOR INJURY STUDIES | http://www.nisu.flinders.edu.au/ AusEinet | http://auseinet.flinders.edu.au/ Flinders University, ADELAIDE, SOUTH AUSTRALIA
attached mail follows:
People very basic question here, I wanna assign username onto session after the login succeed, I use:
session_start(); session_register("username"); $UserNameSession="username";
did not work what is wring with this?
Jack
jacky
activelifestyle.com
"There is nothing more rewarding than reaching the goal you set for yourself"
attached mail follows:
To assign session variables you need to reference them by name: $username = "new_user";
attached mail follows:
Le Mercredi 7 Mars 2001 22:05, vous avez écrit : > People > very basic question here, I wanna assign username onto session after the > login succeed, I use: > > session_start(); > session_register("username");
the syntax for session_register is : session_register("session_names",var_without_quote)
and I think you doesnt need this line , it's done automaticlly by PHP > $UserNameSession="username";
> did not work what is wring with this?
> Jack
> jacky
activelifestyle.com
> "There is nothing more rewarding than reaching the goal you set for
> yourself"
-- __________________________________________________Matthieu LE CORRE SERVICE INFORMATIQUE Ecole Polytechnique de l'Université de Nantes (EPUN) Site de la Chantrerie Rue Christian Pauc BP 50609 44306 Nantes Cedex 3 02 40 68 32 23 __________________________________________________
attached mail follows:
Le Mercredi 7 Mars 2001 09:11, vous avez écrit : > Le Mercredi 7 Mars 2001 22:05, vous avez écrit : > > People > > very basic question here, I wanna assign username onto session after the > > login succeed, I use: > > > > session_start(); > > session_register("username"); > > the syntax for session_register is : > session_register("session_names",var_without_quote) > > and I think you doesnt need this line , > it's done automaticlly by PHP > > > $UserNameSession="username";
rectification i was wrong : I didn't see UserName session but username You need this line !
but for session_register I am right !
good luck
regards
> >
> >
> >
> > did not work what is wring with this?
> > Jack
> > jacky
activelifestyle.com
> > "There is nothing more rewarding than reaching the goal you set for
> > yourself"
-- __________________________________________________Matthieu LE CORRE SERVICE INFORMATIQUE Ecole Polytechnique de l'Université de Nantes (EPUN) Site de la Chantrerie Rue Christian Pauc BP 50609 44306 Nantes Cedex 3 02 40 68 32 23 __________________________________________________
attached mail follows:
As far as I know, the session fucntions work only with php4
for php3, you might want to take a look at phplib
hope that helps
Ankur Verma
----- Original Message -----
From: "Jacky
lilst" <jacky
activelifestyle.com>
To: <php-general
lists.php.net>
Sent: Thursday, March 08, 2001 2:35 AM
Subject: [PHP] session_start
People very basic question here, I wanna assign username onto session after the login succeed, I use:
session_start(); session_register("username"); $UserNameSession="username";
did not work what is wring with this?
Jack
jacky
activelifestyle.com
"There is nothing more rewarding than reaching the goal you set for
yourself"
attached mail follows:
I forgot to mention that I am using php3.
Jack
jacky
activelifestyle.com
"There is nothing more rewarding than reaching the goal you set for yourself"
attached mail follows:
Le Mercredi 7 Mars 2001 22:12, vous avez écrit : > I forgot to mention that I am using php3.
Hum my response was for PHP4 for PHP3 I don't kown ... maybe the same
> Jack
> jacky
activelifestyle.com
> "There is nothing more rewarding than reaching the goal you set for
> yourself"
-- __________________________________________________Matthieu LE CORRE SERVICE INFORMATIQUE Ecole Polytechnique de l'Université de Nantes (EPUN) Site de la Chantrerie Rue Christian Pauc BP 50609 44306 Nantes Cedex 3 02 40 68 32 23 __________________________________________________
attached mail follows:
Hi people
I got problem of how to assign session value in php3. As far as I know, all syntax in manual talks about php4 syntax only. How am I going to do that?
best
Jack
jacky
activelifestyle.com
"There is nothing more rewarding than reaching the goal you set for yourself"
attached mail follows:
-- Best regards, Maxim Derkachev mailto:kotbooks.ru Symbol-Plus Publishing Ltd. phone: +7 (812) 324-53-53 http://www.Books.Ru -- All Books of Russia
attached mail follows:
Hi! When I run this PHP my file idb.xml returns empty but how do I do if I then whant to remove the file idb.xml. I just doesn´t want it empty, I want it to disappeare.? <? $fp = fopen("idb.xml", "w"); fclose ($fp); ?> Thanks for help. Jan
attached mail follows:
try using unlink() http://www.php.net/manual/en/function.unlink.php
hope that helps
Ankur Verma HCL Technologies Noida
----- Original Message -----
From: "Jan Grafström" <jan
lillemanshus.com>
To: <php-general
lists.php.net>
Sent: Wednesday, March 07, 2001 2:08 PM
Subject: [PHP] How to completly remove a file?
> Hi!
> When I run this PHP my file idb.xml returns empty but how do I do if I
> then whant to remove the file idb.xml. I just doesn´t want it empty, I
> want it to disappeare.?
> <?
> $fp = fopen("idb.xml", "w");
> fclose ($fp);
> ?>
> Thanks for help.
> Jan
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
attached mail follows:
Apache 2.0 seem to be now supported by PHP4.04pl1. I tried PHP4.0.4pl1 & Apache 2.0a8 (configure don't seem to work for me with 2.0a9)
But..... I did not succeded to make it working ! Do someone have a tips on some compiling flags working, or other versions ? Mine made apache to show a segmentation fault (in PHP ?), and show a message that comes from 'create_php_config' function: 'Creating new config (0x80f0c54) for (null).'
Or is it just a config problem ? I have a php.ini in /usr/local/lib, but it makes the same error if I remove it !
I am interesed with it because it will provide multithreading instead of multiprocess,... which I prefer for writing PHP modules that can handle persitent and reusable data (to keep the same connection within a HTTP session).
( Apache was compiled with: configure --enable-shared --enable-so PHP was compiled with: configure --with-apxs2 )
""Benoit"" <benoit.anquetin
libertysurf.fr> wrote in message
news:97voih$och$1
toye.p.sourceforge.net...
> Do someone know when PHP will work as apixs under Apache 2.0 ?
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
>
attached mail follows:
$B!z!z!z!z!z!z%^%$%i%$%s$N$*?=$79~$_$OEv<R$X(B $B!z(B $B!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!$*?=$79~$_2<$5$$!z!z!z(B 2001.3.7 $B!z(B $B!z(B $B!z(B $B!zK\F|$O$*$/$D$m$.%5%$%H$N$40FFb$G$9(B $B!z(B http://www.ni.bekkoame.ne.jp/bc1548/index.html $B!z!z!z!z!z(B
$B>pJsDs6!4k6H$+$i$N$40MMj$K$h$j!"(B $B$3$N%a!<%k$rG[?.$7$F$*$j$^$9!#(B $B<u?.%a!<%k$N%+%F%4%j!<JQ99!&%"%I%l%9JQ99!&%a!<%kITMW$O(B $B!VJV?.07$$!W$G$*CN$i$;2<$5$$!#(B $B:o=|$N>l9g$OI,$:JV?.$K$F$*4j$$CW$7$^$9!#(B
$B%a%$%k%$%s(B
mailin
h3.dion.ne.jp
attached mail follows:
> hi friends
>
> can any one of you send me the url's to download mysql database since
> three
> days i have been trying to download that through www.mysql.com but
> unfortunately everytime download was incomplete.
> i need some url's other than mysql.com where i can download mysql
> database
> i have already configured PHP4 on my windows-NT workstation.
> i'd appreciate and will be delighted if you send me the mysql zip file as
> attachment
>
> Thanks in Advance
>
> satish
> satishb
ggn.hcltech.com
>
> > ----------
> > From: Andrew Hill[SMTP:ahill
openlinksw.com]
> > Sent: Friday, February 16, 2001 9:30 AM
> > To: Maxim Maletsky; 'Tanya Brethour'; php-general
lists.php.net
> > Cc: php-db
lists.php.net
> > Subject: Re: [PHP] Passing vars
> >
> > You may wish to consider why you need to pass 30 lines of code in a
> > variable.
> >
> > If the code is static, store it in include files and then pass it in
> > depending one a variable
> >
> > if ($variable=1)
> > { include(your30linefile);
> > }
> > else
> > { inclue(someotherfile);
> > }
> >
> > or to use a database query, pass a select value in as the index:
> >
> > $sql = "select some_field from table where id_field = $variable
> >
> > either way, you pass the value of $variable in from a page with this
> kind
> > of
> > link:
> >
> > <a href="page_name.php?variable=1">click me to submit $varible=1 to
> > page_name.php</a>
> >
> > If the 30 lines of code is html that needs to be generated on the fly,
> > break
> > it up into common blocks and drop them in using either method above.
> >
> > You can also do things like passing a hidden form field instead of using
> a
> > link.
> >
> >
> > Best regards,
> > Andrew
> > ---------------------------------------
> > Andrew Hill - OpenLink Software
> > Director Technology Evangelism
> > eBusiness Infrastructure Technology
> > http://www.openlinksw.com
> >
> >
> > On 2/15/01 10:20 PM, "Maxim Maletsky" <maxim.maletsky
japaninc.net>
> wrote:
> >
> > > you can use sessions ..
> > >
> > > php.net/sessions
> > >
> > > the session are cookies which will remember the user and will copy
> what
> > you
> > > need on your system, making these 30 lines available only to him for
> the
> > > time you specify.
> > >
> > > Cheers,
> > > Maxim Maletsky
> > >
> > > -----Original Message-----
> > > From: Tanya Brethour [mailto:brethour
ncsa.uiuc.edu]
> > > Sent: Thursday, February 15, 2001 3:20 AM
> > > To: php-general
lists.php.net
> > > Cc: php-db
lists.php.net
> > > Subject: [PHP] Passing vars
> > >
> > >
> > >
> > > Quick question..
> > >
> > > If I have like 6 variables to pass to another PHP script... and some
> of
> > > the vars are actually multiple lines of text (lets say over 30 lines).
> > > What is the best way of doing this?
> > >
> > > I would like to avoid doing something like test.php?cheese=(30 lines
> of
> > > stuff)
> > >
> > > Thanks in advance!
> > > -Tanya
> > >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> > For additional commands, e-mail: php-general-help
lists.php.net
> > To contact the list administrators, e-mail: php-list-admin
lists.php.net
> >
>
attached mail follows:
> ----------
> From:
> php-general-return-
lists.php.net[SMTP:php-general-return-
lists.php.net]
> Sent: Wednesday, March 07, 2001 2:42 PM
> To: satishb
ggn.hcltech.com
> Subject: ezmlm response
>
>
>
> hi friends
>
> can any one of you send me the url's to download mysql database since
> three
> days i have been trying to download that through www.mysql.com but
> unfortunately everytime download was incomplete.
> i need some url's other than mysql.com where i can download mysql
> database
> i have already configured PHP4 on my windows-NT workstation.
> i'd appreciate and will be delighted if you send me the mysql zip file as
> attachment
>
> Thanks in Advance
>
> satish
> satishb
ggn.hcltech.com
>
> > ----------
> > From: Andrew Hill[SMTP:ahill
openlinksw.com]
> > Sent: Friday, February 16, 2001 9:30 AM
> > To: Maxim Maletsky; 'Tanya Brethour'; php-general
lists.php.net
> > Cc: php-db
lists.php.net
> > Subject: Re: [PHP] Passing vars
> >
> > You may wish to consider why you need to pass 30 lines of code in a
> > variable.
> >
> > If the code is static, store it in include files and then pass it in
> > depending one a variable
> >
> > if ($variable=1)
> > { include(your30linefile);
> > }
> > else
> > { inclue(someotherfile);
> > }
> >
> > or to use a database query, pass a select value in as the index:
> >
> > $sql = "select some_field from table where id_field = $variable
> >
> > either way, you pass the value of $variable in from a page with this
> kind
> > of
> > link:
> >
> > <a href="page_name.php?variable=1">click me to submit $varible=1 to
> > page_name.php</a>
> >
> > If the 30 lines of code is html that needs to be generated on the fly,
> > break
> > it up into common blocks and drop them in using either method above.
> >
> > You can also do things like passing a hidden form field instead of using
> a
> > link.
> >
> >
> > Best regards,
> > Andrew
> > ---------------------------------------
> > Andrew Hill - OpenLink Software
> > Director Technology Evangelism
> > eBusiness Infrastructure Technology
> > http://www.openlinksw.com
> >
> >
> > On 2/15/01 10:20 PM, "Maxim Maletsky" <maxim.maletsky
japaninc.net>
> wrote:
> >
> > > you can use sessions ..
> > >
> > > php.net/sessions
> > >
> > > the session are cookies which will remember the user and will copy
> what
> > you
> > > need on your system, making these 30 lines available only to him for
> the
> > > time you specify.
> > >
> > > Cheers,
> > > Maxim Maletsky
> > >
> > > -----Original Message-----
> > > From: Tanya Brethour [mailto:brethour
ncsa.uiuc.edu]
> > > Sent: Thursday, February 15, 2001 3:20 AM
> > > To: php-general
lists.php.net
> > > Cc: php-db
lists.php.net
> > > Subject: [PHP] Passing vars
> > >
> > >
> > >
> > > Quick question..
> > >
> > > If I have like 6 variables to pass to another PHP script... and some
> of
> > > the vars are actually multiple lines of text (lets say over 30 lines).
> > > What is the best way of doing this?
> > >
> > > I would like to avoid doing something like test.php?cheese=(30 lines
> of
> > > stuff)
> > >
> > > Thanks in advance!
> > > -Tanya
> > >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> > For additional commands, e-mail: php-general-help
lists.php.net
> > To contact the list administrators, e-mail: php-list-admin
lists.php.net
> >
>
attached mail follows:
Hi,
I have a simple text file search. I do not want users to search on words such as 'is', 'and', 'or','the',etc. or single letters or numbers. Has anyone got a dictionary with all of these in so I could do a search through it before starting the main search?
Thanks,
Ajdin
attached mail follows:
PHP 4.0.2 on Win32 or PHP 3 on Win32 extension=php_ldap.dll is on in the php.ini file
I get 'Unable to load php_ldap.dll' (PHP4) when I call a php file ? I get 'Call to an unsupported function ldap_connect()' (PHP3) ?
Help please ?
attached mail follows:
I have been having problems using the PHP 4 ISAPI module with IIS 4 on NT4 (The most common problem is HTTP 500 internal server error which disappears if page is refreshed). This is apparently not too surprising given the current status of the ISAPI module. So I have switched to using CGI, which seems absolutely fine, but is noticeably slower.
I was wondering if it is worth trying the Apache module. Will it be more reliable? And are there any notable gotchas to watch out for in installing this combination?
Euan Greig
Technical Consultant
BRANN DATA
euan.greig
brann.com
01285 645997
************************************************************************** Any opinions expressed in this email are those of the individual and not necessarily the Company. This email and any files transmitted with it, including replies and forwarded copies (which may contain alterations) subsequently transmitted from the Company, are confidential and solely for the use of the intended recipient. If you are not the intended recipient or the person responsible for delivering to the intended recipient, be advised that you have received this email in error and that any use is strictly prohibited.
**************************************************************************
attached mail follows:
PHP 4.0.2 on Win32 or PHP 3 on Win32 extension=php_ldap.dll is on in the php.ini file
I get 'Unable to load php_ldap.dll' (PHP4) when I call a php file ? I get 'Call to an unsupported function ldap_connect()' (PHP3) ?
Help please ?
attached mail follows:
Hi!
I'm trying to make some mpegs available only to people who authenticated
themselves using php. But all the solutions I found somewhat unpleasant
because I uses chmod to set the file attributes to u=rw and then
used either
i) readfile("server/path//test.mpeg">ftp://name:password
server/path//test.mpeg");
or
ii) header ("Location: server/path/test.mpeg">ftp://name:password
server/path/test.mpeg");
But in case i) the browser asks if I want to download the file or view it. If I choose view the browser suggests to save the movie as myscript.php and if I choose view it ´doesn't display anything.
ii.) the browser displayes my username and password in the statusbar
And in both cases it downloads the whole file(I guess cause I use ftp) before starting the mpeg programm(where nothing happens afterwards in case i)
Is there a better way? ´Like telling the server via http my login data and sending the file to the users browser?
Thanks Thorsten
attached mail follows:
Hey,
Well sure there is:
$fp = fopen($filename, 'r') or die('damn'); $read = fread($fp, filesize($filename)) or die('damn'); $filestr = basename($filename);
header("Content-Disposition: attachment; filename=$filestr"); header("Content-Type: application/octet-stream");
echo $read; exit;
Neat And Clean!
Your authentication can be done above that piece of code, you then open the file, read it through send the filename download as $filestr, and the contents $read.
Simple!
--- Thorsten Gutermuth <thorsten.gutermuth
ic.ac.uk>
wrote: > Hi!
> I'm trying to make some mpegs available only to
> people who authenticated
> themselves using php. But all the solutions I found
> somewhat unpleasant
> because I uses chmod to set the file attributes to
> u=rw and then
> used either
> i)
>
readfile("server/path//test.mpeg">ftp://name:password
server/path//test.mpeg");
>
> or
>
> ii) header ("Location:
> server/path/test.mpeg">ftp://name:password
server/path/test.mpeg");
>
> But in case
> i) the browser asks if I want to download the file
> or view it. If I choose
> view the browser suggests to save the movie as
> myscript.php and if I choose
> view it ´doesn't display anything.
>
> ii.) the browser displayes my username and password
> in the statusbar
>
> And in both cases it downloads the whole file(I
> guess cause I use ftp)
> before starting the mpeg programm(where nothing
> happens afterwards in case
> i)
>
> Is there a better way? ´Like telling the server via
> http my login data and
> sending the file to the users browser?
>
> Thanks
> Thorsten
>
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail:
> php-general-unsubscribe
lists.php.net
> For additional commands, e-mail:
> php-general-help
lists.php.net
> To contact the list administrators, e-mail:
> php-list-admin
lists.php.net
>
=====
To find out more about me : http://www.geocities.com/mimodit
My bookmarks are available
http://mukul.free.fr
__________________________________________________ Do You Yahoo!? Get email at your own domain with Yahoo! Mail. http://personal.mail.yahoo.com/
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]