Hi!
I'm using the following method to generate 5 random lottery
numbers:
/* srand is not important since php v>=4.2.0 */
$numbers = range (1,90);
$x = array_rand ($numbers, 5);
foreach ($x as $v) echo "{$numbers[$v]} ";
It works fine, except the first query: php may restart the random
numbers, if
eless php functions, that use random numbers
adjusted to the simple srand() such as shuffle())
Tamas
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
On Wednesday 08 January 2003 06:42, Jean-Christian Imbeault wrote:
> 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:
>
> Cool! I just tested it out and it works. At lest under PHP 4.3.0 and
> Apache 1.3.26.
>
> But according to the bug report this functionality may change in the
> future and a new function apache_register_shutdown() might replace the
> current one ...
>
> The current functionality is *not* what is
On Friday 10 January 2003 17:39, Scott Fletcher wrote:
> > Javascript has a function for performing actions on window close
> That would work only if the webserver IP address is '127.0.0.1' (local
> machine), but not any other IP address. Because of the ACK synchrious
> communication that get
On Monday 13 January 2003 15:14, Scott Fletcher wrote:
> Let us know how it goes... The unload event had been tried also. The
> javascript have been running for a while but the network communication is a
> bit tricky, it haven't worked well.
Sorry, maybe I missed or forgot the original problem. I
On Monday 13 January 2003 18:09, Scott Fletcher wrote:
> It's no problem. We're all very interesting in finding out what can work.
>
> Maybe I can help with one of this problem. The Gecko browser does have the
> option of blocking the opening of hte unrequest window which is maybe why
> yours doe
> So this is the only way I guess ...
>
> Do you propose to serialize() the objects in the tree and write that data
> into a shared memory block, and then deserialize them at the beginning of
> each script that needs the data back into objects ? I would think that that
> would impose the same perfo
Hi,
I'm thinking about using SRM application server for storing cached data. But I
have to convince my customers that it's stable enough and is ready to use in
production environment.
Is it considered stable enough to use in such applications? As I see it hasn't
been maintained for at least half
On Monday 10 February 2003 16:03, Derick Rethans wrote:
> On 10 Feb 2003, Tamas Arpad wrote:
> > I'm thinking about using SRM application server for storing cached data.
> > But I have to convince my customers that it's stable enough and is ready
> > to use in pr
Hi,
The question is mainly for the developers of SRM, but I'm sure there are
others who use it.
I'm implementing a caching method where cached data is stored in hashes. Now
it works with file storage, files' names are the keys and the values are
stored in within the files. I'm considering making
Hi,
I'm searching for a good http benchmark tool. Of course I found some, but
don't know them and don't know which one to choose.
I found JMeter slow, in other aspects it would be perfect. Used httperf
before, but I need more complicated test cases. I'd like to simulate visitors
who first go to
On Tuesday 04 March 2003 17:43, Jason k Larson wrote:
> How about Apache Bench?
>
> http://httpd.apache.org/docs/programs/ab.html
It's really a cool program, but too simple. I need to simlute requests that
are normally made by visitors, not just stress one url.
For example: main page->click on a c
Experimenting with it, thanks!
Arpi
> This is what I use ->
> http://www.joedog.org/siege/index.shtml
>
> Tamas Arpad wrote:
> >Hi,
> >I'm searching for a good http benchmark tool. Of course I found some, but
> >don't know them and don't
> I need to know if there is a way to get HTML data from an URL.
http://www.php.net/manual/en/function.fopen.php
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
On Sunday 30 June 2002 09:52, Justin French wrote:
> on 29/06/02 3:20 AM, Tamas Arpad ([EMAIL PROTECTED]) wrote:
> >> I was thinking if you use 90 character long filenames, assuming you
> >> only use the letters of the alphabet and the digits then you would
> >>
On Wednesday 02 January 2002 20:43, you wrote:
> What you need to do is simply set the variables before you include
> the script.
>
> When you include a script with include() or require(), they fall
> into the same namespace as the include() or require() function that
> called them.
I read that in
On Thursday 03 January 2002 13:36, Tim Ward wrote:
> Include will act relative to the path of the script not the
> included file that the include is in.
>
> If you have an include in a file which is itself included and which
> isn't always called from files in the same directory you need to
> make
> I'm having issues with my php pages. When I have errors, Instead of
> crashing or showing errors, the browser shows a blank page.
> PHP does not report the error.
> My php.ini is configured as
> error_reporting =
> E_COMPILE_ERROR|E_ERROR|E_CORE_ERROR|E_USER_ERROR|E_USER_WARNING|E_
>USER_NOTICE
> > Do you null the user if the IP changes? IPs can change
> > during a user's
> > session, so I wouldn't base the validity of the session
> > solely based on IP.
> When that happens a user has to relogin. No data will be lost.
Relogin? Huh, I'd never visit a site where I have to login on every
Hi,
I'm trying to make some kind of caching system that first delivers
the old page, and then regenerate the new one "in the background". I
achieved this with register_shutdown_function(). The registered
function starts the real work, the normal php script just delivers
the old page (of course
Hi again,
I read my email back and found a little hard to understand :)), so I
thought a code exmplae might help.
It's just pseudo code for explaining how my cache works:
//simplified "main" code
if page is in cache {
deliver the old one
register_shutdown_function("regenerate")
Hi,
No one has any idea on this topic? Or the question wasn't clear?
Thanks,
Arpi
> Hi again,
> I read my email back and found a little hard to understand :)), so
> I thought a code exmplae might help.
> It's just pseudo code for explaining how my cache works:
>
> //simplified "main" code
Hi again,
Joseph answered this on the dev list
(http://lists.php.net/article.php?group=php.dev&article=84800),
thanks.
Arpi
On Monday 03 June 2002 17:57, you wrote:
> Hi,
> I use register_shutdown_function to regenerate my content-cache's
> data after the old page were sent. In 4.0.6 t
Hi,
I use register_shutdown_function to regenerate my content-cache's
data after the old page were sent. In 4.0.6 there was no problem with
it, the connection was closed after the normal script is finished,
and before the shutdown_registered function is started (which does
the real work). So I
Hi Everyone!
I have an idea, but I don't know how to realise it, if it can be at
all.
We have a relatively big system, with 52k lines of php code without
much html, and many classes (1138) that depend on each other.
And I think I don't need to say that php parses the code somewhat
slow. That's
Ok, Thank you for your help Miguel and Maxim, I'm trying to do it by
the help of your suggestions.
Arpi
> > >Also, you can find out if a class was defined by calling
> > >'class_exists()'. In this way you might save something.
> > >The best way thought is what Miguel was saying: load t
Hi Eric (and others who might help),
Actually I haven't tried the custom error handler for "function or
class definiton not found errors" because I read in the manual that
the processing is continued after the "statement" where the error
raised. I also thought of a little hacking in php's sour
On Wednesday 17 October 2001 19:47, php wrote:
> Hello,
>
> Warning: Unknown list entry type in request shutdown (0) in
> Unknown on line 0
> appears on the bottom of every script I call that uses domxml.
> I have no idea was causes it... Any tips?
try to use (and compile php with) another versio
On Friday 19 October 2001 11:52, George Pitcher wrote:
> Hi all,
>
> I am delivering my PDF files from a non-internet directory. The
> file gets delivered but the filename is always changed to the name
> of the php script.
>
> Can anyone tell me how to get the file delivered so that the name
> sta
On Saturday 20 October 2001 02:35, you wrote:
> Hi guys,
>
> Also, is it really risky to develop in DOM, considering the module
> is experimental, and in theory it could change ?
We are working with dom for about a year. Our project depends on it,
so I hope it won't change much :))
By the way we
On Wednesday 24 October 2001 08:19, you wrote:
> Well, php runs the same as apache, so whatever apache can access,
> php can access.
> So any files with the db passwords that need to be accessed by php,
> can be seen by all users who can upload php scripts to your server.
That's not completely tru
On Tuesday 23 October 2001 21:17, Vinicius Tavares wrote:
> What I have to do to make the PHP4 run the DOM XML???
Download the libxml library (the development packages too, if you
download the packaged distrib).
And compile php with it (--with-dom switch for configure).
http://www.xmlsoft.org
On Wednesday 24 October 2001 11:38, php wrote:
> Firstly,
>
I use php 4.0.5 and libxml 2.3.9 on several machines without any
problem.
Older php and libxml combinations however caused many segmentation
faults, especially with not well-formatted xmls.
Are you sure that you warning message is rel
On Wednesday 24 October 2001 16:42, Kurt Lieber wrote:
> On Wednesday 24 October 2001 00:30, you wrote:
> > What we
> > really need is an expert here to give us the low-down on the best
> > way to accomplish the best security given regular tools.
>
> There isn't a way to solve it within the constr
On Wednesday 24 October 2001 19:14, Richard S. Crawford wrote:
The default value for $image parameter was missing:
> function top ($image="defaultvalue") {
> if ($image=="defaultvalue") echo "blah blah blah";
> else echo "blah blah $image blah";
> }
>
Arpi
--
PHP Gene
really necessary, but I like to make code without any warning
message (it also makes the code more cleaner as you said), and you'll
get a warning message if there's no parameter given at the function
call (without the default value).
Arpi
>
> At 10:30 AM 10/24/2001, Arpa
On Thursday 25 October 2001 09:47, Joseph Blythe wrote:
Hi,
bad news
disable_functions doesn't work for me either in apache's config file
I tried it with php_value, and php_admin_value, also in .htaccess
with php_value without any luck
php4.0.5, Apache/1.3.14
bye,
Arpi
> Hey All,
>
> W
> Unfortunately, you can't include FUNCTION() conditionaly (well, you
> can, but then you can't use it out of this if():). Why only such
> dumn restriction, PHP developers?
I think it's only true for php3
I use many many class definitions in php4 that are inluded
conditionally in another classes
On Wednesday 31 October 2001 14:48, René Fournier wrote:
> Nope, unfortunately, nothing. It's a really weird problem. It's
> like the PHP function I wrote for generating the random image will
> only work the first time.
I think it is not php that caches it. As I undertsand you wrote a
script th
I look
> at these EXACT SAME pages on Fatcow (Linux/Apache, I believe,
> PHP4...), the randbg() function executes the first time, then
> [seemingly] fails to execute again--it never generates a different,
> random bakground. (Or maybe I'm looking at one hell of a
> coincidenc
On Wednesday 14 November 2001 14:58, you wrote:
I think mixing of the web application's and the host's operating
system's authantication is not the best thing (if you don't exactly
need that)
The $isLogged variable that is stored in the session is perfect as
long as you check that it is came f
I think I saw on this list that there's a $HTTP_RAW_POST_DATA (or
similar) varibale. Sorry the net is slow like hell at work, I can't
search for more info. But I think if you search for "raw" on the
general mailing list's archive you will find it.
Arpi
> XML file is text file. If I op
Hi,
Do you have msyql-dev (or similar) package installed?
Arpi
> I have tried the following, each time removing config.cache
> beforehand:
>
> --with-mysql=/usr
> --with-mysql=/usr/include
> --with-mysql=/usr/include/mysql
> --with-mysql=/usr/lib
>
> According to a friend with mysql Debs
> later on I get errors about the class functions being undefined.
> Can anyone please point me in the right direction on how to
> register my objects as session vars.
Class definition *must* be before any session_start() or
sessgion_register() if there are previously stored objects in the
se
On Monday 26 November 2001 23:37, Christopher William Wesley wrote:
> On Mon, 26 Nov 2001, Greg Sidelinger wrote:
> > Can someone tell me how to store a class in a session var. I
> > want to
>
> There are several things you need to do.
>
> 1) include the class definition before you do anything
>
> I have a small problem i come from a link in html page witch gives
> an numbet to php (contact.php?nummer=2)
> and in the script i use a redirec to a other php script but i can't
> give that number to then next script i do it like this:
> $url = sprintf("http://www.test.com/contact1.php?num=%",$
_exists($userfile)) {
copy("$userfile","pics/".$userfile);
} else {
echo "Nem sikerül a következõ file-t feltölteni:".$userfile;
}
thx
Tamas Bucsu
$a<=sizeof($HTTP_POST_VARS);$a++){
echo "$a. ".$HTTP_POST_VARS[$a]."";
}
Please help
Tamas Bucsu
Hi guys,
Is there anything I should configure or set up on the server to make the "mail" method
work? There is nothing about it in the manual (or I just haven't found it?).
Thanks
Tamas "Bucsesz" Bucsu
Hi guys,
Is there any restriction on a multiple selectás name in an HTML file? Cos' If I give a
name like 'msel' and not 'msel[]' I don't get an array named $msel just a simple
string type variable.
Thanks in advance
Hi guys,
Is there any special way to get some pics from the web? Cos' what I wrote just does
not work. Thanks
if (file_exists($kepnev)){
$kepnev="http://www.stg/pics/somethinggy.jpg";];
$fdr = fopen($kepnev,"r");
$fdw = fopen($kepnevshort,"w");
while (!feof($fdr)) {
fputs ($f
On Wednesday 19 September 2001 13:13, Jon Haworth wrote:
> A better version would be:
>
> if (getenv(HTTP_X_FORWARDED_FOR)) {
>
> $ip=getenv(HTTP_X_FORWARDED_FOR);
> } else {
> $ip=getenv(REMOTE_ADDR);
> }
>
> This checks for proxy forwarding as well, if you just use
> REMOTE_ADDR you
Hi,
I have the same problem. We have a fairly complex and huge system
with many functions/features in it with 1,6Mb of plain php code
(without desing). For page generation usually one half (or third
maybe) of the code is needed. I found that php parses and complies
the code in 0.6secs (withou
On Thursday 20 September 2001 21:36, Wee Chua wrote:
> Hi all,
> I know how to forward a page with PHP, but what if the page I want
> to forward is the previous page or last page. In javascript, the
> code is like javascript:historygo(-1). The reason why I want to go
> back to previous page is bec
On Friday 21 September 2001 15:15, Jean-Pierre Arneodo wrote:
> Hi!
> something looks strange for me.
> Why the method Fils::x is called?
> class Fils extends Pere {
> function Fils(){
> echo "Fils::Fils called";
> $this->Pere();
> }
> function x(){
>
On Friday 21 September 2001 16:27, you wrote:
> Does anyone know what is going wrong, when all of a sudden, the
> content of PHP global variables that are generated from a POSTED
> form, have a CR/LF prepended?
It happens to me when I'm using Konqueror and multipart/form-data
enctype in forms (be
On Friday 21 September 2001 17:17, Patrick Sibenaler wrote:
> I submit a form with multipart/form-data, where a field 'name'
> contains let's say 'john'. On submit, I do get the expected global
> $name -variable but the content has a CR/LF or /n character in
> front of the actual content, like:
Hi
On Monday 24 September 2001 17:56, Thomas Deliduka wrote:
Hi,
> PHPSESSID:
Try to use constant SID, maybe that will work, and it is more likely
that it will work on other intallations with other session variable
names.
>
> VAR 3: TYPE=SUBMIT VALUE="go">
>
You should add the session id (SI
On Monday 24 September 2001 18:20, Thomas Deliduka wrote:
> On 9/24/2001 12:22 PM this was written:
> > Try to use constant SID, maybe that will work, and it is more
> > likely that it will work on other intallations with other session
> > variable names.
>
> I just tried using SID in my index.php
On Monday 24 September 2001 18:51, Thomas Deliduka wrote:
> I'm finding my script on www.fromtheduke.com/session/ still doesn't
> work even with the in the link or passing it along in the
> form.
Please send us your latest code again, then we can help you, not just
guessing what you've might don
>
> Then I will reload the first page again by erasing index2.php and
> hitting enter and it will display a new sess id number and show the
> first page, as normal but that sessid number is equal t the new
> session created on the server and the value of it is:
>
> var3; var1; var2
>
> This is str
On Monday 24 September 2001 18:39, Thomas Deliduka wrote:
> On 9/24/2001 12:32 PM this was written:
> >> After reloading IE on the PC now the SID constant doesn't
> >> echo anything at
> >> all.
> >
> > SID is always defined on the first page request. It is only
> > defined on later page requests
On Monday 24 September 2001 21:23, Thomas Deliduka wrote:
> I just tried this here below. Before trying this I changed any
> called to $PHPSESSID to session_id().
>
> I turned off cookies
> Loaded the page... Created session id and file:
> sess_44074d3a54862b480c3407c9eb373f77
> Contents: var1|s:8
Hi,
I don't know if I understand right the manual at the
session.gc_maxlifetime setting.
As I read, php won't use sessions that are older than that time.
It means that when a user logs in, and does his/her work for more
than (for example) 15 minutes, than he/she will be kicked off
immediately,
On Tuesday 25 September 2001 14:27, Andrey Hristov wrote:
> New SESSID will be generated because the old expired and because
> all rely on the SESSID which is the "hash key" to the data no
> previous data will be available.
So, no matter if the user is still working, the session will be
destroyed
On Tuesday 25 September 2001 16:19, Johnson, Kirk wrote:
> > So, no matter if the user is still working, the session will be
> > destroyed. I mean session.gc_maxlifetime isn't
> > session.gc_maxIDLEtime?
>
> Every time the user requests a page in an application using
> sessions, the session file's
Hi,
HTTP has a method called HEAD, that is for example can be used for
exmample to get the requested files' size if the other web
server/php script supplies it.
So all you have to do is to make a connection to the other web
server, give a HEAD request (it is almost the same as GET), and
parse the
Hi,
Both problems can be solved with php directives in httpd.conf or in
.htaccess.
You can just put php_value safe_mode "off" or php_value engine "off"
into definitions in httpd.conf to restrict only for some
directories or into for virtual servers.
(Of course in htaccsess you can only restr
> Try addslashes() before executing the query and stripslashes() when
> retrieving data from the db. See the online manual for more
> details.
I think stripslashes() isn't needed when retrieving data from the db,
it is needed only in the query string to protect special chars from
interpretting
=> 2 ) );
Output 2:
122334455
Why is this? Is this normal behaviour?
Thanks,
Tamas
n't be set, so either use output
buffer in php.ini, or ob_start somewhere. And hope you do session_start() in
config.php ;)
Cheers,
Tamas
-Original Message-
From: alekto [mailto:alekto.antarct...@gmail.com]
Sent: Sunday, July 24, 2011 1:28 AM
To: php-general@lists.php.net
Sub
---
On more complex sites, you may want to use classes, so the PHP code gets
really separated and clean.
If you decide to a template engine, you may also want to create a global
$conf var and export that to the engine, so you can set the design, lang
code, etc from one variable.
Let me know, if I c
usr_level); after setting
$usr_level ).
The fix: just change it to:
$usr_level = $dn['usr_level'];
Cheers,
Tamas
From: alekto [mailto:alekto.antarct...@gmail.com]
Sent: Sunday, July 24, 2011 1:00 PM
To: Dajka Tamas
Cc: php-general@l
both, giving easier
debugging,
Tamas
From: alekto [mailto:alekto.antarct...@gmail.com]
Sent: Sunday, July 24, 2011 1:00 PM
To: Dajka Tamas
Cc: php-general@lists.php.net
Subject: Re: [PHP] Members area Login with permissions!
Hi,
thank you for answering! I do have a session_s
s will redirect an unlogged user to the login form ( if logged in, but
has no access rights, your login page will log out the user ).
Don't forget to store the users' access level in the session, or this will
not work!
Cheers,
Tamas
From: alekto [mailto:alekto.antarct
Yes, can be. There is a predefined variable DIRECTORY_SEPARATOR, which you
can use:
on index.php let's say
define('DS',DIRECTORY_SEPARATOR');
define('MY_APP_ROOT',dirname(realpath(__FILE__)));
define('LIB_DIR',MY_APP_ROOT.DS."..".DS."locat
Try lowercase 'http'. Anything in error log? Try turning on display_errors.
Cheers,
Tamas
-Original Message-
From: Jason Pruim [mailto:li...@pruimphotography.com]
Sent: Sunday, July 31, 2011 8:40 PM
To:
Subject: [PHP] Problem with header("Location:" )...
First: use firebug, or something like that, and check what's get "written"
in the page's source!
Second: dump $_POST/$_GET, and check, whether "id" is set at all
Is your input field between the and tags?
Cheers,
Tamas
-Original Mess
Why not trying this:
$q = "SELECT * FROM news_items WHERE upper('headline') LIKE '%".$find."%'";
echo $q;
$data = mysql_query($q);
...
And try running the echoed query in phpmyadmin, etc.
Cheers,
Tamas
-Original Message-
From: Davi
If $data['feed_link'] is extracted from $_POST, then it's already
urldecoded.
BTW, what's the problem? It's not redirecting you, or just redirecting you
to az unavailable/wrong page? ( most browsers change the & in titlebar
to '&', so you don't have to worry about that )
-Original Message---
Try header("Location: ".html_entity_decode($data['feed_link']));
From: muad shibani [mailto:muad.shib...@gmail.com]
Sent: Saturday, September 24, 2011 12:41 PM
To: Dajka Tamas
Cc: php-general@lists.php.net
Subject: Re: [PHP] PHP redirect
it redirecting me to unavail
not
the right treatment. Do you have any idea?
Thanks for your help in advance,
Tamas
--
Tamas Hegedus, Research Fellow | phone: (1) 480-301-6041
Mayo Clinic Scottsdale | fax: (1) 480-301-7017
13000 E. Shea Blvd | mailto:[EMAIL PROTECTED]
Scottsdale, AZ, 85259 |
. HOST . USER . DB;
exit;
/*-- Ez az eredeti
define( HOST, 'localhost');
define( USER, 'h');
define( PWD, 'h');
define( DB, 'hae');
*/
$link = mysql_connect( HOST, USER, PWD);
mysql_select_db( DB);
...
Thanks,
Tamas
--
Tamas Hegedus, Research Fellow | phone:
Dear Jason,
Thanks!
Such a stupid misstake (however in the earlier version of php I did not
received any notice). But I am not a programmer ;-)
Regards,
Tamas
>> On Saturday 22 January 2005 08:28, Tamas Hegedus wrote:
>>
>
>>>> define( HOST, 'localhost')
85 matches
Mail list logo