Thanks for the tips guys.
I'll be using session cookies on another site - need to bone up first
though.
I decided to post to a new page, that way the user has to click a link to
back and in doing so the form reloads and refreshes the data without
creating a submission.
Cheap and cheerful...!
Bob.
New myself but have started reading around sessions and found that you need
two things enabled at the server end:
track_vars
trans-sid
and bruce is right - you need to make sure the session_start command is
immediately after the opening PHP tag.
--
-
Michael
Answered my own question: XML_Serializer
http://pear.php.net/manual/en/package.xml.xml-serializer.php
Good stuff. Nice and easy. Feed it an assoc. array and away it goes.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
well, my problem was that the fopen hasn't timed out this means i dont have
a valid fp to set set_stream_timeout on. Im using fsockopen now and
everything should be ok.
next thing is - why does cgi php create sh zombies if its started from cron
?
regards Head
Curt Zirzow [EMAIL PROTECTED]
You don't have to put it right at the beginning of the file, it just
has to be before any output. Please see:
https://www.reversefold.com/tikiwiki/tiki-index.php?page=PHPFAQs#id681470
If that could use better wording and more info, let me know.
On Sun, 18 Jul 2004 09:08:26 +0100, Harlequin
Trejkaz, I'll make you a deal. I'll test out some code for you on my windows
box and you test out my code on your linux box. I'm also building unit tests
into the package so it should be easy to test everything.
In any case, I started testing this out a little more on my box and noticed a
Not to start flame. I have been writing php using just vim for some
time, it is a waste of time to put 'echo' statement everywhere to track
variable values. I wonder what do the experienced users on php.net use
for php development? Do you use IDE? Do you use Zend?
Is there an alternative free
pre
?
define(LOGIN,user);
define(PASS,pass);
define(DB,mysql);
function dblogin($login,$pass,$db)
{
$mysql = mysql_connect(localhost,$login,$pass);
mysql_select_db($db,$mysql);
}
?
/pre
If you're trying to protect your login credentials, you could create a class for
performing mysql
[EMAIL PROTECTED] wrote:
Programming PHP by O`Reilly :)
Write-up says it STILL uses MySQL as it's database material ;(
I don't know what Write-up you are refering to. The book is not tied to
MySQL. It mentions it only as one of the many databases that PHP supports.
The examples that I see, unless
Hi everyone. A few quick pointers if you have time...
I've created a session, easy enough:
?php session_start(); ?
I've created variables:
$_SESSION['UserID'] = UserID;
$_SESSION['Authorised']=yes;
$_SESSION['logname'] = $logname;
When a user clicks a link to a test page I created the following
Harlequin wrote:
Hi everyone. A few quick pointers if you have time...
I've created a session, easy enough:
?php session_start(); ?
I've created variables:
$_SESSION['UserID'] = UserID;
$_SESSION['Authorised']=yes;
$_SESSION['logname'] = $logname;
When a user clicks a link to a test page I created
you need to call session_start() on every page, yes.
Also, if you're bored with assigning values like that, and you're sure
you're not overwriting anything, you could try:
$_SESSION = array('UserId'='userid', 'Authorised'='yes','etc'='blah');
However, remember that you don't need to REassign
This - I think - highlights the problem. *I* have been programing for
25+ years, but only switched to PHP last year. I decided not to worry
I would love to hear why you switched... although some might consider it off
topic.
too much about PHP4, and have only run with the Beta PHP5. PEAR DB
I've no problem declaring variables that way - used to it from VB anyway.
Just wondered if there was a better way that's all.
--
-
Michael Mason
Arras People
www.arraspeople.co.uk
-
Jason Barnett [EMAIL PROTECTED] wrote in message
OK, so here's my conundrum...
After verifying the user and pulling all fields from the record I declare
two variables (just testing here):
$_SESSION['UserID'] = UserID;
$_SESSION['FurtherComments'] = FurtherComments;
on the next page I start a session, everything OK.
I echo the UserID variable
Harlequin wrote:
OK, so here's my conundrum...
After verifying the user and pulling all fields from the record I declare
two variables (just testing here):
$_SESSION['UserID'] = UserID;
now contains the string / constant UserID
$_SESSION['FurtherComments'] = FurtherComments;
now contains the
Thanks very much Tularis :)
--
-
Michael Mason
Arras People
www.arraspeople.co.uk
-
Tularis [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
you need to call session_start() on every page, yes.
Also, if you're bored with
Michael
session_start() starts and resumes a session placing it in script that is being called
will make
the variable visible.
Mike
So If I needed say 10 session variables all based on field values in the
database I'd have to execute 10 separate queries and assign each variable
separately...?
If that's the case then fine - as I only need do it once I know, but it does
seem a rather long winded way of doing things.
--
Harlequin wrote:
So If I needed say 10 session variables all based on field values in the
database I'd have to execute 10 separate queries and assign each variable
separately...?
If that's the case then fine - as I only need do it once I know, but it does
seem a rather long winded way of doing
Jason Barnett wrote:
This - I think - highlights the problem. *I* have been programing for
25+ years, but only switched to PHP last year. I decided not to worry
I would love to hear why you switched... although some might consider it
off topic.
All of my systems last century used Borland C++
I have just had a message asking me to verify my eMail for this list.
On clicking on the link it asks me to copy the numbers from the image
into the text box, but the image is just a blank cyan grid.
Can anybody responsible for starting this shead any light?
--
Lester Caine
Jason
Would there be anything wrong with using an include statement at the top of
every page and the include page could then start a session, execute queries
etc or would the session not start as it's not the first line in the
page...?
--
-
Michael Mason
Arras
Harlequin wrote:
Jason
Would there be anything wrong with using an include statement at the top of
every page and the include page could then start a session, execute queries
etc or would the session not start as it's not the first line in the
page...?
That's completely fine. The main thing is,
Jason Barnett wrote:
Harlequin wrote:
Jason
Would there be anything wrong with using an include statement at the
top of
every page and the include page could then start a session, execute
queries
etc or would the session not start as it's not the first line in the
page...?
That's completely
I have the following code
[CODE]
?php
$dbconn3 = pg_connect(host=somehost port=5432 dbname=adatabase
user=postgres);
?
[/CODE]
And when i run the script I get Warning: pg_connect()
[function.pg-connect]: Unable to connect to PostgreSQL server: FATAL:
missing or erroneous pg_hba.conf file
I
Hello everyone,
I am usinng the following code to convert an xpath to a node. I was
wondering if there is any way I can get the parent node of $node from
the code below. Is there any other way that I can convert the xpath to
the corresponding parent node?
?
// Code for loading $dom_doc comes
Well, then something went wrong with your postgres installation.
This file should be somewhere in /etc (/etc/postgresql/pg_hba.conf for
example). If this is your own system try to search for it, like this
for example:
find /etc -name pg_hba.conf
If it is missing, you can create it yourself, but
* Thus wrote gohaku:
Hi everyone,
I have been experimenting with defining functions as constants.
Below is what I am using to test Function Constants:
pre
?
define(LOGIN,user);
define(PASS,pass);
define(DB,mysql);
define(DBLOGIN,dblogin(LOGIN,PASS,DB));
This is simply not allowed.
see:
I have been experimenting with defining functions as constants.
Below is what I am using to test Function Constants:
pre
?
define(LOGIN,user);
define(PASS,pass);
define(DB,mysql);
define(DBLOGIN,dblogin(LOGIN,PASS,DB));
This is simply not allowed.
see:
http://php.net/define
Can you elaborate on
Ed Lazor wrote:
phpNuke is also popular.
And plenty of bugs and security holes ...
Regards,
Jordi.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
The file has to be only on the remote server (the one running the database)
or on my server also?
Jurgen Stroo [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
Well, then something went wrong with your postgres installation.
This file should be somewhere in /etc
The specific statements:
From http://us2.php.net/manual/en/language.constants.php
'Once a constant is defined, it can never be changed or undefined.'
'Only scalar data (boolean, integer, float and string) can be contained in
constants.'
'Constants may not be redefined or undefined once they have
Bob Imperial wrote:
Warning: session_start(): open(/tmp\sess_ff8651f382492ae56f436690d81ff124,
O_RDWR) failed: No such file or directory (2) in
c:\inetpub\wwwroot\phptest\listing10.1.php on line 15
You just need to set session.save_path in you php.ini file or use
session_save_path() before you
My intention is:
Include a file
1st line on file starts session
Include another file, this will execute all the queries I need and set
session variables.
--
-
Michael Mason
Arras People
www.arraspeople.co.uk
-
Jason Barnett [EMAIL
On Sun, 18 Jul 2004 11:29:25 +1000 Trejkaz Xaoza [EMAIL PROTECTED] wrote:
Php wrote:
And you can also used a php variable to detect multiple submit:
Even better would be using a token which you give to the user when the form
is displayed. That way they can't accidentally submit the form on
On Sun, 18 Jul 2004 05:44:21 -0400 Jason Barnett [EMAIL PROTECTED]
wrote:
If you're trying to protect your login credentials, you could create a
class for performing mysql actions. Then put the credentials into
private/protected members or constants.
How does that protect them? Ultimately,
A terrific IDE editor. Is a low cost shareware.
http://www.waterproof.fr/
Zhang Weiwu wrote:
Not to start flame. I have been writing php using just vim for some
time, it is a waste of time to put 'echo' statement everywhere to
track variable values. I wonder what do the experienced users on
On Sunday 18 July 2004 18:49, Harlequin wrote:
So If I needed say 10 session variables all based on field values in the
database I'd have to execute 10 separate queries and assign each variable
separately...?
You don't *need* to perform 10 separate queries unless you *have* to.
--
Jason
On Sunday 18 July 2004 16:28, Head wrote:
next thing is - why does cgi php create sh zombies if its started from cron
?
If you're invoking PHP from a shell then you really should be using the CLI
version.
--
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems
On Sunday 18 July 2004 16:08, Harlequin wrote:
New myself but have started reading around sessions and found that you need
two things enabled at the server end:
track_vars
Recent versions of PHP have track_vars enabled, period.
trans-sid
I believe you mean:
session.use_trans_sid
This
On Sunday 18 July 2004 19:13, Lester Caine wrote:
I have just had a message asking me to verify my eMail for this list.
On clicking on the link it asks me to copy the numbers from the image
into the text box, but the image is just a blank cyan grid.
Can anybody responsible for starting this
On Sunday 18 July 2004 23:06, Ciprian Constantinescu wrote:
The file has to be only on the remote server (the one running the database)
or on my server also?
On the server. You have not installed postgresql correctly. This is not a PHP
issue. Refer to the postgresql docs, or ask on the
Jason Wong wrote:
On Sunday 18 July 2004 19:13, Lester Caine wrote:
I have just had a message asking me to verify my eMail for this list.
On clicking on the link it asks me to copy the numbers from the image
into the text box, but the image is just a blank cyan grid.
Can anybody responsible for
On Monday 19 July 2004 01:58, Lester Caine wrote:
Jason Wong wrote:
On Sunday 18 July 2004 19:13, Lester Caine wrote:
I have just had a message asking me to verify my eMail for this list.
On clicking on the link it asks me to copy the numbers from the image
into the text box, but the image
In a message dated 7/18/2004 2:58:49 AM Pacific Daylight Time,
[EMAIL PROTECTED] writes:
[EMAIL PROTECTED] wrote:
Programming PHP by O`Reilly :)
Write-up says it STILL uses MySQL as it's database material ;(
I don't know what Write-up you are refering to. The book is not tied to
MySQL. It
On Sun, 18 Jul 2004 12:13:14 +0100, Lester Caine [EMAIL PROTECTED] wrote:
I have just had a message asking me to verify my eMail for this list.
On clicking on the link it asks me to copy the numbers from the image
into the text box, but the image is just a blank cyan grid.
Can anybody
Most of the mails from php-general is going is marked as spam.
is anyone else experiencing the same?
Manoj
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
I am working on creating a tool that processes mail for a support
system. The script works, but still sends a bounce message.
Code: http://www.janix.net/test/mail.phps
When the script processes the e-mail, it sends a bounce with the
output of the script. I got rid of the output in the bounce
Justin Patrin wrote:
I have just had a message asking me to verify my eMail for this list.
On clicking on the link it asks me to copy the numbers from the image
into the text box, but the image is just a blank cyan grid.
Can anybody responsible for starting this shead any light?
I got the same
Jason Wong wrote:
Are you saying that you sent some message to this list and got back a message
asking you to click on a link to confirm that you're not a spammer? If so
then I misunderstood your problem. I originally thought that you got this as
a result of trying to subscribe to the list so I
On Mon, 19 Jul 2004 01:41:49 +0800 Jason Wong [EMAIL PROTECTED]
wrote:
Not strictly correct. Use session_start() *before* *any* *output* - the
archives keep pointing this out. A quick search on the error message
cannot send headers will lead to loads of answers. Yet people still keep
asking
All,
This should be dirt simple -- So simple, in fact, that I'm somewhat
embarassed to make this post, but, oh well
I need to find all lines that begin with the string 'WAZ' after reading from
a url (http://www.atmos.washington.edu/data/zone_report.KSEW.html). While
I've tried every
Nope, mine go in the right placeunless it's spam. ;-) Make sure to
click Not Spam so that you show it that it's not supposed to be
spam.
On Sun, 18 Jul 2004 20:23:42 +0100, Manoj Nahar [EMAIL PROTECTED] wrote:
Most of the mails from php-general is going is marked as spam.
is anyone else
It could possibly be the return value of the script. It could also be
that some blank output is happening. Try adding this to the command
line:
/dev/null 21
This will send all output to /dev/null and send all error output alto
to /dev/null.
On Sun, 18 Jul 2004 12:57:04 -0700, Jason Williard
On Sun, 18 Jul 2004 21:32:15 +0100, Lester Caine [EMAIL PROTECTED] wrote:
Jason Wong wrote:
Are you saying that you sent some message to this list and got back a message
asking you to click on a link to confirm that you're not a spammer? If so
then I misunderstood your problem. I
Michael T. Peterson wrote:
I need to find all lines that begin with the string 'WAZ' after reading from
a url (http://www.atmos.washington.edu/data/zone_report.KSEW.html). While
I've tried every combination of expressions under the sun (using the
functions preg_match(), ereg()), I can not figure
hi...
this is cross posted to a number of lists as it seems to touch on all the
apps...
that said. i'm trying to build the PHP-5.0 version to run as an Apache mod.
i need to work with mysql to get the mysqli function.
i have rh8.0 linux. i'm using
-httpd-2.0.50 (built from both rpm/src)
Evening.
Just wondering if there's a quick and easy way to validate form fields using
PHP.
Not really that concerned with actual content by using REGEX but want to
ensure users have at-least bothered to put something in and if not display
an error with the form field's name maybe.
Any
Hello,
On 07/18/2004 07:42 PM, Harlequin wrote:
Just wondering if there's a quick and easy way to validate form fields using
PHP.
Not really that concerned with actual content by using REGEX but want to
ensure users have at-least bothered to put something in and if not display
an error with the
Harlequin wrote:
Just wondering if there's a quick and easy way to validate form fields using
PHP.
Not really that concerned with actual content by using REGEX but want to
ensure users have at-least bothered to put something in and if not display
an error with the form field's name maybe.
empty()
What the hell have I done this time...?
Well, more to the point - what gave I missed...?
if ($_SESSION[Authorised]=Yes);
{
// Body ~ Verified User:
echo brbrbr;
echo pThank you $UserCName, Now please just provide the following
information
and your aProfile will be loaded.;
}
else -
Hello all,
Is there any easy and efficient way to separate files extention that
vary in size?
Some have 3 chars after the dot, some 2, some 1, some 4, some none.
Examples:
test.zip
test.gz
test.z
test.jpeg
test.jpg
test (no extention)
an have the result returned on a $fext field?
I think this
I figured it out.
Got the semicolon at the end of that first line.
Doh...!
--
-
Michael Mason
Arras People
www.arraspeople.co.uk
-
Harlequin [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
What the hell have I done this
Simple as that eh...?
If (formfieldname = empty())
{
Do something
{
Else
{
do something else
}
??? am I on the right tracks...?
--
-
Michael Mason
Arras People
www.arraspeople.co.uk
-
John W. Holmes [EMAIL PROTECTED] wrote in
i want to use utf8 charset to connect the mysql4.1.x,and use the mysql
charset for tables,columns.
but i cant found the charset setting or function in php.
how can i do it?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
i want to use utf8 charset to connect the mysql4.1.x,and use the mysql
charset for tables,columns.
but i cant found the charset setting or function in php.
how can i do it?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Harlequin wrote:
if ($_SESSION[Authorised]=Yes);
You know this will _always_ be true, don't you?
--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/
php|architect: The Magazine for PHP Professionals www.phparch.com
--
PHP General Mailing List (http://www.php.net/)
To
how can I do that in php5 in windows ?
not enough =s.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
* Thus wrote Manuel Lemos:
Hello,
On 07/17/2004 03:11 AM, Curt Zirzow wrote:
For SMTP, all lines should be ended with CR+LF, or else messages may be
discarded by spam filters or other programs. However, if you use the
mail() function it may do some filtering on its own.
The mail()
On Monday 19 July 2004 07:34, Harlequin wrote:
Simple as that eh...?
If (formfieldname = empty())
The canonical form is:
if (empty($doo)) { ... }
--
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design Hosting * Internet Intranet
if (empty($_REQUEST['formfieldname'])) {
//do something
} else {
//do something else
}
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
On Monday 19 July 2004 06:32, bruce wrote:
Wasn't a similar question posted lasted week? Check the archives.
this is cross posted to a number of lists as it seems to touch on all the
apps...
Ths only serves to annoy a greater number of people.
--
Jason Wong - Gremlins Associates -
Hello,
On 07/18/2004 10:21 PM, Curt Zirzow wrote:
For SMTP, all lines should be ended with CR+LF, or else messages may be
discarded by spam filters or other programs. However, if you use the
mail() function it may do some filtering on its own.
The mail() function does not do any filtering.
Read
On Monday 19 July 2004 03:57, Jason Williard wrote:
I am working on creating a tool that processes mail for a support
system. The script works, but still sends a bounce message.
Code: http://www.janix.net/test/mail.phps
When the script processes the e-mail, it sends a bounce with the
On Monday 19 July 2004 07:44, Unreal HSHH wrote:
i want to use utf8 charset to connect the mysql4.1.x,and use the mysql
charset for tables,columns.
but i cant found the charset setting or function in php.
how can i do it?
Reposting this at 10 minute intervals will very likely annoy people
On Monday 19 July 2004 07:22, C.F. Scheidecker Antunes wrote:
Is there any easy and efficient way to separate files extention that
vary in size?
Please RTFM. A quick browse through the String functions would have broguht
your attention to explode().
But the easiest solution is pathinfo().
* Thus wrote bruce:
hi...
this is cross posted to a number of lists as it seems to touch on all the
apps...
Please don't do this.
i'm trying to use the following configure
./configure --with-apxs2=/usr/sbin/apxs --with-config-file-path=/etc --with
-mysql=/usr/include/mysql
* Thus wrote Harlequin:
if ($_SESSION[Authorised]=Yes);
{
// Body ~ Verified User:
echo brbrbr;
echo pThank you $UserCName, Now please just provide the following
information
and your aProfile will be loaded.;
}
else - The offending line...!
{
echo You need to go back and
I'm a bit confused as to what you mean by posting the list into a text field (do
you want to print_r the list?). But an easy, efficient (I think) way to do this
is strrpos().
?php
function sort_extensions($a, $b) {
$apos = ($pos = strrpos($a, '.')) ? (strlen($a) - $pos) : 0;
$bpos = ($pos
jason...
there have been postings/etc... however, as far as i can tell, the posters
haven't stated that their issues have been solved. as far as i know, they
just gave up.. and said to hell with it!!!
nothing in the archives points to a solution...
but if you have a solution, and have actually
If someone has access to the source then yes, you're screwed. But you can put
your class library outside of the document root and keep the login information
inside the class instead of keeping that information in your web pages.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe,
Hi,
You have two problems in these line:
Harlequin said:
if ($_SESSION[Authorised]=Yes);
1. The obvious ; at the end of the line.
2. $_SESSION[Authorised]=Yes it's different to write:
$_SESSION[Authorised]==Yes
Cheers,
--
Rodrigo Castro Hernandez
--
PHP General Mailing List
1. The obvious ; at the end of the line.
2. $_SESSION[Authorised]=Yes it's different to write:
$_SESSION[Authorised]==Yes
Gotta love c style languages where variable assignment is like variable
comparison.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit:
Sorry, but I have to respond to this because of the falicies that
are involved with the whole issue.
* Thus wrote Manuel Lemos:
Hello,
On 07/18/2004 10:21 PM, Curt Zirzow wrote:
If you pay more attention you may notice that I always say that it
*sounds* like a PHP bug. I am not even
On 19/07/2004, at 9:22 AM, C.F. Scheidecker Antunes wrote:
Is there any easy and efficient way to separate files extention that
vary in size?
Some have 3 chars after the dot, some 2, some 1, some 4, some none.
Examples:
test.zip
test.gz
test.z
test.jpeg
test.jpg
test (no extention)
?
$filename
Alawi albaity wrote:
how can I do that in php5 in windows ?
perhaps by reading about it..
--
Raditha Dissanayake.
http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload
Lean and mean Secure FTP applet
* Thus wrote Rodrigo Castro Hernandez:
Hi,
You have two problems in these line:
Harlequin said:
if ($_SESSION[Authorised]=Yes);
1. The obvious ; at the end of the line.
2. $_SESSION[Authorised]=Yes it's different to write:
$_SESSION[Authorised]==Yes
nice catch.
Curt
Hello,
On 07/19/2004 12:32 AM, Curt Zirzow wrote:
If you pay more attention you may notice that I always say that it
*sounds* like a PHP bug. I am not even saying that is necessarily a PHP
bug.
what ever you are trying to say about it being a bug or not, it is
one of the worst ways i've ever
So I have Internet Explorer 6.0 with XP and have also installed Microsoft .NET
framework 1.1. I
can't get my .php files to be viewed with my web browser. html files are diplayed okay
but with
php files i get a blank screen.
I guess i need plug-ins for Internet Explorer but i thought that .NET
So I have Internet Explorer 6.0 with XP and have also installed
Microsoft .NET framework 1.1. I
can't get my .php files to be viewed with my web browser. html files
are diplayed okay but with
php files i get a blank screen.
I guess i need plug-ins for Internet Explorer but i thought that .NET
Is it possible to catch $variables coming from a database that have
spaces? my program generates something out of a database and just
display them. now i did have an option for them to download the files,
but some of my files have spaces. the quick way for me to do it is add
%20 for all spaces on
This should work... enjoy!
## code, using PEAR DB ##
while ($q-fetchInto($row)) {
print (
tr
td width=90 align=center .$row[0]. /td
tda href=FILES/ .$row[1]. .$row[1]. /a/td
tda href=FILES/ .rawurlencode($row[1]). .$row[1]. /a/td
td .$row[2]. /td
/tr
);
};
## end
94 matches
Mail list logo