|
Well I am not sure but according to OS fundamentals these things should be possible,
1) Rename and delete of directory not allowed
2) Rename and delete (and editing) is not allowed for the file getting processed in current loop instance
3) One should be able to rename or delete or editing a file which is not getting processed in current loop instance
4) One should be able to add new file in that directory.
These all are theoretically, one can omit or change these rules for his OS. And sorry I haven't tried the situation you gave. But I think it should be possible. And it might led to infinite loop.
|
|
|
|
|
chevu,
Thank you for your response. To be clearer I should state the process files was really just reading file names...I'm not sure that it matters.
The script is still behaving normally, so I can only think that it was a fluke or maybe a sign of system instability (power suppply maybe).
All the best!
cjoki
|
|
|
|
|
cjoki,
As per the mutual exclusion fundamental no mater what you are doing (read/write) with data (in this case reading file name) you cannot change that name.
Ya but you might have seen in windows or unix or linux that in if you have opened one folder at two differ location and you add one file/folder at one place changes get reflected to another place. I am not so sure about windows directroy structure in detail. But for unix I know that once you add new file in directory its inode will be added to director file structure list and those changes can be read using directory structure. I dont know whether I am able to clarify your doubt or not. It will be better if you find out such script is working on your system and if it is not working then try to run such script and check. In both case please let me know the result I would like to know whether it is possible or not.
Thanks.
|
|
|
|
|
hello guys, i have a problem with a query.
I have a table actions which has no primary key. any one particular record can be identified by the combination of actionID, taskID and ProjectID which are the other fields in actions table.
Here is an example of the possible situations of entries in the actions table(so that you get an idea of what i am talking about)
ActionID 1 for taskID 1 of ProjectID 10-000
ActionID 2 for taskID 1 of ProjectID 10-000
ActionID 1 for taskID 2 of ProjectID 10-000
ActionID 1 for taskID 2 of ProjectID 10-001
ActionID 2 for taskID 2 of ProjectID 10-001
ActionID 3 for taskID 1 of ProjectID 10-000
ActionID 1 for taskID 1 of ProjectID 10-002
ActionID 1 for taskID 2 of ProjectID 10-003
When i am creating a new action for taskID 1 of ProjectID 10-000, then what i am doing is i am scanning the all the ActionIDs of the taskID 1 of ProjectID 10-000, ordered by ActionID and incrementing the last obtained ActionID by 1 to generate a new ActionID for the new action.
Now suppose the entries of ActionID for taskID 1 of ProjectID 10-000 in the database are 1,2,5,6,8,10,15,16, then according to my logic, the newly generated ActionID would be 17, but that is not what i want. I want the newly generated ActionID to be 3, because 3 is not present in the ActionID field of taskID 1 of ProjectID 10-000 combination .
In the above example, if i delete ActionID 2 for taskID 1 of ProjectID 10-000 and then when a new action is added to the same combination of taskID and ProjectID, i want the newly generated ActionID to be 2 and not 4 which is what i am getting from my logic.
Can anyone help me with this???
|
|
|
|
|
i got it ..
iam not pro. with php .. but as i see it , it could solve by comparing the exist value with acounter
like
$i =0;
while ($id = mysql_fetch_object($result)) {
$i +=1;
if ( $id->id != $i) {
echo "ID num $i is missing";
break;
}
}
|
|
|
|
|
Hi all,
I have done a project in php.Now i want to make an setup file (i.e., an exe) of the project so that i can install any where.
Is it possible in php.If yes then how can i do it.
Thanks in advance.
|
|
|
|
|
use it's possible
http://www.bambalam.se/bamcompile/
use that compiler
|
|
|
|
|
Hi all,
I need a help regarding exporting a html file to pdf file in PHP.How can i do this ?
Thanks in advance.
|
|
|
|
|
You could look into using OpenOffice.org headless.
There are also some PHP libraries for writing PDF - http://www.fpdf.org/[^] is one that doesn't need any extensions installed.
|
|
|
|
|
Hi Friends,
I used PEAR library to facilitate the export to am excel sheet, but what i got in my Excel sheet are below unrecognized characters (also include some codes), it supposed to be a table of data for several columns (ex. OS, Port Number, Comment, etc.). does anyone have the same issue before? What might be the cause of it? Many thanks...
----------------
ÐÏࡱá;þÿ
þÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ
OSPort NumberNetmaskComment086.231.026.000
VCPC2S14@Ÿ@
<html>
arElements[0]=new Array(9);
.....modified on Thursday, March 11, 2010 5:54 PM
|
|
|
|
|
Hello everyone, I am a newbie to php. I have been learning it and it is going well.
I have a php webpage, where there are textforms, dropdown list and stuff. There is Activity field in the database. Whatever activities that i do on the webpage, like modifying the text in the textbox, or changing a value for a dropdown list, these need to be automatically entered into the activity text in the database. Like this it happens only for one page.
Like for example, if i change a project name field and change status to 'Important' from 'Normal', then it needs to make an entry into the Activity field like:
On date:yyyy/mm/dd Project name has been changed to 'New Project' and status has been changed to 'Important'.
I think this can be achieved with stored procedures or i might be wrong.
I would really appreciate if someone could write down a sample code for me regarding this.
|
|
|
|
|
you can make a form from HTML for Edit name and state ..
anyway put a hidden value for time .. and use that time to query the database and inject the new value
|
|
|
|
|
I want it to be doing automatically, like there are many other textboxes and dropdown lists in the page and i do not which one the user will be modifying so i cannot right one query for all of them. That is why i thought a stored procedure will be useful.
|
|
|
|
|
hmmm ..
in this case u need [AJAX] just a little code scripted with javascript
|
|
|
|
|
could you help me with some sample code for a webpage with a textbox and a dropdown list???
It would be very helpful.
|
|
|
|
|
ok
look at this code
<script src="yourpage.js"></script>
<form>
<select name="c" onchange="showchange(this.value)">
<option value = "c1"> C1
<option value = "c2"> C2
<option value = "c3"> C3
<option value = "c4"> C4
</select>
</form>
an at yourpage.js
type
var xmlHttp
function showchange(str) {
xmlHttp = GetXmlHttpObject();
if (xmlHttp==null)
{
alert("your browser deosn't support AJAX");
return;
}
var url = "url" <- your link
url=url+"?q="+str;
url=url+"&sid="+Math.random();
xmlHttp.onreadystatechange=statechanged;
xmlHttp.OPEN("GET",url,true);
xmlHttp.send(null);
}
function statechanged()
{
if (xmlHttp.readystate==4"number of chooses")
{
document.getElementById("txtHint").innerHTML=xmlHttp.responsetext;
}
}
function GetXmlHttpObject()
{
var xmlHttp=null;
try
{
xmlHttp = new XMLHttprequest();
}
catch(e) {
try
{
xmlHttp = new ActiveXObject("Msxm12.XMLHTTP");
}
catch (e)
{
xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
}
}
return xmlHttp;
}
|
|
|
|
|
Thank you for the code and the effort.
I have tried it but it does not seem to be doing anything.
Moreover i need a procedure where it will enter the changes into the databases and also re-directing me to a new page when a submit button is clicked.
|
|
|
|
|
hi, i am trying to include functions from a php review script in my original web layout, to do this i changed my pages from .htlm to .php and i'am using the include_once function to call the script.
for some reason when i include the script all code execution halts after it has been callled and focus does not return to the anti-insect.php page so the footer for my site is not shown. im not sure if i need to change a return value for the script or not.
this is also preventing me from using multiple include_once to import two or more functions and display them in different area's on my website.
this is very frustrating if any one could help me out i would be really happy, i have also included a link to the site that i am testing using the xampp server.
http://92.8.199.227/Anti-Insect.php
thankyou
chris
|
|
|
|
|
Hi,
First of all, link given by you is not working.. Another thing is include_once can be used once check this php manual page.
http://php.net/manual/en/function.include-once.php[^]
Either explain your problem in detail or give sample code you are trying... So we can help you properly...
|
|
|
|
|
i think i got ur problem
that's because the HTML code at ur included script
|
|
|
|
|
Hello, my problem is the following: i have a query with 3 results from a database where i store a school timetable datas such as professors, courses etc...I try to put this results in a html tabel dynamic via php.So, for exemple i have courses from 8 to 10, 10 - 12 and 17 - 19.I have "if" conditions in while loop that allow me to verify if i have a course at x hour.If i dont have course at x hour i want to fill the table with empty cell " ".But the real problem is that when i try to do this while loop is displaying the tested conditions plus empty rows cuz of else condition , ofc it is doing like this cuz if the query has x results he will construct x times those empty rows...i dont know if somebody is understanding me and what i need to do.I will attach a piece of code here:
while($linie = mysql_fetch_assoc($rez))
{
if($linie['ziua'] == "Luni")
{
$orastart = $linie['orastart'];
$orafinal = $linie['orafinal'];
$nume_curs = $linie['nume_curs'];
$prof_name = $linie['prof_name'];
$nume_grupa = $linie['nume_grupa'];
if($orastart == "8" && $orafinal <= "10")
{
echo "<tr><td>8 - 9</td><td rowspan = '2'>".$nume_curs."<br />".$prof_name."<br />".$nume_grupa."</td></tr>";
echo "<tr><td>9 - 10</td></tr>";
}
else echo "<tr><td>8 - 9</td><td> </td></tr>
<tr><td>9 - 10</td><td> </td></tr>";
if($orastart >= "10" && $orasfarsit <= "12" )
echo "<tr><td>10 - 11</td><td rowspan = '2'>".$nume_curs."<br />".$prof_name."<br />".$nume_grupa."</td></tr>
<tr><td>11 - 12</td><td> </td></tr>";
else echo "<tr><td>10 - 11</td><td> </td></tr>
<tr><td>11 - 12</td><td> </td></tr>";
}
}
echo "</table>";
|
|
|
|
|
The trick is to get the cells of the table in the right order. There are many ways to do so.
1.
use a two-dimensional array; fetch the database results (order does not matter); loop over them filling the array; when filled, start creating the table from the array.
2.
use a one-dimensional array representing one day; for each day, fetch the database results for that day only; fill the array; now generate HTML for one row.
3.
fetch all the database results in chronological order (use an ORDER BY clause). Now start reading the results and create your array; start a new row when day does not equal previous day; insert one or more empty cells when time chunks aren't consecutive; etc.
|
|
|
|
|
ty for u'r fast answer i rly aprishiate.I will come back with news :P
|
|
|
|
|
i tryed u'r first method but i am a little bit confused in creating the array.Here is what i tryed:
$rezultate = array();
while($linie = mysql_fetch_assoc($rez))
{
$rezultate[] = $linie;
}//while
if($rezultate[0]['orastart'] == "8" && $rezultate[0]['orastart'] <= "10")
{
echo "<tr><td>8 - 9</td><td rowspan = '2'>".$nume_curs."<br />".$prof_name."<br />".$nume_grupa."</td></tr>";
echo "<tr><td>9 - 10</td></tr>";
}
else echo "<tr><td>8 - 9</td><td> </td></tr>
<tr><td>10 - 11</td><td> </td></tr>";
u can see how i acces the elements from array but i want to acces different, something like this:
if($rezultate[$i]['orastart'] == "8" && $rezultate[$i]['orastart'] <= "10")
|
|
|
|
|
pelikan2002 wrote: $rezultate[] = $linie;
that is completely wrong.
in that scheme you need a 2D array, which you give dimensions according to number of days and number of time periods in a day; then iterate over all database results and fill the corresponding cell of the array.
|
|
|
|