|
Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com |
php-general-digest-help_at_lists.php.net
Date: Fri Aug 16 2002 - 17:20:24 CDT
php-general Digest 16 Aug 2002 22:20:24 -0000 Issue 1529
Topics (messages 112934 through 113025):
Checkbox question
112934 by: José Jeria
112936 by: Jason Wong
112938 by: José Jeria
Re: date problem
112935 by: Jason Wong
Re: Java and php domainname validation
112937 by: Manu Verhaegen
112939 by: Manu Verhaegen
Re: sessions don't work
112940 by: Tim Ward
112941 by: Ryan
tricky preg_replace and how to escape the \{occurencenumber}
112942 by: lallous
112943 by: B.C. Lance
112944 by: B.C. Lance
112945 by: Jason Wong
112955 by: lallous
112956 by: lallous
112985 by: Jason Wong
113000 by: B.C. Lance
Array query - finding the key for a value
112946 by: Tim Fountain
112947 by: Jason Wong
112948 by: Matt Schroebel
112960 by: lallous
Drop down reload
112949 by: Christian Ista
112950 by: Jason Wong
112951 by: Julio Nobrega
112952 by: Scott Houseman
Re: Conditional Popup Menus with PHP/mySQL and Java?
112953 by: robert mischke
Can I use "iframes" as if I was using a new thread in Java?
112954 by: Serdar Sokmen
Re: Getting PHP to submit a form to google
112957 by: Michael Geier
progress bar for uploading files
112958 by: electroteque
112976 by: Philip Hallstrom
112982 by: Brian V Bonini
112984 by: Jay Blanchard
112987 by: Peter J. Schoenster
113006 by: Philip Hallstrom
113021 by: Daniel Masson
113023 by: Peter J. Schoenster
[Session-objects] Call to a member function on a non-object
112959 by: Tim Stoop
OO code and private functions
112961 by: Richard Black
112962 by: Rasmus Lerdorf
112963 by: Scott Houseman
112964 by: Joseph W. Goff
112967 by: Cal Evans
session lost when back button hit?
112965 by: Jean-Christian Imbeault
112969 by: Daniel Masson
112971 by: Jean-Christian Imbeault
112989 by: Alok K. Dhir
using PHP on forms submitted to other sites - HELP
112966 by: Dan McCullough
112973 by: Kondwani Spike Mkandawire
SQL Injection/Data Balidation
112968 by: Dennis Gearon
112990 by: Edwin .
113003 by: Randy Johnson
113005 by: Edwin .
113007 by: Edwin .
sessions: what to do when browser won't accept cookies?
112970 by: Jean-Christian Imbeault
112981 by: Jerry
112988 by: SHEETS,JASON (Non-HP-Boise,ex1)
Re: How retrieve database data from email?
112972 by: Bogdan Stancescu
112974 by: Bogdan Stancescu
HTML-based mail with PHP
112975 by: Liam Gibbs
Session variable in query
112977 by: Christian Ista
112979 by: Justin French
PHP Java Extension
112978 by: Girish Nath
Re: Variable
112980 by: Analysis & Solutions
Re: Credit Card Transactions and Micropayment
112983 by: Analysis & Solutions
Moving Files - Stupid Error
112986 by: Steve Keller
Re: Invoking sendmail with PHP
112991 by: Gui Guy
Re: Keyword & exact phrase search
112992 by: Jason Wong
Apache2
112993 by: Björn Hilliges
112996 by: Rasmus Lerdorf
112997 by: Bob Lockie
Re: php and classes
112994 by: Pafo
array and a class
112995 by: Pafo
test
112998 by: Dan McCullough
Protocol on handling empty checkbox values
112999 by: David Yee
113001 by: James Green
Extending PHP 4.0
113002 by: MET
AllTheWeb.com design contest
113004 by: Andrei Zmievski
question about executing a bash shell script...
113008 by: Kelly Meeks
113010 by: Robert Cummings
113011 by: James E Hicks III
113012 by: Kelly Meeks
113013 by: Robert Cummings
Bulk Email [solution found!]
113009 by: Daren Cotter
secure files acess
113014 by: David Buerer
113015 by: Robert Cummings
113016 by: Robert Cummings
113017 by: Daniel Masson
113018 by: David Buerer
113019 by: Robert Cummings
Re: problem with mail()
113020 by: Analysis & Solutions
Re: select distinct mysql
113022 by: Analysis & Solutions
HELP! php.ini file not read (was Php.ini on Solaris?)
113024 by: Randall Perry
###PLEASE HELP### - delete a line from a text file
113025 by: radio x
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 have a page with a checkbox, when i submit to the next page the
variable $whatever (the checkboxes name.) will be "On" if its checked,
and it will be undefined if its not checked.
Shouldn't it be a empty string? and not undefined?
/José
attached mail follows:
On Friday 16 August 2002 17:54, José Jeria wrote:
> I have a page with a checkbox, when i submit to the next page the
> variable $whatever (the checkboxes name.) will be "On" if its checked,
> and it will be undefined if its not checked.
>
> Shouldn't it be a empty string? and not undefined?
That is how it works. If it's not checked it does not get defined.
-- Jason Wong -> Gremlins Associates -> www.gremlins.com.hk Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development */* We cannot command nature except by obeying her. -- Sir Francis Bacon */
attached mail follows:
Hmmm, then the book "Beginning PHP" from Wrox is wrong...
/J
Jason Wong wrote: > On Friday 16 August 2002 17:54, José Jeria wrote: > >>I have a page with a checkbox, when i submit to the next page the >>variable $whatever (the checkboxes name.) will be "On" if its checked, >>and it will be undefined if its not checked. >> >>Shouldn't it be a empty string? and not undefined? > > > That is how it works. If it's not checked it does not get defined. >
attached mail follows:
On Friday 16 August 2002 17:24, Kae Verens wrote: > when I place date("h:i a") in a page on my server, and view it in a > browser, I am returned: "02:51 pm". According to the server itself, > though (logged in through ssh), using "date", it is 3:51. gmdate("h:i > a") returns the same 2:51 time. They are both one hour off from the > server time. > > Any ideas of a solution to this? > > Anyone have a ready-to-use function which can add/subtract an hour or > two to/from the date/time?
mktime()
-- Jason Wong -> Gremlins Associates -> www.gremlins.com.hk Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development */* Since a politician never believes what he says, he is surprised when others believe him. -- Charles DeGaulle */
attached mail follows:
Hi,
I have write a domain control function in php, the php function will working fine. I have create a simpel form with 2 textboxes and 1 button, i will put in this fields a domainname and the extention like yahoo com if i click on the button, then we want to validate the domainname and the extention This will not working
<?php function controle($Domainname, $extention) if ($extention =="com") { $server = "whois.internic.net"; $query = $Domainname . "." . $extention; $data = whois_request($server, $query); if(strstr($data, "No match for")) { return "ok" } else { return "notok" } } ?>
<script> function controledomainname(f) { if (controle(window.document.form1.domainname.value, window.document.form1.extention.value) = "notok") { alert("your domainname allready exist") } } </script>
<form name="form1"> <input TYPE="text" NAME="domainname" size="20" > <input TYPE="text" NAME="extention" size="20"> <input type="button" value="validate" onClick="controledomainname()"> </Form>
Best regards, Manu
attached mail follows:
Hi,
I have write a domain control function in php, the php function will working fine. I have create a simpel form with 2 textboxes and 1 button, i will put in this fields a domainname and the extention like yahoo com if i click on the button, then we want to validate the domainname and the extention This will not working
<?php function controle($Domainname, $extention) if ($extention =="com") { $server = "whois.internic.net"; $query = $Domainname . "." . $extention; $data = whois_request($server, $query); if(strstr($data, "No match for")) { return "ok" } else { return "notok" } } ?>
<script> function controledomainname(f) { if (controle(window.document.form1.domainname.value, window.document.form1.extention.value) = "notok") { alert("your domainname allready exist") } } </script>
<form name="form1"> <input TYPE="text" NAME="domainname" size="20" > <input TYPE="text" NAME="extention" size="20"> <input type="button" value="validate" onClick="controledomainname()"> </Form>
Best regards, Manu
attached mail follows:
why do you think the session isn't working? If there is a run time error in 'file' then an error would be reported and the output terminated. If you have error reporting off then you would expect to get eactly what you see. Sounds like a problem inside 'file'.
Tim Ward St Ives Direct
Please refer to the following disclaimer in respect of this message: http://www.stivesdirect.com/e-mail-disclaimer.html
> -----Original Message-----
> From: Félix García Renedo [mailto:felix
uva.es]
> Sent: 16 August 2002 08:51
> To: php
> Subject: sessions don't work
>
>
> Hello,
> I have a problem with php sessions.
> I have a php file like:
>
> <?
> session_start();
> session_register('pagina');
> ?>
> <html>
> <head>
> ...
> </head>
> <body>
> <?
> include('file');
> ?>
> ...
> </html>
>
> I have done diferent proofs and I have seen that the problem
> is that when I put include don't work sessions and if I left
> session it works. When I put all together it prints in the
> browser the code from "<html>" to "<body". It don't continue.
> If I reload the page it works properly. But I haven't found
> the way to do it automaticaly.
>
> Are there somebody who knows how to fix it?
>
>
> Thanks.
>
>
>
> Un saludo.
>
attached mail follows:
May be the session is diable in the php.ini
Félix garcía renedo wrote: > Hello, > I have a problem with php sessions. > I have a php file like: > > <? > session_start(); > session_register('pagina'); > ?> > <html> > <head> > ... > </head> > <body> > <? > include('file'); > ?> > ... > </html> > > I have done diferent proofs and I have seen that the problem is that when I put include don't work sessions and if I left session it works. When I put all together it prints in the browser the code from "<html>" to "<body". It don't continue. If I reload the page it works properly. But I haven't found the way to do it automaticaly. > > Are there somebody who knows how to fix it? > > > Thanks. > > > > Un saludo. >
attached mail follows:
<? $fn = 'test.gif';
echo preg_replace('/(.+?)(\..+?)/', '\1a\2', $fn);
?>
This script will output 'testa.gif'
now how can i make it produce 'test1.gif' ?
if i replace the: '\1a\2' with '\11\2' it will understand to replace with occurence number 11 ! How can i escape the 2nd '1' so it is considered as a string an not another number.
Elias
attached mail follows:
probably this will be faster?
$fn = str_replace(".gif", "1.gif", $fn);
Lallous wrote: > <? > $fn = 'test.gif'; > > echo preg_replace('/(.+?)(\..+?)/', '\1a\2', $fn); > > ?> > > This script will output 'testa.gif' > > now how can i make it produce 'test1.gif' ? > > if i replace the: '\1a\2' with '\11\2' it will understand to replace with > occurence number 11 ! > How can i escape the 2nd '1' so it is considered as a string an not another > number. > > > Elias > >
attached mail follows:
and if you are gonna append '1' for all extension,
try this: echo preg_replace('/(\..+?)/', '1$1', $fn);
Lallous wrote: > <? > $fn = 'test.gif'; > > echo preg_replace('/(.+?)(\..+?)/', '\1a\2', $fn); > > ?> > > This script will output 'testa.gif' > > now how can i make it produce 'test1.gif' ? > > if i replace the: '\1a\2' with '\11\2' it will understand to replace with > occurence number 11 ! > How can i escape the 2nd '1' so it is considered as a string an not another > number. > > > Elias > >
attached mail follows:
On Friday 16 August 2002 19:49, lallous wrote: > <? > $fn = 'test.gif'; > > echo preg_replace('/(.+?)(\..+?)/', '\1a\2', $fn); > > ?> > > This script will output 'testa.gif' > > now how can i make it produce 'test1.gif' ? > > if i replace the: '\1a\2' with '\11\2' it will understand to replace with > occurence number 11 ! > How can i escape the 2nd '1' so it is considered as a string an not another > number.
Try:
echo preg_replace('/(.+?)(\..+?)/', '\1'. '1' . '\2', $fn);
-- Jason Wong -> Gremlins Associates -> www.gremlins.com.hk Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development */* IBM's original motto: Cogito ergo vendo; vendo ergo sum. */
attached mail follows:
James, Actually the interpreter will evaluate the '\1'. '1' . '\2' into one string before passing it to preg_replace So it will yield up as I originally wrote it, and it won't work.
Elias
"Jason Wong" <php-general
gremlins.com.hk> wrote in message
news:200208161942.01916.php-general
gremlins.com.hk...
> On Friday 16 August 2002 19:49, lallous wrote:
> > <?
> > $fn = 'test.gif';
> >
> > echo preg_replace('/(.+?)(\..+?)/', '\1a\2', $fn);
> >
> > ?>
> >
> > This script will output 'testa.gif'
> >
> > now how can i make it produce 'test1.gif' ?
> >
> > if i replace the: '\1a\2' with '\11\2' it will understand to replace
with
> > occurence number 11 !
> > How can i escape the 2nd '1' so it is considered as a string an not
another
> > number.
>
> Try:
>
> echo preg_replace('/(.+?)(\..+?)/', '\1'. '1' . '\2', $fn);
>
> --
> Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
> Open Source Software Systems Integrators
> * Web Design & Hosting * Internet & Intranet Applications Development *
>
> /*
> IBM's original motto:
> Cogito ergo vendo; vendo ergo sum.
> */
>
attached mail follows:
Oh well,
I could have solved it w/ too many other methods, but how can I escape the \{occurence} as in my case?
Elias
"B.C. Lance" <lornie
magix.com.sg> wrote in message
news:3D5CE1B9.1020103
magix.com.sg...
> and if you are gonna append '1' for all extension,
>
> try this:
> echo preg_replace('/(\..+?)/', '1$1', $fn);
>
> Lallous wrote:
> > <?
> > $fn = 'test.gif';
> >
> > echo preg_replace('/(.+?)(\..+?)/', '\1a\2', $fn);
> >
> > ?>
> >
> > This script will output 'testa.gif'
> >
> > now how can i make it produce 'test1.gif' ?
> >
> > if i replace the: '\1a\2' with '\11\2' it will understand to replace
with
> > occurence number 11 !
> > How can i escape the 2nd '1' so it is considered as a string an not
another
> > number.
> >
> >
> > Elias
> >
> >
>
attached mail follows:
On Friday 16 August 2002 22:12, lallous wrote:
> Actually the interpreter will evaluate the '\1'. '1' . '\2' into one string > before passing it to preg_replace > So it will yield up as I originally wrote it, and it won't work.
Hmm, you're right. The interpreter is smarter than I thought :-/
-- Jason Wong -> Gremlins Associates -> www.gremlins.com.hk Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development */* "Why should we subsidize intellectual curiosity?" -Ronald Reagan */
attached mail follows:
hm...
this should work, notice the double quotes
echo preg_replace('/(.+?)(\..+?)/e', '"\1"."1"."\2"', $fn);
Lallous wrote: > Oh well, > > I could have solved it w/ too many other methods, but how can I escape the > \{occurence} as in my case? >
attached mail follows:
This may be a silly question, but I'm used to being able to find PHP functions to do whatever I want, but I can't find one to do this!
If I have an array like this:
[0] -> 'apple'; [1] -> 'pear'; [2] -> 'orange'; [3] -> 'apricot';
I know I can use in_array() to check whether, say, 'orange' is in the array; but how do I then find out which index 'orange' is at?
-- Tim Fountain (timtfountain.co.uk) http://www.tfountain.co.uk/
attached mail follows:
On Friday 16 August 2002 19:50, Tim Fountain wrote: > This may be a silly question, but I'm used to being able to find PHP > functions to do whatever I want, but I can't find one to do this! > > If I have an array like this: > > [0] -> 'apple'; > [1] -> 'pear'; > [2] -> 'orange'; > [3] -> 'apricot'; > > I know I can use in_array() to check whether, say, 'orange' is in the > array; but how do I then find out which index 'orange' is at?
array_search()
-- Jason Wong -> Gremlins Associates -> www.gremlins.com.hk Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development */* The more things change, the more they'll never be the same again. */
attached mail follows:
> From: Tim Fountain [mailto:tim
tfountain.co.uk]
> Sent: Friday, August 16, 2002 7:51 AM
> Subject: [PHP] Array query - finding the key for a value
>
> This may be a silly question, but I'm used to being able to find PHP
> functions to do whatever I want, but I can't find one to do this!
>
> If I have an array like this:
>
> [0] -> 'apple';
> [1] -> 'pear';
> [2] -> 'orange';
> [3] -> 'apricot';
>
> I know I can use in_array() to check whether, say, 'orange' is in the
> array; but how do I then find out which index 'orange' is at?
http://www.php.net/manual/en/function.array-search.php
Note that it will return 0 if the value is in the first element of the array so use ( === ) to determine if it's a key or really not found.
attached mail follows:
can do this:
$array = array('apple', 'pear', 'orange', 'apricot');
$array = array_flip($array);
$keyword = 'orange';
echo "found '$orange'
index:" . $array[$keyword];
Don't use this method though! It makes your program slow!
Elias
"Tim Fountain" <tim
tfountain.co.uk> wrote in message
news:1599065155.20020816125034
tfountain.co.uk...
>
> This may be a silly question, but I'm used to being able to find PHP
> functions to do whatever I want, but I can't find one to do this!
>
> If I have an array like this:
>
> [0] -> 'apple';
> [1] -> 'pear';
> [2] -> 'orange';
> [3] -> 'apricot';
>
> I know I can use in_array() to check whether, say, 'orange' is in the
> array; but how do I then find out which index 'orange' is at?
>
> --
> Tim Fountain (tim
tfountain.co.uk)
> http://www.tfountain.co.uk/
>
attached mail follows:
Hello,
Could you tell me if it possible to reload the current page when I select a value in a drop down ?
On a page, I have 2 drop down, the content on the first one come from the database. The content of the second one too (from database) but depend of the first drop down value.
An idea to do that ?
Bye
attached mail follows:
On Friday 16 August 2002 19:53, Christian Ista wrote: > Hello, > > Could you tell me if it possible to reload the current page when I > select a value in a drop down ? > > On a page, I have 2 drop down, the content on the first one come from > the database. The content of the second one too (from database) but > depend of the first drop down value. > > An idea to do that ?
Use javascript.
-- Jason Wong -> Gremlins Associates -> www.gremlins.com.hk Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development */* In Lexington, Kentucky, it's illegal to carry an ice cream cone in your pocket. */
attached mail follows:
http://www.zend.com/zend/tut/drop-down.php
-- Julio Nobrega Me empurraram pra chegar lá mais rápido! http://www.inerciasensorial.com.br"Christian Ista" <christian.ista
teledisnet.be> wrote in message news:000201c2451b$94fe4300$c000a8c0
p3portable... > Hello, > > Could you tell me if it possible to reload the current page when I > select a value in a drop down ? >
attached mail follows:
Hi there.
You would need to use JavaScript for this, specifically an onChange( ) event for the select field(s). Your JavaScript should basically reload the page once an option has been selected from the first select field, passing through a variable containing the value of the option which has just been selected, you can then use php to retrieve the appropriate records for the second select field when the page is reloaded.
Cheers
Scott
----- Original Message -----
From: "Christian Ista" <christian.ista
teledisnet.be>
To: <php-general
lists.php.net>
Sent: Friday, August 16, 2002 1:53 PM
Subject: [PHP] Drop down reload
> Hello, > > Could you tell me if it possible to reload the current page when I > select a value in a drop down ? > > On a page, I have 2 drop down, the content on the first one come from > the database. The content of the second one too (from database) but > depend of the first drop down value. > > An idea to do that ? > > Bye > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >
attached mail follows:
> > This is a javascript thing. Try comp.lang.javascript... the only > > thing u really need to know is that you have to send ALL > the data to > > the page with javascript, then effectively, it's a static HTML page. > > > > Justin French
There is an ariticle on Zend out there:
http://zend.com/zend/tut/drop-down.php
Look after and have fun.
regards robert
attached mail follows:
Hi;
Here is a brief description of my problem:
There is a file called index.php in some directory. The guy who wrote this file didn't bother creating another file where the functions are defined. More precisely, there is a big switch statement in the file. Depending on the outcome of the switch statement, one of the functions is called.
For some reason, I cannot call the function itself. I have to access it via the switch statement. However as it as index.php, it also prints some HTML stuff, which I do not want to be displayed...
Can I use an iframe do call this index.php and passing a parameter to be used in the switch statement? Anything I have to be careful with? Any way of knowing when the iframe has finished doing its job from the calling page? (maybe use "parent.form.submit()")
Any help will be appreciated
Serdar Sokmen
attached mail follows:
a more OO approach might be to use the Snoopy PHP class (http://snoopy.sourceforge.net)
This will allow you to do GET/POST method requests on URLS with query variables, ie:
POST $snoopy = new Snoopy; $submit_vars["q"] = [ form variables ]; $submit_url = "http://www.google.com/search";
$snoopy->submit($submit_url,$submit_vars); $result = $snoopy->results;
GET $snoopy = new Snoopy; $submit_url = "http://www.google.com/search?q=".[ form variables ]; $snoopy->fetch($submit_url); $result = $snoopy->results;
Then simply parse through $result;
> -----Original Message-----
> From: lallous [mailto:phplist
lgwm.org]
> Sent: Friday, August 16, 2002 4:24 AM
> To: php-general
lists.php.net
> Subject: [PHP] Re: Getting PHP to submit a form to google
>
>
> by simple ways, you can do that:
>
> $query = urlencode("your query string")
> $result_string = join('', file(http://www.google.com/search?q=$query));
>
>
> Elias
>
> "Henry" <henry-php-general-news
teacake.f9.co.uk> wrote in message
> news:20020815191438.10344.qmail
pb1.pair.com...
> > Hi all
> >
> > I would like to be able to get the result of a search from
> google. Namely
> I
> > would like to write a PHP script that will generate and submit a form
> > (internally i.e. on the server) using the GET method to
> > http://www.google.com/search setting the field "q" to the
> search words. It
> > should then parse the results so that I can feed them back to
> the user in
> a
> > form that I choose.
> >
> > How should/can I go about this?
> >
> > TIA.
> >
> > Henry.
> >
> >
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
attached mail follows:
hi guys i was wondering if there was anyway to have a progress bar for uploading images ?
attached mail follows:
You're best bet would be to make an animated gif that looks like a progres bar (or twirling icon or whatever).
Then when the users hits submit, "turn it on"... in the same way you do image rollovers, etc...
Then it will spin until the form is submitted...
On Fri, 16 Aug 2002, electroteque wrote:
> hi guys i was wondering if there was anyway to have a progress bar for > uploading images ? > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >
attached mail follows:
Bet this would be perfect for combining Flash and PHP.
> -----Original Message-----
> From: Philip Hallstrom [mailto:philip
adhesivemedia.com]
> Sent: Friday, August 16, 2002 11:57 AM
> To: electroteque
> Cc: php-general
lists.php.net
> Subject: [PHP] Re: progress bar for uploading files
>
>
> You're best bet would be to make an animated gif that looks like a progres
> bar (or twirling icon or whatever).
>
> Then when the users hits submit, "turn it on"... in the same way you do
> image rollovers, etc...
>
> Then it will spin until the form is submitted...
>
> On Fri, 16 Aug 2002, electroteque wrote:
>
> > hi guys i was wondering if there was anyway to have a progress bar for
> > uploading images ?
> >
> >
> >
> > --
> > 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
>
>
attached mail follows:
I had a rather weird thought, but it is Friday after all :^]
How about setting a small IFRAME in the upload diaog box? Then you could do a couple of things;
a.) Place a small animated GIF in the IFRAME that moves left to right or from side to side until the upload completes.
2.) Use the GD library and do something similar in the IFRAME.
Now, there are some issues such as calcing the time it takes to upload or measuring the amount of the file upload and updating the IFRAME image accordingly, and maybe some other little details that I am not thinking about, but it just a weird little thought. I'd love to see some solutions based on this though, and maybe when I get a little time next week I'll give it a go.
HTH!
Jay
***********************************************************
* Texas PHP Developers Conf Spring 2003 *
* T Bar M Resort & Conference Center *
* New Braunfels, Texas *
* San Antonio Area PHP Developers Group *
* Interested? Contact jay.blanchard
niicommunications.com *
***********************************************************
Rasmus, how much would it cost to get you or someone like you to come to this? :^]
attached mail follows:
On 16 Aug 2002 at 23:40, electroteque wrote:
> hi guys i was wondering if there was anyway to have a progress bar for > uploading images ?
TMTOWDI, but here is a way I did something similar. I was spidering remote sites and to get user's data and store in a database and the user could not continue until the spider spun it's web.
I accpeted the data I needed and then returned a page with the HTTP-REFRESH tag in it with something like this
<meta http-equiv="Refresh" content="10; URL=http://yoursite.com/verify_upload?process_id=X&action=check_upload"&timer=X>
So it refreshes every 10 seconds and checks to see if process X has finished, if so then redirect to the next step, if not then just return but upgrade the timer so you can increase your counter (perhaps a percentage in a table cell).
Peter
attached mail follows:
This wouldn't work for uploading files however since the long part of the process is the act of uploading the file and until that completes your "save.php" (or whatever) isn't called.
So in regards to file uploading it has to be done with Javascript. What you do below is great for scripts that just take a long time though.
-philip
On Fri, 16 Aug 2002, Peter J. Schoenster wrote:
> On 16 Aug 2002 at 23:40, electroteque wrote: > > > hi guys i was wondering if there was anyway to have a progress bar for > > uploading images ? > > TMTOWDI, but here is a way I did something similar. I was spidering remote sites and to get user's data and store in a database and the user could not continue until > the spider spun it's web. > > I accpeted the data I needed and then returned a page with the HTTP-REFRESH tag in it with something like this > > <meta http-equiv="Refresh" content="10; URL=http://yoursite.com/verify_upload?process_id=X&action=check_upload"&timer=X> > > So it refreshes every 10 seconds and checks to see if process X has finished, if so then redirect to the next step, if not then just return but upgrade the timer so you > can increase your counter (perhaps a percentage in a table cell). > > > Peter > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >
attached mail follows:
I ... Had to do something like that recently .. Sending files through ftp_put(); i just send the file .. And when user clicks 'Send' button ... A pop-up appears and gets the file size of the remote file and comparing with de local size you can build a progress bar .... This pop-up uses the tag that Peter said HTTP-REFRESH so you can see how the file size increases every n seconds ... It worked for me .. I hope this can help !!
=> Daniel
This wouldn't work for uploading files however since the long part of the process is the act of uploading the file and until that completes your "save.php" (or whatever) isn't called.
So in regards to file uploading it has to be done with Javascript. What you do below is great for scripts that just take a long time though.
-philip
On Fri, 16 Aug 2002, Peter J. Schoenster wrote:
> On 16 Aug 2002 at 23:40, electroteque wrote: > > > hi guys i was wondering if there was anyway to have a progress bar > > for uploading images ? > > TMTOWDI, but here is a way I did something similar. I was spidering > remote sites and to get user's data and store in a database and the > user could not continue until the spider spun it's web. > > I accpeted the data I needed and then returned a page with the > HTTP-REFRESH tag in it with something like this > > <meta http-equiv="Refresh" content="10; > URL=http://yoursite.com/verify_upload?process_id=X&action=check_up > load"&timer=X> > > So it refreshes every 10 seconds and checks to see if process X has > finished, if so then redirect to the next step, if not then just > return but upgrade the timer so you can increase your counter (perhaps
> a percentage in a table cell). > > > Peter > > > > > > -- > 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
attached mail follows:
On 16 Aug 2002 at 12:38, Philip Hallstrom wrote:
> This wouldn't work for uploading files however since the long part of > the process is the act of uploading the file and until that completes > your "save.php" (or whatever) isn't called. > > So in regards to file uploading it has to be done with Javascript. What > you do below is great for scripts that just take a long time though.
Yes, heck, I forgot about that. I fork the other script ... I don't see how I can do that with the file upload as it is the script itself being called ... umm .... I don't see off the top of my bald head how to do that fork with the file-upload. But there is a mod_perl module which does this. It might give some clues to someone who will pursue this (not me :)
http://theoryx5.uwinnipeg.ca/CPAN/data/Apache-UploadMeter/UploadMeter.html
Peter
attached mail follows:
Hi people,
As I understand it, object are unserialized into their former Class, if that Class is in memory. That's right, right?
Well, consider the following code:
include_once("../config.inc.php"); include_once($WORKDIR."obj/foto.obj.php"); if($type == 1) { $foto = new Foto(); } if(isset($_SESSION['foto'])) { $foto = unserialize($_SESSION['foto']); } $foto->makeInputFoto($type); $_SESSION['foto']=serialize($foto);
It's for a page that can edit or add a foto in(to) the database. If I run it like this, with ?type=1 in the URL, it works the first time, but after a reload of the exact same page, I get a 'Call to a member function on a non-object' in the line '$foto->makeInputFoto($type);'. Why is that? It's already a Foto-object, because I unserialized it, isn't it?
I also tried: if($type == 1 && !isset($_SESSION['foto'])) { $foto = new Foto(); } elseif(isset($_SESSION['foto'])) { $foto = unserialize($_SESSION['foto']); } With exactly the same effect. Any idea on how I can solve this? Tia!
-- Kind regards, Tim
attached mail follows:
Can I make a function private in PHP, so that it can only be called from within an object of that class???
Just discovering the wonders of OO PHP... :-)
==========================================
Richard Black
Systems Programmer, DataVisibility Ltd - http://www.datavisibility.com
Tel: 0141 435 3504
Email: rblack
datavisibility.co.uk
attached mail follows:
Nope
On Fri, 16 Aug 2002, Richard Black wrote:
> Can I make a function private in PHP, so that it can only be called from
> within an object of that class???
>
> Just discovering the wonders of OO PHP... :-)
>
> ==========================================
> Richard Black
> Systems Programmer, DataVisibility Ltd - http://www.datavisibility.com
> Tel: 0141 435 3504
> Email: rblack
datavisibility.co.uk
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
attached mail follows:
Hi there.
Not at the moment, but I think this is a feature of the new Zend engine 2, currently in development.
Cheers
Scott
----- Original Message -----
From: "Richard Black" <rblack
datavisibility.co.uk>
To: "Php-General" <php-general
lists.php.net>
Sent: Friday, August 16, 2002 4:24 PM
Subject: [PHP] OO code and private functions
> Can I make a function private in PHP, so that it can only be called from
> within an object of that class???
>
> Just discovering the wonders of OO PHP... :-)
>
> ==========================================
> Richard Black
> Systems Programmer, DataVisibility Ltd - http://www.datavisibility.com
> Tel: 0141 435 3504
> Email: rblack
datavisibility.co.uk
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
attached mail follows:
Not currently, but this will be added in the Zend2 engine. You can find out
about this on the Zend website.
----- Original Message -----
From: "Richard Black" <rblack
datavisibility.co.uk>
To: "Php-General" <php-general
lists.php.net>
Sent: Friday, August 16, 2002 9:24 AM
Subject: [PHP] OO code and private functions
> Can I make a function private in PHP, so that it can only be called from
> within an object of that class???
>
> Just discovering the wonders of OO PHP... :-)
>
> ==========================================
> Richard Black
> Systems Programmer, DataVisibility Ltd - http://www.datavisibility.com
> Tel: 0141 435 3504
> Email: rblack
datavisibility.co.uk
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
attached mail follows:
not yet (Zend engine 2.0 I believe has this) Currently the convention is to name private functions _* (variables the same) This denotes to other coders that you intended this to be a private function.
=C=
* * Cal Evans * The Virtual CIO * http://www.calevans.com *
-----Original Message-----
From: Richard Black [mailto:rblack
datavisibility.co.uk]
Sent: Friday, August 16, 2002 9:24 AM
To: Php-General
Subject: [PHP] OO code and private functions
Can I make a function private in PHP, so that it can only be called from within an object of that class???
Just discovering the wonders of OO PHP... :-)
==========================================
Richard Black
Systems Programmer, DataVisibility Ltd - http://www.datavisibility.com
Tel: 0141 435 3504
Email: rblack
datavisibility.co.uk
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
I have two pages, page one links to page two via a form button. The browser does not accept cookies.
On page two I create a session variable with:
$_SESSION["id"] = 1;
But if I hit the back button to go back to page one $_SESSION["id"] is not set. If I hit the reload button on page one it is still not set.
How can I get a session var to stay set when someone hits the back button?
Jc
PS I have session.auto_start ON and enabled trans-sid
attached mail follows:
HI
make ser youre using session_start() before performing any action on sessions, also make sure you´re registering properly the variables.
-----Mensaje original-----
De: Jean-Christian Imbeault [mailto:jean_christian
myrealbox.com]
Enviado el: viernes, 16 de agosto de 2002 9:43
Para: php-general
lists.php.net
Asunto: [PHP] session lost when back button hit?
I have two pages, page one links to page two via a form button. The browser does not accept cookies.
On page two I create a session variable with:
$_SESSION["id"] = 1;
But if I hit the back button to go back to page one $_SESSION["id"] is not set. If I hit the reload button on page one it is still not set.
How can I get a session var to stay set when someone hits the back button?
Jc
PS I have session.auto_start ON and enabled trans-sid
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
Daniel Masson wrote: > > make ser youre using session_start() before performing any action on > sessions, also make sure you´re registering properly the variables.
Did you see my PS at the end of my question?
> PS I have session.auto_start ON and enabled trans-sid
I don't need seesion_start() and I don't need to register the variable since I am setting it directly with $_SESSION["id"] = 1
If I am wrong about this please correct me, I'm still new to sessions.
Jc
attached mail follows:
By any chance, is page one the "entrance" page to your application? I.e. is there a session id in either the query string of the page URL or was there one passed to it via a POST?
Without cookies enabled, there is no way to allow users to use the back button to go back to the entrance page while maintaining the session.
One (hackish) solution to this is to cause the entrance page to immediately redirect to itself using either PHP's header function, or a meta refresh. Your goal here is to make it so that hitting back from a secondary page would take you to the post-refreshed entrance page which has the session ID.
Good luck.
> -----Original Message-----
> From:
> php-general-return-112965-adhir=govshops.com
lists.php.net
> [mailto:php-general-return-112965-adhir=govshops.com
lists.php
> .net] On Behalf Of Jean-Christian Imbeault
> Sent: Friday, August 16, 2002 10:43 AM
> To: php-general
lists.php.net
> Subject: [PHP] session lost when back button hit?
>
>
> I have two pages, page one links to page two via a form button. The
> browser does not accept cookies.
>
> On page two I create a session variable with:
>
> $_SESSION["id"] = 1;
>
> But if I hit the back button to go back to page one
> $_SESSION["id"] is
> not set. If I hit the reload button on page one it is still not set.
>
> How can I get a session var to stay set when someone hits the
> back button?
>
> Jc
>
> PS I have session.auto_start ON and enabled trans-sid
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
attached mail follows:
We have a client that has a form that submits to a payment processor to handle the cc processing. The visitor gets what he wants and then comes to a verification page on our clients site. He wants to buy it so he clicks the submit button and hes gone, to the payment processors site. We want to send a notification that someone has placed an order, not that they got to the payment page. So I have tried using onSubmit on the form and then placing the function name in there, but that doesnt work, its a function written in PHP to send a mail alert. Any thoughts we dont want the alert going to the guy until the visitor actually hits the submit button, and once it leaves the return notification from the processor is very limited, so I can't send it on the return from teh processor.
Help please :)
===== -------------------------------------------------------- "Theres no such thing as a problem unless the servers are on fire!"
__________________________________________________ Do You Yahoo!? HotJobs - Search Thousands of New Jobs http://www.hotjobs.com
attached mail follows:
"Dan McCullough" <McWC
rocketmail.com> wrote in message
news:20020816145051.65700.qmail
web11803.mail.yahoo.com...
> We have a client that has a form that submits to a payment processor to
handle the cc processing.
> The visitor gets what he wants and then comes to a verification page on
our clients site. He
> wants to buy it so he clicks the submit button and hes gone, to the
payment processors site. We
> want to send a notification that someone has placed an order, not that
they got to the payment
> page. So I have tried using onSubmit on the form and then placing the
function name in there, but
> that doesnt work, its a function written in PHP to send a mail alert. Any
thoughts we dont want
> the alert going to the guy until the visitor actually hits the submit
button, and once it leaves
> the return notification from the processor is very limited, so I can't
send it on the return from
> teh processor.
>
> Help please :)
>
try this...
<?
global $submit;
if($submit){ Do whatever... } ?>
<input type=submit name="sent" value="submit">
> ===== > -------------------------------------------------------- > "Theres no such thing as a problem unless the servers are on fire!" > > > __________________________________________________ > Do You Yahoo!? > HotJobs - Search Thousands of New Jobs > http://www.hotjobs.com
attached mail follows:
Please CC me as I'm on digest: ------------------------------
Are there any libraries for data validation available? If one reads papers like these:
http://www.nextgenss.com/papers/advanced_sql_injection.pdf http://www.nextgenss.com/papers/more_advanced_sql_injection.pdf
It becomes apparent that sites using databases are incredibly open to attack because of the ingenuity of the attackers. I think there should be a PHPGuardLib or something. After reading those articles, I plan on filtering ALL input for semi-cololons and 'chr(' character strings. In the cases where I want to accept apostrophes, I'm going to be very careful.
Also, are there any attacks to email programs on linux that can be done through input forms?
PS, for those who think escaping user input only on apostrophes, THINK AGAIN! And read the aticles above.
--If You want to buy computer parts, see the reviews at: http://www.cnet.com/ **OR EVEN BETTER COMPILATIONS**!! http://sysopt.earthweb.com/userreviews/products/
attached mail follows:
Yeah, I'm scared...
Please excuse me but may I say that it seems like you've sent some wrong info to the wrong mailing list?
I use PHP NOT ASP, I use MySQL or PostgreSQL or Oracle but NOT M$ SQL Server. And IIS? Of course, some people use it (perhaps) because of some unavoidable circumstances but I don't--I use Apache NOT IIS.
Of course, there's nothing bad about being cautious... However, please send some links (or documents) that are more relevant...
Thanks anyway, now *I* have something to scare my friends... ;)
- E
> >Please CC me as I'm on digest: >------------------------------ > >Are there any libraries for data validation available? If one reads >papers like these: > > http://www.nextgenss.com/papers/advanced_sql_injection.pdf > http://www.nextgenss.com/papers/more_advanced_sql_injection.pdf > >It becomes apparent that sites using databases are incredibly open to >attack because of the ingenuity of the attackers. I think there should >be a PHPGuardLib or something. After reading those articles, I plan on >filtering ALL input for semi-cololons and 'chr(' character strings. In >the cases where I want to accept apostrophes, I'm going to be very >careful. > >Also, are there any attacks to email programs on linux that can be done >through input forms? > >PS, for those who think escaping user input only on apostrophes, THINK >AGAIN! And read the aticles above. >-- > >If You want to buy computer parts, see the reviews at: >http://www.cnet.com/ >**OR EVEN BETTER COMPILATIONS**!! >http://sysopt.earthweb.com/userreviews/products/ > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, visit: http://www.php.net/unsub.php
_________________________________________________________________ MSN Hotmail è il provider email più grande al mondo… cosa aspetti a farti un account? http://www.hotmail.it
attached mail follows:
I didn't see that, what a waste of paper....
Randy
----- Original Message -----
From: "Edwin
" <copperwalls
hotmail.com>
To: <gearond
cvc.net>
Cc: <php-general
lists.php.net>
Sent: Friday, August 16, 2002 1:14 PM
Subject: Re: [PHP] SQL Injection/Data Balidation
> Yeah, I'm scared... > > Please excuse me but may I say that it seems like you've sent some wrong > info to the wrong mailing list? > > I use PHP NOT ASP, I use MySQL or PostgreSQL or Oracle but NOT M$ SQL > Server. And IIS? Of course, some people use it (perhaps) because of some > unavoidable circumstances but I don't--I use Apache NOT IIS. > > Of course, there's nothing bad about being cautious... However, please send > some links (or documents) that are more relevant... > > Thanks anyway, now *I* have something to scare my friends... ;) > > - E > > > > >Please CC me as I'm on digest: > >------------------------------ > > > >Are there any libraries for data validation available? If one reads > >papers like these: > > > > http://www.nextgenss.com/papers/advanced_sql_injection.pdf > > http://www.nextgenss.com/papers/more_advanced_sql_injection.pdf > > > >It becomes apparent that sites using databases are incredibly open to > >attack because of the ingenuity of the attackers. I think there should > >be a PHPGuardLib or something. After reading those articles, I plan on > >filtering ALL input for semi-cololons and 'chr(' character strings. In > >the cases where I want to accept apostrophes, I'm going to be very > >careful. > > > >Also, are there any attacks to email programs on linux that can be done > >through input forms? > > > >PS, for those who think escaping user input only on apostrophes, THINK > >AGAIN! And read the aticles above. > >-- > > > >If You want to buy computer parts, see the reviews at: > >http://www.cnet.com/ > >**OR EVEN BETTER COMPILATIONS**!! > >http://sysopt.earthweb.com/userreviews/products/ > > > >-- > >PHP General Mailing List (http://www.php.net/) > >To unsubscribe, visit: http://www.php.net/unsub.php > > > > > _________________________________________________________________ > MSN Hotmail è il provider email più grande al mondo. cosa aspetti a farti un > account? http://www.hotmail.it > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >
attached mail follows:
Actually, I DID read the articles before I replied.
If you read it again, the basic problem is not about any "extended SQLServer functionality"--it's about how ASP works AND how the database server was configured AND how Window$ works.
Sorry, but the attacks mentioned CANNOT be done on any of the database servers that I've used. And with PHP, Apache, Linux combination, they just don't apply.
Hey, don't get me wrong. I really appreciate any security info but personally I don't think they apply here...
- E
HINT: PHP doesn't use another "'" (single quote) character to escape another single quote character--it's just basically stupid to do so.
HINT 2: Configure your database server to have, for example, (1) a database username/password that can only SELECT -- enough for dynamically generated pages (2) a username/password that can only do INSERT or UPDATE, etc. Why would I make a username/password for my web pages that can delete important table or the entire database itself?
> >If you'll thoroughly read the articles, most of those attacks that don't >involve the use of extended SQLServer functionality, CAN be done on >other RDBMS's. And if nothing else, you'll see the ingenuity of the >attackers. > >Hey, take what you liked, and leave the rest lay. >-- > >If You want to buy computer parts, see the reviews at: >http://www.cnet.com/ >**OR EVEN BETTER COMPILATIONS**!! >http://sysopt.earthweb.com/userreviews/products/
_________________________________________________________________ Charle con sus amigos online usando MSN Messenger: http://messenger.msn.com
attached mail follows:
Oops! Sorry! I meant to say "apostrophe" and not "single quotes"...
And sorry 'bout this additional post...
Regards,
- E
>Actually, I DID read the articles before I replied. > >If you read it again, the basic problem is not about any "extended >SQLServer functionality"--it's about how ASP works AND how the database >server was configured AND how Window$ works. > >Sorry, but the attacks mentioned CANNOT be done on any of the database >servers that I've used. And with PHP, Apache, Linux combination, they just >don't apply. > >Hey, don't get me wrong. I really appreciate any security info but >personally I don't think they apply here... > >- E > >HINT: PHP doesn't use another "'" (single quote) character to escape >another single quote character--it's just basically stupid to do so. > >HINT 2: Configure your database server to have, for example, (1) a database >username/password that can only SELECT -- enough for dynamically generated >pages (2) a username/password that can only do INSERT or UPDATE, etc. Why >would I make a username/password for my web pages that can delete important >table or the entire database itself? > >> >>If you'll thoroughly read the articles, most of those attacks that don't >>involve the use of extended SQLServer functionality, CAN be done on >>other RDBMS's. And if nothing else, you'll see the ingenuity of the >>attackers. >> >>Hey, take what you liked, and leave the rest lay. >>-- >> >>If You want to buy computer parts, see the reviews at: >>http://www.cnet.com/ >>**OR EVEN BETTER COMPILATIONS**!! >>http://sysopt.earthweb.com/userreviews/products/ > > > > >_________________________________________________________________ >Charle con sus amigos online usando MSN Messenger: http://messenger.msn.com > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, visit: http://www.php.net/unsub.php
_________________________________________________________________ Charle con sus amigos online usando MSN Messenger: http://messenger.msn.com
attached mail follows:
I'm finding myself in a strange situation. I am trying to build a a web site that will use sessions and work even if a user decides not to accept cookies.
So far the site design is working fine by using the trans-sid functionality of PHP. But I have this on case where things break down.
1- user comes to the top page of my site 2- I try and start a session. user refuses to accept cookies 3- user click on links to visit my site, session works before SID is passed along in the URL 4 user clicks back button all the way back to my top page 5 session is lost because the SID is not in the URL of the top page ...
How can I get around the problem of not having the SID in the URL of the first page to my site the user comes to? It kind of a chicken-or-the-egg problem ...
Thanks for any and all suggestions!
Jc
attached mail follows:
In article <3D5D14EB.5040505
myrealbox.com>,
jean_christian
myrealbox.com (Jean-Christian Imbeault) wrote:
> How can I get around the problem of not having the SID in the URL of the
> first page to my site the user comes to? It kind of a chicken-or-the-egg
> problem ...
I kind of hate it when sites do this, but you could have the first page reload itself if it doesn't have an SID, and add an SID to itself. This way, if they use the back button, the first "first page" they come to has the SID.
You might then be able to use window.forward() in Javascript first, before giving them an SID. If they used the back button to get to you, window.forward() moves forward to a page that has an SID (which should look exactly like the page they thought they wanted that didn't have an SID). If they didn't use the back button to get to you, window.forward shouldn't do anything.
As a fall-back, you would probably want to have a warning on the front page that says, if the front page has no SID, that if they used the back button get here, use the forward button to go back or they might lose their session data.
This depends on your audience, of course. If you did that to me as a general browser, I probably wouldn't ever visit your site again :*)
Note that some sites do come right out and tell you not to use your back button to get around. You might just do this, and if they use their back button anyway, they get a new session.
Jerry
-- http://www.hoboes.com/jerry/ "Give a man a fish and you feed him for a day. Teach him to fish, and you've depleted the lake."--It Isn't Murder If They're Yankees (http://www.hoboes.com/jerry/Murder/)
attached mail follows:
Good idea but remember some people turn off javascript and cookies :)
Make your site as accessible as you can, using Jerry's suggestion is a good idea and then accept some people will be bent on not being able to use your site by disabling as much functionality in their browsers as they can or they use old browsers that don't support the functionality you are using.
Jason
-----Original Message-----
From: Jerry [mailto:jerry
acusd.edu]
Sent: Friday, August 16, 2002 10:20 AM
To: php-general
lists.php.net
Subject: [PHP] Re: sessions: what to do when browser won't accept cookies?
In article <3D5D14EB.5040505
myrealbox.com>,
jean_christian
myrealbox.com (Jean-Christian Imbeault) wrote:
> How can I get around the problem of not having the SID in the URL of the
> first page to my site the user comes to? It kind of a chicken-or-the-egg
> problem ...
I kind of hate it when sites do this, but you could have the first page reload itself if it doesn't have an SID, and add an SID to itself. This way, if they use the back button, the first "first page" they come to has the SID.
You might then be able to use window.forward() in Javascript first, before giving them an SID. If they used the back button to get to you, window.forward() moves forward to a page that has an SID (which should look exactly like the page they thought they wanted that didn't have an SID). If they didn't use the back button to get to you, window.forward shouldn't do anything.
As a fall-back, you would probably want to have a warning on the front page that says, if the front page has no SID, that if they used the back button get here, use the forward button to go back or they might lose their session data.
This depends on your audience, of course. If you did that to me as a general browser, I probably wouldn't ever visit your site again :*)
Note that some sites do come right out and tell you not to use your back button to get around. You might just do this, and if they use their back button anyway, they get a new session.
Jerry
-- http://www.hoboes.com/jerry/ "Give a man a fish and you feed him for a day. Teach him to fish, and you've depleted the lake."--It Isn't Murder If They're Yankees (http://www.hoboes.com/jerry/Murder/)-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
I'm not very proficient with e-mail configuration, so if someone finds I'm saying something wrong, don't think twice before correcting it. AFAIK, you can create an alias typically in /etc/aliases - or /etc/sendmail/aliases, as I've heard for newer versions of sendmail. In any case, the file has to be there already because that's where you have the root/webmaster/postmaster aliases defined.
Add a line reading stocks: | /usr/bin/php /path/to/your/script.php
I'm not sure if sendmail should be restarted after this, so you'd better do it just to make sure.
You'll obviously need root access to do these. After this point, you don't anymore.
In /path/to/your/script.php, you'll receive the whole e-mail message from standard input, so you'll have to check out those functions here http://www.php.net/manual/en/features.commandline.php
Then all you have to do is parse the incoming mail message - I'm sure you'll be able to google out plenty of functions/classes to do that - drop me an e-mail if you don't find any and I'll send you mine.
Bogdan
Lallous wrote:
> How and where can I add an alias and associate PHP with that alias?
>
>
> Elias
> "Bogdan Stancescu" <mgv
canad.ro> wrote in message
> news:3D5C4F78.3070700
canad.ro...
>
>>You can set up php to run from console if it doesn't already, and add an
>>alias to your mail server ("stocks") which would parse the incoming mail
>>and do the appropriate deeds.
>>
>>Bogdan
>>
>>M wrote:
>>
>>>Hello People:
>>>
>>>I have my pages built in PHP / Mysql, all working ok, but now I need
>>>solve a problem I don't know how to solve or even how search about. Case
>>>this problem was already discussed in this list, I would be grateful if
>>>someone pass to me correct date so I can search about.
>>>
>>>My problem is very simple: I have customers who dont want enter into
>>>html pages to retrieve some info (suppose info are stock values), but
>>>rather they want to send email with formatted query into mail subject
>>>(or at least in body) , and then receive response again by email.
>>>
>>>For instance, customer could send this for stocks
alpha.com
>>>
>>>to: stocks
alpha.com
>>>subject: name=ibm, year=2001
>>>body: (empty)
>>>
>>>In response, he should receive an email with all IBM stock prices day by
>>>day.
>>>
>>>That't all, I hope this will have solution, but I can't figure how email
>>>could communicate automatically with PHP/Mysql.
>>>
>>>Thanks
>>>
>>>Miguel
>>>
>>>
>>
>>
>
>
attached mail follows:
Bogdan Stancescu wrote: > Add a line reading > stocks: | /usr/bin/php /path/to/your/script.php
Sorry, it should be stocks: "| /usr/bin/php /path/to/your/script.php"
Also, first make sure php works from command line and check its location.
Bogdan
attached mail follows:
Now, this may be more of an e-mail question than a PHP question. For that, I apologize.
I'm having trouble with some HTML-based mail with PHP. It's not the regular thing where I can't get it to use the tags instead of just printing them. That part's fine; it comes out HTML-based.
My problem is the way it's not accessing a certain image. I get a broken link instead of an image at the top of my e-mail. I had it print the URL at which it should find the image, and then cut and paste that in my browser, and the image comes up fine. But, as far as putting it in the e-mail, it's not working out.
Any ideas?
__________________________________________________ Do You Yahoo!? HotJobs - Search Thousands of New Jobs http://www.hotjobs.com
attached mail follows:
Hello,
Is it possible to use a session variable in a query (mysql_query) without passé by an temp variable ?
Bye
attached mail follows:
not entirely sure what you mean, but perhaps this is what you're after???
$sql = "SELECT * FROM tablename WHERE username='{$_SESSION['userid']}'";
Justin French
on 17/08/02 2:08 AM, Christian Ista (christian.ista
teledisnet.be) wrote:
> Hello, > > Is it possible to use a session variable in a query (mysql_query) > without passé by an temp variable ? > > Bye > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >
attached mail follows:
Hi
I wanted to learn some new stuff and experiment with the PHP Java extension, what are the possibilities, what's cool about it, what are you guys using it for and where can i find some tutorials for it ? Had a look at php.net but can't find much info suitable for a newbie to this particular extension.
Thanks :)
Girish
attached mail follows:
On Wed, Aug 14, 2002 at 08:23:18AM +0000, Remon Redika wrote: > > <input type="text" name="namasa" size="40"> > <input type="text" name="namadu" size="40"> > <input type="text" name="namati" size="40"> > > $Namak = $namasa; > $Namak = $Namak.$namadu; > $Namak = $Namak.$namati;
Is that REALLY what you want to do? There are no spaces between the names. Try:
$Namak = "$namsa $namadu $namati";
But, that's probably not the problem. I suspect none of the three variables are being set because you have register_globals turned off.
Use the $_POST or $_GET variables.
Read the manual on these topics for more information.
--Dan
--
PHP classes that make web design easier
SQL Solution | Layout Solution | Form Solution
sqlsolution.info | layoutsolution.info | formsolution.info
T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y
4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409
attached mail follows:
Sascha:
On Wed, Aug 14, 2002 at 04:06:39PM +0200, Sascha Braun wrote: > > Are there some ways of using a micropayment system together with PHP?
What do you mean by "micropayment?" Paying for small fees? How small are you talking about?
> Maybe something where Customers can see the Amount of Money they have to > pay, and then they do a phonecall to e specific number and then the page > redirects teh customer to a downloads page where the user can receive > his picturepackage.
Sounds like an overly complex process. Why not do it all automatically with a well designed payment script?
--Dan
PS: Please turn on line wrapping in your email program.
--
PHP classes that make web design easier
SQL Solution | Layout Solution | Form Solution
sqlsolution.info | layoutsolution.info | formsolution.info
T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y
4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409
attached mail follows:
Hey all, I need a little help with moving a file on the server after an upload.
Our company site is hosted, so I don't have full access to the configuration files, but I can do a PHP_info dump if you need more clarification. Using 4.0.1pl2.
What I'm doing is uploading a file from a form, and that goes through just fine. I can print the file name to a database, along with the size.
The trouble is, no matter how I try to move it from the tmp directory, I get the same error. I've tried referencing it by the name given in the form, I've tried referencing it by $_Files. No matter how I call it, it never seems to go back to the tmp directory to look for the file. Here's a sample error:
Warning: Unable to create '/test/data/test.txt': No such file or directory in /usr/local/www/vhosts/healthtvchannel.org/htdocs/test/upload.php on line 17
That's with using:
copy("{$UploadedFile}","/test/data/".$UploadedFile_name);
$UploadedFile being the name I'm using. Both variables seem to be returning correctly. $UploadedFile returns the temp name, and $UploadedFile_name returns the actual name. The file is also far under the maximum file size. The /test/data has Nobody write permissions, I know because I'm writing to a file in it with another script, and there's no file in there with the same file name to cause overwriting ownership conflicts.
So where am I being stupid?
Here's the full code:
<? print($UploadedFile); print("<br />"); $filename = $UploadedFile_name; print "$filename was uploaded successfuly<br>\n"; $realname = $UploadedFile_name; print "realname is $realname<br>\n"; print "copying file to uploads dir<br>\n"; copy("{$UploadedFile}","/test/data/".$UploadedFile_name); ?>
<form enctype="multipart/form-data" action="<?$php_self?>" method="post"> <input type="hidden" name="MAX_FILE_SIZE" value="4096"> <input name="UploadedFile" type="file"> <input type="submit" value="upload">
-- S. Keller UI Engineer The Health TV Channel, Inc. (a non - profit organization) 3820 Lake Otis Pkwy. Anchorage, AK 99508 907.770.6200 ext.220 907.336.6205 (fax) Email: skellerhealthtvchannel.org Web: www.healthtvchannel.org
attached mail follows:
On a unix box, you can supply the arguments to the sendmail command in php.ini file, when you specify the sendmail path.
"Daren Cotter" <daren_cotter
yahoo.com> wrote in message
news:20020815193520.37923.qmail
web14503.mail.yahoo.com...
> To recap, my problem is:
>
> I need some mailings sent immediately (confirmation
> emails, welcome emails, password lookup emails, etc),
> while others simply get thrown into the queue, and get
> sent the next time the queue processes.
>
> I contacted a sendmail guru, and he told me that if
> Sendmail is run with the -odb arguments, the mail will
> process immediately, while if it's run with the -odd
> arguments, it will only be queued.
>
> So the question is, using PHP, how do I invoke
> sendmail with the different arguments separately?
>
> __________________________________________________
> Do You Yahoo!?
> HotJobs - Search Thousands of New Jobs
> http://www.hotjobs.com
attached mail follows:
On Thursday 15 August 2002 23:50, David Buerer wrote: > Because to my knowledge the limitation of a TEXT field is 64K. I need to > store entire documents in the database which far exceed the 64K limitation. > Given that criteria, the only option is to use blob fields which have an > upper limit of roughly 4GB.
TEXT fields in MySQL can store the same amount as their BLOB counterparts.
-- Jason Wong -> Gremlins Associates -> www.gremlins.com.hk Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development */* Rule of Defactualization: Information deteriorates upward through bureaucracies. */
attached mail follows:
Upgraded to Apache2, and now most of my php scripts won't work. No error msg att all, just that nothing happens.
Guess I missed some standard security setting, got any clues to this newbie?
Thanks Björn Hilliges, Sweden.
attached mail follows:
It will be a while before Apache 2 is properly supported. Switch back to Apache 1.3.x for now. We are working on it and PHP 4.3 should be significantly better with Apache 2.
-Rasmus
On Fri, 16 Aug 2002, Björn Hilliges wrote:
> Upgraded to Apache2, and now most of my php scripts won't work. No error msg > att all, just that nothing happens. > > Guess I missed some standard security setting, got any clues to this newbie? > > Thanks > Björn Hilliges, Sweden. > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >
attached mail follows:
>Upgraded to Apache2, and now most of my php scripts won't work. No error msg >att all, just that nothing happens. > >Guess I missed some standard security setting, got any clues to this newbie?
What does phpinfo() say? What does "httpd -l" say?
attached mail follows:
the problem is that i dont have access to php.ini :/ on a shared webhotel :(
regards patrick
"Jason Wong" <php-general
gremlins.com.hk> skrev i meddelandet
news:200208161151.47861.php-general
gremlins.com.hk...
> On Friday 16 August 2002 11:40, Pafo wrote:
> > nm, now it works,, forgot the silly ()
>
> Always set error reporting to FULL, and always error log to a file (see
> settings in php.ini). That way you probably could have figured out what
the
> problem was by examining the logs.
>
> --
> Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
> Open Source Software Systems Integrators
> * Web Design & Hosting * Internet & Intranet Applications Development *
>
> /*
> Your fly might be open (but don't check it just now).
> */
>
attached mail follows:
i got my nice looking class like this: <?php
class Relic { var $RelicName; var $RelicType; var $RelicRealm; var $RelicOwner;
function PrintInfo() { print "$this->RelicName : $this->RelicType : $this->RelicRealm : $this->RelicOwner<br>"; }
function CheckForPrint() { if ($this->RelicName == "" || $this->RelicType == "" || $this->RelicRealm == "" || $this->RelicOwner == "") { return false; } else { return true; } }
function Clean() { $this->RelicName = ""; $this->RelicType = ""; $this->RelicRealm = ""; $this->RelicOwner = ""; }
function SetName($name) { $this->RelicName = $name; }
function SetType($type) { $this->RelicType = $type; }
function SetRealm($realm) { $this->RelicRealm = $realm; }
function SetOwner($owner) { $this->RelicOwner = $owner; }
function DebugPrint() { print $this->RelicName; } }
$temp = new Relic(); $temp->SetName("test"); $temp->DebugPrint(); ?>
but the thing is i want an array that is based on my class, so i want to use $relicarray[1]->DebugPrint(); how does it work,, anyone that can give me a working example, cause i cant find any :/
regards patrick
attached mail follows:
test
===== -------------------------------------------------------- "Theres no such thing as a problem unless the servers are on fire!"
__________________________________________________ Do You Yahoo!? HotJobs - Search Thousands of New Jobs http://www.hotjobs.com
attached mail follows:
Hi all. For a universal form script I'm writing I want to store a 'Y' in a table field if a checkbox is checked and an 'N' if it's not. The problem is that when the form is posted if the checkbox is not checked the checkbox variable is not passed. E.g.
<form method=POST action=submit.php> <input type=checkbox name=my_checkbox_var value=Y> </form>
If the checkbox is checked, I get $_POST['my_checkbox_var'] == 'Y', but if not $_POST['my_checkbox_var'] is not even set. So what I've been doing is putting the variable names of the checkbox fields into an array, serializing it, and then pass the string as a hidden input on the form. Then in the page that handles the POST I unserialize the array to determine if checkbox fields were passed and then handle accordingly. But I'm wondering is there a better way (or at least a standard way) of doing this?
David
attached mail follows:
On Fri, 2002-08-16 at 19:24, David Yee wrote: > Hi all. For a universal form script I'm writing I want to store a 'Y' in a > table field if a checkbox is checked and an 'N' if it's not. The problem is > that when the form is posted if the checkbox is not checked the checkbox > variable is not passed. E.g. > > <form method=POST action=submit.php> > <input type=checkbox name=my_checkbox_var value=Y> > </form> > > If the checkbox is checked, I get $_POST['my_checkbox_var'] == 'Y', but if > not $_POST['my_checkbox_var'] is not even set. So what I've been doing is > putting the variable names of the checkbox fields into an array, serializing > it, and then pass the string as a hidden input on the form. Then in the > page that handles the POST I unserialize the array to determine if checkbox > fields were passed and then handle accordingly. But I'm wondering is there > a better way (or at least a standard way) of doing this?
I'll assume here that you're dynamically building the table and thus the checkboxes, which is why you cannot know whether a checkbox exists on the form or not.
If this is true, I would get a variable $loop, set it to 0, then on outputting every checkbox, append this value to the checkbox's name. Then you have predicatable checkbox names.
When you have finished drawing the checkboxes, note in a hidden input field the $loop value so you know what maximum possible checkbox number is.
On receiveing the POST, do a for loop, and perform an if (isset($_POST["checkbox_number_$loop"])) then you know if it's set or not.
I think that just about covers it. Apologies if I have misread/misinterpreted what you have asked.
James Green
attached mail follows:
Does anyone know how to build the first_module example shown at Zend (http://www.zend.com/apidoc/) ? I'd like to start coding extensions (preferably not directly into the PHP binary because of my hosting situation) but I just don't understand the explanation of compiling them.
Any one know how?
~ Matthew
/**************************************************************
Matthew Metnetsky
met
uberstats.com
**************************************************************/
attached mail follows:
I wanted to pass along the details of a contest that I thought you might find interesting.
AlltheWeb is the public search engine of Fast Search & Transfer and currently it is one of the largest search engines in the industry with over 2.1 billion pages in the web index. Recently, AlltheWeb.com announced the first ever design contest to personalize the look and feel of www.alltheweb.com and invites all web designers and technically minded people to submit an entry using CSS.
Below is some information about the contest and if you have any questions,
please feel free to jami.axelrod
fastsearch.com.
-----------------------------------------------
AlltheWeb is looking for the most innovative and creative designs using AlltheWeb Alchemist. AlltheWeb Alchemist renders AlltheWeb in the most basic HTML tags, with no layout, design, positioning or formatting rules. This enables designers to get creative and work some CSS magic to transform the site from its bare bones into a work of art.
Designs will be judged in one of three categories: 1. "Simple, Yet Beautiful" (the most minimalistic design) 2. "To CSS Infinity and Beyond" (the best use of CSS technology) 3. "So 22nd Century" (the most innovative, best looking design)
The winning design in each category will win a $750 gift certificate to Amazon.com and the CSS files will be posted on the AlltheWeb site for use by AlltheWeb users. Second and third place winners will also win gift certificates and have their designs posted for use.
The contest is open to the general public. All submissions must be received by September 22.
More details and submission form for the contest can be found at http://www.alltheweb.com/contest.
We're looking for some great entries and would very much appreciate your support in getting the word out to the design community about the contest.
If you have any technical questions, feel free to contact Frode Lundgren at
frode.lundgren
fastsearch.com.
----------------------------------------------
-Andrei http://www.gravitonic.com/
"It's an emergent property of connected human minds that they create things for one another's pleasure and to conquer their uneasy sense of being too alone." -- Eben Moglen
attached mail follows:
Hi folks,
I'm learning shell scripting via linux, and have written a script that creates the core files necessary for a users website from a master set of files.
Works from the shell just fine (bash makethesite.sh username pathtoputfiles pathtogetfiles)
Trying to execute this via php, and it literally does nothing.
If I try something like: $bashoutput=shell_exec('bash makethesite.sh username pathtoputfiles pathtogetfiles'); echo $bashoutput;
I get nothing output, and the script doesn't execute.
Any ideas?
Kelly
attached mail follows:
Kelly Meeks wrote: > > Hi folks, > > I'm learning shell scripting via linux, and have written a script that creates the core files necessary for a users website from a master set of files. > > Works from the shell just fine (bash makethesite.sh username pathtoputfiles pathtogetfiles) > > Trying to execute this via php, and it literally does nothing. > > If I try something like: > $bashoutput=shell_exec('bash makethesite.sh username pathtoputfiles pathtogetfiles'); > echo $bashoutput; > > I get nothing output, and the script doesn't execute.
I'm asuming you are executing something like the following:
php myPhpScript.php
The following will probably give you the desired results...
php -qC myPhpScript.php
This prevents PHP from switching out of the current directory.
HTH, Rob.
-- .-----------------. | Robert Cummings | :-----------------`----------------------------. | Webdeployer - Chief PHP and Java Programmer | :----------------------------------------------: | Mail : mailto:robert.cummingswebmotion.com | | Phone : (613) 731-4046 x.109 | :----------------------------------------------: | Website : http://www.webmotion.com | | Fax : (613) 260-9545 | `----------------------------------------------'
attached mail follows:
try something like: $bashoutput=shell_exec('/usr/bin/bash makethesite.sh username pathtoputfiles pathtogetfiles');
if that doesn't work can you use the system() function instead?
James
attached mail follows:
Hi Robert,
Thanks so much for the prompt reply.
Actually, I'm not trying to execute a php script, I'm trying to execute a shell (bash) script.
This works at the command line: bash makethesite.sh param1 param2 param3
This doesn't work via php $bashresult=shell_exec('bash makethesite.sh param1 param2 param3'); echo $bashresult;
Doesn't execute the script, nothing in $bashresult
Kelly
----- Original Message -----
From: "Robert Cummings" <robert.cummings
webmotion.com>
To: "Kelly Meeks" <info
rightangleinc.com>
Cc: <php-general
lists.php.net>
Sent: Friday, August 16, 2002 4:44 PM
Subject: Re: [PHP] question about executing a bash shell script...
> Kelly Meeks wrote:
> >
> > Hi folks,
> >
> > I'm learning shell scripting via linux, and have written a script that
creates the core files necessary for a users website from a master set of
files.
> >
> > Works from the shell just fine (bash makethesite.sh username
pathtoputfiles pathtogetfiles)
> >
> > Trying to execute this via php, and it literally does nothing.
> >
> > If I try something like:
> > $bashoutput=shell_exec('bash makethesite.sh username pathtoputfiles
pathtogetfiles');
> > echo $bashoutput;
> >
> > I get nothing output, and the script doesn't execute.
>
>
> I'm asuming you are executing something like the following:
>
> php myPhpScript.php
>
> The following will probably give you the desired results...
>
> php -qC myPhpScript.php
>
> This prevents PHP from switching out of the current directory.
>
> HTH,
> Rob.
> --
> .-----------------.
> | Robert Cummings |
> :-----------------`----------------------------.
> | Webdeployer - Chief PHP and Java Programmer |
> :----------------------------------------------:
> | Mail : mailto:robert.cummings
webmotion.com |
> | Phone : (613) 731-4046 x.109 |
> :----------------------------------------------:
> | Website : http://www.webmotion.com |
> | Fax : (613) 260-9545 |
> `----------------------------------------------'
>
attached mail follows:
Kelly Meeks wrote: > > Hi Robert, > > Thanks so much for the prompt reply. > > Actually, I'm not trying to execute a php script, I'm trying to execute a > shell (bash) script. > > This works at the command line: > bash makethesite.sh param1 param2 param3 > > This doesn't work via php > $bashresult=shell_exec('bash makethesite.sh param1 param2 param3'); > echo $bashresult;
You are trying to execute a bash script from PHP though. When you invoke the php engine it usually changes directory (to the root defined in the php.ini I think). To stop this so that it will remain in the current directory so that when you run bash it will see the bash script in the current directory, you need to use the -C command line option. I believe your environment is inherited by php and subsequently bash and so if you don't use the -C option bash will be looking in the wrong directory.
Cheers, Rob.
>
> Doesn't execute the script, nothing in $bashresult
>
> Kelly
> ----- Original Message -----
> From: "Robert Cummings" <robert.cummings
webmotion.com>
> To: "Kelly Meeks" <info
rightangleinc.com>
> Cc: <php-general
lists.php.net>
> Sent: Friday, August 16, 2002 4:44 PM
> Subject: Re: [PHP] question about executing a bash shell script...
>
> > Kelly Meeks wrote:
> > >
> > > Hi folks,
> > >
> > > I'm learning shell scripting via linux, and have written a script that
> creates the core files necessary for a users website from a master set of
> files.
> > >
> > > Works from the shell just fine (bash makethesite.sh username
> pathtoputfiles pathtogetfiles)
> > >
> > > Trying to execute this via php, and it literally does nothing.
> > >
> > > If I try something like:
> > > $bashoutput=shell_exec('bash makethesite.sh username pathtoputfiles
> pathtogetfiles');
> > > echo $bashoutput;
> > >
> > > I get nothing output, and the script doesn't execute.
> >
> >
> > I'm asuming you are executing something like the following:
> >
> > php myPhpScript.php
> >
> > The following will probably give you the desired results...
> >
> > php -qC myPhpScript.php
> >
> > This prevents PHP from switching out of the current directory.
> >
> > HTH,
> > Rob.
> > --
> > .-----------------.
> > | Robert Cummings |
> > :-----------------`----------------------------.
> > | Webdeployer - Chief PHP and Java Programmer |
> > :----------------------------------------------:
> > | Mail : mailto:robert.cummings
webmotion.com |
> > | Phone : (613) 731-4046 x.109 |
> > :----------------------------------------------:
> > | Website : http://www.webmotion.com |
> > | Fax : (613) 260-9545 |
> > `----------------------------------------------'
> >
-- .-----------------. | Robert Cummings | :-----------------`----------------------------. | Webdeployer - Chief PHP and Java Programmer | :----------------------------------------------: | Mail : mailto:robert.cummingswebmotion.com | | Phone : (613) 731-4046 x.109 | :----------------------------------------------: | Website : http://www.webmotion.com | | Fax : (613) 260-9545 | `----------------------------------------------'
attached mail follows:
I have found a solution to my bulk email problem. I'm posting my solution simply because I spent nearly a year finding it, and I KNOW there's many other people in my same situation.
First, a recap of my problem:
I need to send personalized emails to my member list on a daily basis. I use PHP to query the MySQL database, and loop through the results using the mail() function. Problem: very slow, browser/php times out, etc.
Solution:
First, I configure sendmail to use "queueonly" as the DeliveryMethod (see sendmail.cf) instead of "background". Then, when my PHP script runs, mailings simply get queued instead of actually delivered. This is a x10 speed increase. My script queues approximately 1,000 mailings per minute (a x10 speed increase). Then, I modified the /etc/rc.d/init.d/sendmail script to process the queue every 5 minutes, instead of the default one hour. This insures that the mailings actually get sent soon after they're queued, and you won't have to wait for important emails to come through.
The problem with the above solution used to be this: certain emails generated from my site (welcome emails, password lookup emails, etc) need to be sent IMMEDIATELY, and cannot wait in the queue for 5 minutes. The solution for this: not using the built-in mail() command in PHP. I created my own mail script (by modifying something someone else already did) which opens a socket directly with the mail server. Code is below.
// Sends the email directly to the mail server using SMTP. This is done // so sendmail can be setup using the queue method on the server, and // confirmation emails, etc, can be sent immediately to the member. function smtp_mail($to, $from_name, $from_email, $reply_to_email, $subject, $body) { $smtp = fsockopen("your_mail_server_here", 25); if ($smtp == 0) return 0; fputs($smtp,"helo machines_host_and_domain_name_here\r\n"); $line = fgets($smtp, 1024); fputs($smtp,"mail from: $from_email\r\n"); $line = fgets($smtp, 1024); fputs($smtp,"rcpt to: $to\r\n"); $line = fgets($smtp, 1024); fputs($smtp,"data\r\n"); $line = fgets($smtp, 1024); fputs($smtp,"From: $from_name <$from_email>\r\n"); fputs($smtp,"Reply-To: $reply_to_email\r\n"); fputs($smtp,"To: $to\r\n"); fputs($smtp,"Subject: $subject\r\n"); fputs($smtp,"\r\n"); fputs($smtp,"$body\r\n"); fputs($smtp,".\r\n"); $line = fgets($smtp, 1024); fputs($smtp, "QUIT\r\n"); fclose($smtp); return 1; }
Function is called as follows:
if (!smtp_mail("recipient_email_here", $EMAIL_FROM_NAME, $EMAIL_FROM_EMAIL, $EMAIL_FROM_REPLY_TO, $SIGNUP_VALIDATION_SUBJECT, "Test Body")) { print "error: mail not sent"; } else { print "it worked!"; }
Hope this helps others!
__________________________________________________ Do You Yahoo!? HotJobs - Search Thousands of New Jobs http://www.hotjobs.com
attached mail follows:
I have a bunch of files which need to be kept secure. I need to allow a user access to them them based on a criteria which I can programmatically determine.
My question, is how can I allow the user to download or view only one file on my computer without allowthem to just enter the URL into their browser of the file and view it?
attached mail follows:
David Buerer wrote: > > I have a bunch of files which need to be kept secure. I need to allow a user > access to them them based on a criteria which I can programmatically > determine. > > My question, is how can I allow the user to download or view only one file > on my computer without allowthem to just enter the URL into their browser of > the file and view it?
Have a php script authenticate the user, then if authenticated, use the reafile() function to output it to the user directly. Since PHP can see more than just the web space the files just need to reside outside of the websapce.
Cheers, Rob.
-- .-----------------. | Robert Cummings | :-----------------`----------------------------. | Webdeployer - Chief PHP and Java Programmer | :----------------------------------------------: | Mail : mailto:robert.cummingswebmotion.com | | Phone : (613) 731-4046 x.109 | :----------------------------------------------: | Website : http://www.webmotion.com | | Fax : (613) 260-9545 | `----------------------------------------------'
attached mail follows:
Robert Cummings wrote: > > David Buerer wrote: > > > > I have a bunch of files which need to be kept secure. I need to allow a user > > access to them them based on a criteria which I can programmatically > > determine. > > > > My question, is how can I allow the user to download or view only one file > > on my computer without allowthem to just enter the URL into their browser of > > the file and view it? > > Have a php script authenticate the user, then if authenticated, use the > reafile() function to output it to the user directly. Since PHP can see ^^^^^^^^^
readfile() even :p
Cheers, Rob.
-- .-----------------. | Robert Cummings | :-----------------`----------------------------. | Webdeployer - Chief PHP and Java Programmer | :----------------------------------------------: | Mail : mailto:robert.cummingswebmotion.com | | Phone : (613) 731-4046 x.109 | :----------------------------------------------: | Website : http://www.webmotion.com | | Fax : (613) 260-9545 | `----------------------------------------------'
attached mail follows:
Hi there !!!
I had the same problem once ...
This will save you !!
http://www.zend.com/zend/trick/tricks-august-2001.php
I have a bunch of files which need to be kept secure. I need to allow a user access to them them based on a criteria which I can programmatically determine.
My question, is how can I allow the user to download or view only one file on my computer without allowthem to just enter the URL into their browser of the file and view it?
attached mail follows:
Thankyou Robert, THat is a great and easy way to do it.
What if I need to initiate a download to the user?
-----Original Message-----
From: Robert Cummings [mailto:robert.cummings
webmotion.com]
Sent: Friday, August 16, 2002 2:06 PM
To: David Buerer
Cc: 'php-general
lists.php.net'
Subject: Re: [PHP] secure files acess
David Buerer wrote: > > I have a bunch of files which need to be kept secure. I need to allow a user > access to them them based on a criteria which I can programmatically > determine. > > My question, is how can I allow the user to download or view only one file > on my computer without allowthem to just enter the URL into their browser of > the file and view it?
Have a php script authenticate the user, then if authenticated, use the reafile() function to output it to the user directly. Since PHP can see more than just the web space the files just need to reside outside of the websapce.
Cheers, Rob.
-- .-----------------. | Robert Cummings | :-----------------`----------------------------. | Webdeployer - Chief PHP and Java Programmer | :----------------------------------------------: | Mail : mailto:robert.cummingswebmotion.com | | Phone : (613) 731-4046 x.109 | :----------------------------------------------: | Website : http://www.webmotion.com | | Fax : (613) 260-9545 | `----------------------------------------------'
attached mail follows:
David Buerer wrote: > > Thankyou Robert, THat is a great and easy way to do it. > > What if I need to initiate a download to the user?
If you set the mime type properly the browser will automatically make it a download versus displaying it.
Cheers, Rob.
-- .-----------------. | Robert Cummings | :-----------------`----------------------------. | Webdeployer - Chief PHP and Java Programmer | :----------------------------------------------: | Mail : mailto:robert.cummingswebmotion.com | | Phone : (613) 731-4046 x.109 | :----------------------------------------------: | Website : http://www.webmotion.com | | Fax : (613) 260-9545 | `----------------------------------------------'
attached mail follows:
On Wed, Aug 14, 2002 at 10:04:46AM -0700, Gui Guy wrote: > > ...: SYSERR(nobody): Can't create transcript file ./xfg7E9Jlr03988: > Permission denied > ....: SYSERR(nobody): Cannot create ./dfg7E9Jlr03988: Permission denied > > Does it mean that php is trying to send mail from user nobody?
Good guess! Sounds like a file permissions thing. What directory are those files being created in? Provide "nobody" with adequate permissions on that directory.
--Dan
--
PHP classes that make web design easier
SQL Solution | Layout Solution | Form Solution
sqlsolution.info | layoutsolution.info | formsolution.info
T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y
4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409
attached mail follows:
On Thu, Aug 15, 2002 at 01:12:59PM +0300, kale wrote: > > SELECT *, DISTINCT name FROM history ORDER date DESC, time DESC LIMIT 10 > > but this not work. how can I do this? I use a mysql server.
That's because your query string syntax is all messed up.
Put a mysql_error() call in your script after the mysql_query() call. It will tell you what the error is. http://www.php.net/manual/en/function.mysql-error.php.
(Or, of course, you can execute the query directly from your MySQL client command line.)
If you're unclear about what the error message is saying, read the MySQL manual on how to write SELECT statements. http://www.mysql.com/doc/en/SELECT.html
--Dan
--
PHP classes that make web design easier
SQL Solution | Layout Solution | Form Solution
sqlsolution.info | layoutsolution.info | formsolution.info
T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y
4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409
attached mail follows:
Ok, to answer my own question...
Apparently php.ini doesn't get read until Apache is restarted. Restarting apache did the trick.
-- Randy Perry sysTame Mac Consulting/Salesphn 772.589.6449 mobile email help
systame.com
attached mail follows:
i have a text file with some of this elements: name:adress:telephone:email:password
i want to delete this line using for identifier the 'name' only.
// $sterge_user="name"; this is the value sent by form witch will be the identifier // $path="some_of_my_files"; the file used here allready set with 777 chmod
function delete_user($sterge_user, $path){ $i = 0; $fisierul = file($path); $fp = fopen($path, "w"); while (!sizeof($fisierul)) { $data = fgetcsv ($fisierul, 4096, ":"); if ($data[0]==$sterge_user) { for ($i=0; $i<=sizeof($data);){$data[i]="";++$i;} } fwrite($fp, $data); } fclose($fp); }
I am waiting for an answer, please
Nick
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]