See Kok Boon wrote:
Sorry, I am abit dumb. Where is the archive that you refer to in your email?
The PHP archives. Go to the PHP web site and follow the links to the
mailing lists page. There you will find links to the archives.
Jc
--
PHP General Mailing List (http://www.php.net/)
To
Hi. I thought I had abstracted out the SQL querying part of my code out,
just to find out today that it doesn't work when it comes to
transactions. I had come up with this code:
function sql_query($sql) {
$conn = pg_connect(dbname=JC user=postgres);
$res = pg_exec($conn, $sql);
if
Jason Sheets wrote:
Manual Excerpt: If a second call is made to pg_connect() with the same
connection_string, no new connection will be established, but instead,
the connection resource of the already opened connection will be
returned. You can have multiple connections to the same database if
To all who replied to my initial question ...
I actually did *not* have problems with transactions in the way I first
implemented my abstraction layer. In the case of PHP
If a second call is made to pg_connect() with the same
connection_string, no new connection will be established, but
I am trying to use a command line program in Linux using this form:
$result = `/path/prog $arg`;
But this doesn't work as the program is expecting and EOF that never comes.
If I use the program on the command line when I am finished entering all
the data I need to hit return and then CTRL-D to
Marek Kilimajer wrote:
$result = `echo | /path/prog $arg`;
should work
That didn' work ... don't know why.
Isn't there a way to say echo EOF?
There must be a way to specify the ascii or hex value for EOF in an echo
statement no?
Jc
--
PHP General Mailing List (http://www.php.net/)
To
I also tried tried with popen with no success.
$fp = popen('/usr/src/bsfmdk/CCCallServer 21', 'r');
fwrite($fp, $query);
$result = fread($fp, 8096);
echo result is BR;
echo $result BR;
I get back and empty result string ...
Any more hints?
Jc
--
PHP General Mailing List (http://www.php.net/)
Marek Kilimajer wrote:
What prog is it anyway.
It is a credit card processing program. It is interactive. You can it,
type values in hit return, then ctrl-D and it spits out a status code.
If I put all the values in a file I can get the prog to work by doing:
#./prog filename
It does not
I'm at wits end ... I've tried everything from system(), shell_exec(),
bacticks, popen() and still no go ...
I even tried writing the data to file first and then doing a
system(./prog 21 ./datafile) and that didn't work either.
I know that it shoudl work b/c if from the command line I issue
Ok, found the problem. The external program I was trying to run is only
happy is it is called from the same directory as the one it resides in.
I guess it needs to access files in it's directory and by calling from
php somehow it gets confused as to where to files are.
Thanks to everyone for
Tamas Arpad wrote:
That's not right now. The manual is outdated. See this bug report
http://bugs.php.net/bug.php?id=15209.
This behavior was changed from 4.06 to 4.1. In newer versions of php the
registered functions will run before the connection is closed so ouptput can
be done from there
Matt Vos wrote:
What is the ASCII value of an EOF? Find that and use ? echo
chr($eof_ascii_value); ?
For the benefit of those reading this in the future the value is 4, so
use chr(4);
Jc
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
[EMAIL PROTECTED] wrote:
I need to be able to just extract the number that is right Under
blocks in this example it is the number 57070. This was generated by
the quota -g groupname command.
Disk quotas for group site53 (gid 165):
Filesystem blocks quota limit grace files quota
Ysrael guzmán wrote:
This is correct?
script languaje=JavaScript
location.href=page.php??=SID?cliente=$cli;
/script
You have one small mistake here:
script language=JavaScript
And a bigger mistake here:
location.href=page.php??php echo SID . cliente=$cli; ?
Jc
--
PHP General Mailing
Erich Kolb wrote:
I am going to be dealing with a ton of data shortly and my goal is to make
it accessible via the web. I am curious about the performance differences
between using a database or leaving the data in the individual files they
originated in. Can anyone offer any recommendations?
How can I detect if my PHP script is about to time-out?
I would like to be able to detect a time-out and display a page with an
appropriate error message i.e. the server is busy now, please try again
later.
Jc
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit:
Timothy Hitchens ) wrote:
Set up output buffering on your page then if the page times out the
buffer
should be sent to the browser and that is loaded with your message.
Ok. Is there another solution?
The reason I ask is that in order to use your solution I would need to
redesign my pages
Greg Beaver wrote:
http://www.php.net/manual/en/features.connection-handling.php
Nice!
So if I understand correctly I need to:
1- register a shutdown function
2- have this function check if it was called b/c of a conection_timeout()
3- And if so have the function print out my timeout error
Timothy Hitchens ) wrote:
Issue... as I said before the register shutdown won't work because:
- output from the shutdown is not visible nor do you have access to some
variables
You are right. From the manual:
http://www.php.net/manual/en/function.register-shutdown-function.php
The
Pupeno wrote:
$oer = error_reporting(E_ALL ~E_NOTICE);
$tpl-display(index.html);
error_reporting($oer);
but it still reports notices, any idea ?
Should be error_reporting (E_ALL ^ E_NOTICE);
See:
http://www.php.net/manual/en/function.error-reporting.php
Jc
--
PHP General Mailing List
Timothy Hitchens ) wrote:
There is one last option ... register an output buffer as I suggested
before suggested but this time do the reverse and you
don't have to rewrite your scripts:
Ok I think I understand what you are proposing. I just have one question
about your example code.
Where
Timothy Hitchens ) wrote:
No you can't.. the issue with this is that you need to have error
reporting turned on.. so you will need to have
more error collecting or removing.
[..]
This isn't the best for a production env but this is the best I can see
considering you don't want to rewrite!!
Markus JäNtti wrote:
?
if($_GET[test] == test) { echo A; }
else { echo B; }
?
You forgot the double quotes ... Should be:
if($_GET[test] ...
Jc
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Bruce Levick wrote:
I am looking to populate a list menu with the current date and then the
30days after that current date. Is there a small snippet of code that
achieves this??
Hvae a look at date(), mktime() in the manual.
Here something that should help you get started, it is untested.
Bruce Levick wrote:
That's sweet. Can you just satisfy my curiosity and explain the 86400??
I am thinking this might be minutes??
It the number of seconds in a day.
But that solution doesn't take into account Daylight Savings Time.
The one I posted does, I think ...
Jc
--
PHP General
On my web site there are some areas that I want to make accessible only
after a user has logged in (for example when placing an order, etc ...)
I have been able to achieve this however I have the following problem:
1- user logs in
2- user goes to restricted area
3- user views pages, orders an
Tularis wrote:
I adives to make sure the browser doesn't cache it *at all*.
This can be done using (one, or more) of the following headers:
// HTTP 1.1 compliant:
header(Cache-Control: no-store, no-cache, must-revalidate);
header(Cache-Control: post-check=0, pre-check=0, false);
// HTTP 1.0
Justin French wrote:
I know it sounds simple, but try to analyse what other big sites are doing
in this situation:
That's exactly what I did, but I don't understand *how* they do it hence
my question.
I surfed some of the big sites and saw that they do not break when a
user hits the back
Jason Wong wrote:
The cache-control directives are only supposed to be followed if the page was
to be _explicitly_ reloaded or refreshed. The BACK button (as specified in
the standards rfc something or another) is NOT supposed to reload or
refresh a page -- it is supposed to redisplay
My company wants to set up online credit card functionality and we are
thinking of going with a company called Veritrans (I believe they are
the japanese branch or cybercash for Verisign in Japan).
However they do not support PHP. They only offer kits for Perl and Java.
Unfortunately for me
Antti wrote:
How can I count how many code lines I have written? I have many php
files in one directory. I'm using linux.Do you know any non-php way to
count the lines.
from a directory one level above where all your files lie do this:
(assuming all you files are in a directory called php)
Matty Rozen wrote:
by using the 'curl' module, you can use any calls needed to any type of
scripts. you can use curl to talk with the cgi.
Ok, I'll look into CURL. If I understand their system, it is meant to be
called from a form so CURL might be applicable.
let me know if you need more
Michael Sims wrote:
I 'm not where I can test this right now, but if a session is older
than session.gc_maxlifetime, isn't it invalid anyway? I.E. if I
bookmark a page on your site and then come back 3 hours later passing
an old SID, shouldn't that session have expired on the server by that
Michael Sims wrote:
Then I suppose it's just an added feature of the session handler I am
using. Maybe the OP should give it a shot, as I use it and I
definitely don't have a problem with expired sessions
I'll think about writing my own session handler as it can be quite
useful. However I
Cookra wrote:
Any help would be ideal
Some code would be nice. Youdidn't post any code so we have no idea what
your problem might be ... do you get an error message, or no results, or
the wrong results?
We don't even what what SQL query you are using ...
Jc
--
PHP General Mailing
Ernest E Vogelsinger wrote:
No, that's a misunderstanding. Session var's are never passed to and from
the client, only the session _name_ is passed, either via a cookie
(PHPSESSIONID) or via trans-sid href encoding.
Thanks for clearing that up! I hadn't realized that only the session
name was
Justin French wrote:
What sort of stuff are you storing in the session that your are worried
about with too many writes?
Oh, this site is just your regular, run-of-the-mill, amazon.com copy.
For each open session I store up to 20 variables. It's not a lot, but
each access to a script means a
Hatem Ben wrote:
I'm looking to implement the huffman encoding in PHP, but i would like to
ask if it isn't already done ? (why reinventing the wheel)
You have highjacked someone else's thread. Not very nice of you
Please repost and start your own message thread ... highjacked threads
Ernest E Vogelsinger wrote:
if ($_COOKIE[$_SESSION['cookie_name']] == $_SESSION['cookie_token']) {
Ok, please forgive my ignorance, but in PHP isn't $_COOKIES the same as
$_SESSION?. I thought it was if the user had cookies turned off (and
even if the user had cookies turned on come to
Justin French wrote:
PHP cannot possibly know when a user closes a window... PHP regularly
cleans out the garbage of old abandoned sessions, but you cannot expect
this instantly...
True ... but the browser does.
I think I would not have this problem using cookies since the cookie
would
Ernest E Vogelsinger wrote:
Definetely yes.
After reading Justin's post I realized that.
What I usually do (I also have session cookies switched off) is to send the
user a session cookie when he logs in. This way I can use cookieless
sessions, but when it comes to sensitive areas I can be
Ernest E Vogelsinger wrote:
This is controlled by the session.gc_probability value in your INI file
I know I can probably find this in the documentation somewhere but ...
how do I set the expire time on a session?
Increasing this value will make this
process more often, setting it to 100
Jason Wong wrote:
If you set it 100, then _every_ request in which sessions are used, PHP has to
go through all the session files (by default stored in /tmp) and check
whether they have expired. If you have a busy server you could have thousands
of session files. Checking thousands of files
I've made a site in PHP and on some pages a user needs to log in first
before gaining access to the page. (i.e. there is a log in page).
Once the user has logged in I keep that fact in a session variable so
that he doesn't need to log in again.
However I have found out that if:
1- the user
Justin French wrote:
I know that for IE Mac users (not sure about NN7) it's not until you QUIT
the application that the session is terminated...
I *think* you'll find something similar in Windows... perhaps when ALL open
browser windows are closed and/or the browser app is QUIT, the session
in my for loop being printed out
to the screen until the program terminates ??? I should get something
printed out at every 100 lines ... but nothing gets printed until the
end of the program ... At the end I get all the output I should.
But not *before* the program ends ...
Jc
Jean-Christian
I am running a PHP program under Linux on the command line. The problem
I have is that I get no output to the screen until the program finishes.
I have lots of echo statements throughout the program to help me debug
but none of them are printed until the program finishes, which is really
a
Chris Shiflett wrote:
To test this, try changing the image source (on your server) and request
the page again. If Netscape fetches the fresh resource, this might be
it. If you see the same image as before, then there is definitely a
problem somewhere.
I did as you suggested and hit the
Chris Shiflett wrote:
Luckily, it doesn't matter too much where it is set, because you should
be able to set your own with PHP (I think PHP may set it actually when
you use PHP's sessions). First, try something simple:
header(Cache-Control: no-cache);
I'll try that!
But what I want is
Chris Shiflett wrote:
Don't get too carried away here. It sounds like you are confusing two
entirely different things. Your earlier questions were related to
caching on the client, not on the server. Yes, PHP does have some
control over what the client caches through HTTP, but this is
quot;00";
//-->
[PHP] N7: Media (Page Info Tab) contents not cached bug?
Jean-Christian Imbeault
Re: [PHP] N7: Media (Page Info Tab) contents not cached bug?
Chris Shiflett
Re: [PHP] N7: Media (Page Info Tab) contents not cached bug?
Jean-Christian Imbeault
Re: [PHP] N7: Me
This is a bit hard for me to explain but is there any way to have PHP
store a persistent server-side constant. Something that will stay in RAM
and is not dependent on client connection.
For example I have this code in consts.inc file:
define (HOME_PAGE, http://myip.com/index.html);
But if I
Justin French wrote:
There is a directive in php.ini which allows a file to be included on EVERY
page that php parses... one at the very start, and one at the very end of
the script
I'm pretty sure this is server-wide, but maybe it could be site- or
directory-wide by setting the variable
Does using the auto_prepend config option in the php.ini file act
exactly like and include() call.
An include call will read the file off disk ... will auto.prepend do the
same thing or will PHP keep the file in memory for quick retrival?
Jc
--
PHP General Mailing List
Justin French wrote:
You're right... it's an include... THEN the vars will be in memory...
This is the best you can do, AFAIK, without hacking the source of PHP :)
Just asking, do you know the source well enough to say with *certainty*
that the auto prepend file is not kept in memory? If
Justin French wrote:
I'm merely guessing.
Ok. Thanks for the guess. I'll post on the dev list and see if I can get
a definitive answer.
Jc
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Jonas Geiregat wrote:
I have a date ex 24/08/02
and I need to see if that date is the same date as it is today (only one
month later) but 5day's in advanced = that would be 24/09/02
so if(date == date now - 5)
{true}
else{false}
how can I do this right ?
Look at
Mike Mannakee wrote:
Just out of curiosity, what problem are you trying to solve? Including a
file is so easy and takes so little time I wonder how this could be a
problem.
Good question, glad you asked.
I have a header on all my pages. The header is HTML and contains images.
So of
I have the following scenario
1- user comes to page A, clicks a button to get to page B
2- Page B is a form the user fills and hits the submit button
3- form data is received and I use header() to send him back to page A
So A - B - A
The problem I have is with Netscape 7, possibly other
Gary wrote:
They are not really errors they are reporting that the form fields are
empty until the form is submitted.
Notice: Undefined index:
That means your code is not doing any checking of the incoming data. You
should always check that the data coming is what you expect it to be.
Is the a particular header() call or other setting I can use to tell the
client browser to cache the contents of my php pages? (I am using Apache).
It seems like my browser (N7) doesn't even cache the images on the pages
even though those are static ...
Jc
--
PHP General Mailing List
Justin French wrote:
If there's a noticeable difference between two browsers, and you're
currently NOT setting any headers for caching, the blame will probably lie
in the preference setting of the browser, not in your code.
I thought exactly the same thing before posting. So I made sure
I am using PHP 4.2.3 and Apache 1.3.26
When a user comes to one of my php pages it comes out has http:..ip/page.php
How can I make my pages come out as .html instead of .php?
Thanks!
Jc
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
When using the View|Page Info Menu item I get a nice tabbed window
showing information for the page I just loaded. Clicking the Media tab
shows what contents the page needed and importantly whether the contents
are cached or not.
If I load .php pages I am developing off a local server
Peter Houchin wrote:
just save the files u create as .html make sure in your apache httpd.conf
where you reference for .php that u have html in here as well and all will
be sweet.
eg in this line
AddType application/x-httpd-php .php4 .php .htm .php3 .html
Super! That helps *so* much!
David Robley wrote:
Whether a document is kept in memory cache or not is not something that
php has any control over, I think; your operating system is generally what
looks after that.
Actually after asking the dev list I found that it *is* PHP can have
some control over.
That's one of
Chris Shiflett wrote:
IE ignores the no-store directive of the Cache-Control header, and
this is the most common reason behind behavior such as you are
describing.
Exactly as I was worrying ...
Get rid of no-store and just use no-cache instead to see if it
resolves the inconsistency.
I've looked through the docs but can't find what I want.
Is there a function that will let me load a jpg image, change the
saturation level and save the changed image as a new jpg?
Jc
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
I have the following code which works fine in Netscape7 but doesn't in IE5.5
$maker_name = $_POST[maker_name];
$loc = show_products.php?maker_name=$maker_name.SID;
header(Location: $loc);
The problem is that the POST variables are coming in EUC-JP (japanese)
correctly but for some reason
I get the following warning which makes no sense to me.
Warning: header() expects parameter 1 to be string, array given in
/www/htdocs/jc/administration/edit_products/show_products.php on line 96
It's true that I am passing at an array to the function, but what I
don't understand is why the
Justin French wrote:
But the
really interesting bit is that you appear to be using it NOT for sending
HTTP headers, but for setting header information on a TABLE
Oops!!
I had defined my own function called header() without even stopping to
think there was already a PHP header()
I have php page that creates an html form. When the user hits the submit
button another php script is called to parse the form and display some
output.
However I find that if I hit the back button the form values get reset.
How can I make it so that if I hit the back button the values I
Jason Wong wrote:
Have a look at the archives, it has just been answered:
Thanks. Strange that two people ask the same question at almost the same
time.
However I did search the archives and read the answer to the recently
posted question and the answers are less than ideal.
All answers
Have you looked at what the value of what $result is? It might be
informational.
Jc
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Use mod_ssl if you are doing apache.
Have a look at:
http://www.modssl.org/source/exp/mod_ssl/pkg.mod_ssl/INSTALL
Jc
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
I have the following loop to insert data into an array:
while ($data = pg_fetch_object($res)) {
$aProds[] = array('id' = $data-prod_id, 'quantity' =
$data-quantity);
}
But when I print this out using print_r I get the following:
Array
(
[0] = Array
(
[0] =
Justin French wrote:
Okay, it may be the end of a long day here, but I can't tell the difference
between the two arrays you posted!
One array contains only one element. That one element contains two
elements, each and array with two elements.
The other array contains two elements, each
Jason Wong wrote:
If $aProds can contain more than 1 item then what you're doing now is correct.
Thanks. The problem was that I was doing this:
$return[] = get_array_of_prods();
the [] was creating the extra array level ...
The problem I now face is that foreach keeps crapping out if I
When I use foreach on a uninitialized array I get the following warning:
Warning: Invalid argument supplied for foreach() in
/www/htdocs/jc/cart/add_item.php on line 21
I would expect foreach to treat an unitialized variable as an empty
array and hence do nothing. Is this the expected
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
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-
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
Dear David you haev just hijacked my thread. When you want to post a
message please do not just hit the reply button and just change the
Subject line. If you do that you message will appear in someone else's
message thread.
It really ruins it for people who use mail/news readers with threads
Alok K. Dhir wrote:
By any chance, is page one the entrance page to your application?
Yes.
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?
Nope. Is the is the entrance so there is no nothing passed to it. Users
just enter the
Jerry wrote:
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.
But if they it the back button again they would
I'm interested in finding out the answer to this since it seems that I
will need to implement my own session handler.
I need to pass session information from SSL connections to non-SSL
connections (albeit on the same server) and PHP doesn't seem to be able
to do this ...
Jc
--
PHP General
I have compiled PHP with the following:
'./configure' '--with-pgsql' '--without-mysql' '--enable-track-vars'
'--enable-mbstring' '--enable-mbstr-enc-trans' '--enable-mbregex'
'--enable-trans-sid' '--with-apache=../apache_1.3.26/'
Unfortunately it seems that the --enable-trans-sid option is
The problem what that I was using header(Location: http://mysite.com;)
and it seems that PHP will not automatically insert the SID in this case.
Now I need to find a quick and simple way to see if cookies are disabled
or not. If they are I need to manually add the SID to the header() call
. .
How can I make crypt() use blowfish encryption?
It seems that my system (RH7.2 Linux) doesn't support Blowfish according
to CRYPT_BLOWFISH:
CRYPT_BLOWFISH = 0
How can I add blowfish support to my system if crypt() requires it?
Jc
PS I don't want to use mcrypt(). I just want to install
I'd like to use the crypt() function and have it use Blowfish
encryption. However it seems that my system doesn't support blowfish
encryption since I get:
CRYPT_BLOWFISH = 0
My system is a linux RH7.2 box. How can I make blowfish encryption
available to PHP's crypt?
Jc
--
PHP General
Sorry for the vagueness of the subject line but I wasn't sure what to put.
Here's what I'd like to do:
1- user comes to my web site with normal (non-SSL) connection
2- user enter login name and password
3- data is submitted to a PHP script via SSL connection to same web server
4- PHP script
Dan Hardiker wrote:
Use mcrypt. See the manual.
I don't want to use mcrypt :) It requires me install a separate library.
Or do you mean that the only to get crypt() to use Blowfish is to
install mcrypt?
What does crypt() require, on a RH7.2 Linux machine, in order to use
Blowfish?
Jc
Wayne wrote:
All you need is:
form action=https://domain/filename method=post
Sounds too easy, there must be a catch ;)
Thanks!
Jc
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
I start a session under an SSL connection (https), do some work, and
then register some variables. I then do a header(location:
http:/somepage.php). the page is loated on the same server that was
doing the SSL work.
My question is are the session variable I registered under the SSL
Liam, when you want to post a new message to the list don't just hit the
reply button and change the subject. If you do that you message appears
in the thread of the message you replied to.
It really messes things up for people who follow message threads. And
worse you might not get any
How can I make crypt() use blowfish encryption?
Also it seems that my system (RH7.2 Linux) doesn't support Blowfish
according to CRYPT_BLOWFISH:
CRYPT_BLOWFISH = 0
How can I add blowfish support to my system if crypt() requires it?
Jc
PS I don't want to use mcrypt(). I just want to install
How can I run a PHP program from the command line in linux?
I want to dosomething like:
#php prog.PHP
Jc
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Jason Wong wrote:
Manual - Using PHP from the command line
Thanks!
Now for a really dumb question. How do I compile PHP so that I can get a
binary executable instead of an Apache module?
Jc
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit:
Jason Wong wrote:
./configure
make make install
Thanks!
I also have PHP compiled as an apache module and need it. Will this
overwrite anything needed by the PHP/apache module?
Jc
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
When a user hits the submit button I'd like to do some client-side
validation before sending the form data to the server.
What is the proper way to do this in Javascript? I.e. should I use the
form's Sumbit button's onClick() event to trigger the client-side
Javascript validation function and
101 - 200 of 232 matches
Mail list logo