473,395 Members | 1,516 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

set_time_limit not working

how to set time to live for a script in php?

i have tried with set_time_limit();
my code was

<?php
set_time_limit(20);
?>

this is not working for me... can anybody please help me out in this...
Mar 21 '07 #1
6 5934
vssp
268 100+
how to set time to live for a script in php?

i have tried with set_time_limit();
my code was

<?php
set_time_limit(20);
?>

this is not working for me... can anybody please help me out in this...


WHILE($list = mysql_fetch_assoc($result) {
set_time_limit(2); // Timelimit 2 seconds for sending each mail
mail($list[email], $list[Subject], $list[Message]);
}
set_time_limit(5); // Timelimit to finish script
Mar 21 '07 #2
Suppose after specified seconds, my script has to expire and reload again, what should i do?
Mar 22 '07 #3
mgast
9
What exactly are you trying to do? Could you post some code?
Mar 23 '07 #4
ronverdonk
4,258 Expert 4TB
You are double posting in this forum, see also http://www.thescripts.com/forum/thread618578.html which will be removed. - moderator

And when you post code, show it within code or php tags, as detailed in the Posting Guidelines at the top of this forum!

Ronald :cool:
Mar 23 '07 #5
And when you post code, show it within code or php tags, as detailed in the Posting Guidelines at the top of this forum!

Ronald :cool:
this is my php code for registering a user with a password.

<?php

//replace username and password with your mysql name and password
$conn = mysql_connect("localhost","root","mobileproject") or die("Connection Error");

//select the database
$db = mysql_select_db("test")or die("Connection Error");
session_start();
$_SESSION['username'] = $_POST['username'];
echo $_SESSION['username'];
$password = md5($_POST['password']);
$email = $_POST["email"];

//insert the values
$result= MYSQL_QUERY("INSERT INTO users (username, password)".
"VALUES ('{$_SESSION['username']}', '$password')");

$temp_table=mysql_query("create table {$_SESSION['username']}(name varchar(30) not null,source varchar(30),destn varchar(30),flight varchar(10),seat int);")or die("creation error");
$temp_value=mysql_query("insert into {$_SESSION['username']}(name,source,destn,flight,seat)values('{$_SESSION['username']}','0','0','0','0')")or die("Insertion Error");
echo "Your name and password have been submitted into our database :)";
echo "<br/>";
echo "<a href=login.php>Back to Login</a>"
?>

now my objective is to set the time to live for the script. suppose if i am going to set 10 minutes for the script, the script should expire after 10 minutes and have to reload again? what will be solution to this?
Mar 23 '07 #6
ronverdonk
4,258 Expert 4TB
Why don't you just do as was requested in the previous post?? Enclose your code within code or php tags. Or else read the Posting Guidelines before you show anything here.

moderator
Mar 23 '07 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: -----> sylvain | last post by:
hello, here comes a script which behaves differently with php 4.2.0 + mysql 3.23.49 and php 4.3.3 (or 4.2.3) + mysql 4.0.15. the oldest version gives the "good" result (with a tiny problem :...
5
by: Martin Heuckeroth | last post by:
Hi We are working on a webservice application and are having some problems with the cookies and/or sessions. We have them working on our intranet but then its not working on the internet. We...
5
by: tshad | last post by:
I have been working with setting my drop boxes to allow double clicking to select an item. It worked fine until I made some changes. I then stripped the page down to the bare essentials to find...
8
by: jojobar | last post by:
Okay, I am trying to do is to test the webresource in 2.0 1. I created a new project with assembly name (and default assembly name) "Office". 2. I added the following to the AssemblyInfo.cs...
2
by: Don | last post by:
I'm having problems with intellisense, autocomplete, etc. suddenly not working in certain classes of a project I'm working on. All the options are set, and it all works fine for most classes, but...
9
by: MSDNAndi | last post by:
Hi, I have a set of simple webservices calls that worked fine using .NET Framework 1.0. I am calling a Java/Apache based webservices, the calling side is not able to supply a proper WSDL. ...
0
by: adamalton | last post by:
I'm trying to investigate the way PHP behaves in relation to timeouts and included scripts. PHP seems to do very strange things when scripts that include other scripts timeout, or when the included...
1
by: FFMG | last post by:
Hi, In safe mode, (http://www.php.net/manual/en/features.safe-mode.php#ini.safe-mode), set_time_limit(...) cannot be used. http://www.php.net/set_time_limit Is there a simple way around...
3
by: pedalpete | last post by:
I've got some strange behavior happening on my server. I have a php page which runs a few processes to keep my db up to date and optomized. The process can take about 40 minutes to run. ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.