![](https://forums.phpfreaks.com/uploads/set_resources_1/84c1e40ea0e759e3f1505eb1788ddf3c_pattern.png)
nadeemshafi9
-
Posts
1,245 -
Joined
-
Last visited
Posts posted by nadeemshafi9
-
-
window.onload will trigger once the page is fully loaded, so not refresh
it's identical to the <body onload=''> tag
but your code shows that the function will only happen on window . onload
my func
<script>
function handleClick(id){
element= document.getElementById(id);
if(!element) element= document.getElementsById(id);
if(element) {
if(element.name) alert('You clicked ' + element.name);
else if(element.id) alert('You clicked somthign that dosent have a name but id of ' + element.id);
//etc etc etc
}
else alert('could not find the element clicked');
}
<script>
<input type='button' id='button1' value='button1' onclick='handleClick('button1')' />
<input type='button' id='button2' value='button2' onclick='handleClick('button2')' />
<input type='button' id='button3' value='button3' onclick='handleClick('button3')' />
i think parts of your code are good where you reference the buttons as an array of all the buttons, its neat, but my code is more responisve, maybe they can be combined. My code can be used to handle a click of any HTML element, and it will respond straight away at any time without refresh or anything, in the function you can capture what was clicked and what to do with it.
-
Best thing would be to serialize the array.
i beat you to it, but you would have told me before if it wernt for the fact that all my posts are being stalled to be read by admins.
-
i have done it, i used serialize and unserialize
-
hello guys
my ini_parse function returns an array on one server where i output it using print_r (you know what teh format is)
now i need to read it into a variable on my other server where i fopen this page and read the pages contents in order to get it on my other server.
so basicaly i need to eval the result of a print_r.
or should i be using var_dump i dont know ? or should i be exploding
basicaly i need to evaluate the output from a page into an aray
$handle = fopen("http://*/*/api.php", "rb"); $contents = stream_get_contents($handle); fclose($handle); echo $contents; // this is a print_r or a var_dump i dont know but i need to eval it now exit;
thanks guys
-
you should create CSV files they are easy to create and open in excell
-
header("Content-Type: application/vnd.ms-excel"); header("Expires: 0"); header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
-
not bad, now translate it into mod rewrite MVC and window based gui's then it will be up to date, is it your FMP ?
huh?
haha. What's an FMP? and what's a window based gui?
thanks.
FMP final majour universit project, and window oo json xml based gui http://extjs.com/deploy/dev/examples/desktop/desktop.html
-
>> nadeemshafi9
It isn't really good practise simply to use @ to hide errors. Better (wherever possible) to prevent the error occurring in the first place by validating inputs (in this case).
most definatly, but i just discovered teh @ thingy and its quite handy
-
How do I put the XML document on my server. I don't have access to the other server?
you take the result of the request you sent the post or woteva ? send it using a httprequest php function and get teh result and write it to a file on your server, you can create files in your web site directory easily using fopen
-
Why bother?you can just do a function wich checks the time and if teh time is ove rteh limit then just die and echo data
PHP will cease executing at it's predefined timeout anyway. Why not let PHP terminate as normal, but trap the timeout error and replace it with your own output.
will that be using teh ini set function becaus eyou dont whant to set it for the whole server ??
-
you could start a process wich chekcs the time and start another process wich does your script, in the process that does your script you can break out of that process and jump into the timmer process which checks the time if the time is ok that process breaks out and jumps back into your script process wich continues from where it jumped out then furtehr down the script yoiu can jump back out into the timer process and check the time again and if the time is too much you can return or pipe throgh a flag from the timer process so that when it jumps back into the script process it has a flag which tells the script process to die.
http://uk3.php.net/manual/en/function.pcntl-fork.php
jajaja im dum
you can just do a function wich checks the time and if teh time is ove rteh limit then just die and echo data
-
Is it a chance there could be a duplicate md5(rand, 10000)) ??
yes so when you havee made the script work, then furtehr develop it to compensate by ckecking if it already exists and makign another one if it does
-
<?php
// set up basic connection
$conn_id = ftp_connect('ftp.example.com');
// login with username and password
$login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass);
// get contents of the current directory
$contents = ftp_nlist($conn_id, "."); // replace dot with your dir
// output $contents
print_r($contents);
?>
-
you could start a process wich chekcs the time and start another process wich does your script, in the process that does your script you can break out of that process and jump into the timmer process which checks the time if the time is ok that process breaks out and jumps back into your script process wich continues from where it jumped out then furtehr down the script yoiu can jump back out into the timer process and check the time again and if the time is too much you can return or pipe throgh a flag from the timer process so that when it jumps back into the script process it has a flag which tells the script process to die.
-
let us take a look at the form, see what types of field need to be checked do you mean chekcboxes checked or field validated ? lets see the form so we can write uyou a snipet.
-
OR
if ((@is_numeric(@$_REQUEST["o"]))&& (@$_REQUEST["o"]!= 0)) { @$_SESSION["o"] = @$_REQUEST["o"]; $o = @$_REQUEST["o"]; } elseif (@$_SESSION["o"]) { $o = @$_SESSION["o"]; } elseif ($default_module) { $o = $default_module; } else { $o = mysql_result(mysql_query("SELECT module_id from ".$table_prefix."modules where active = 1 order by sequence limit 1"),0,0); }
-
dosent window.onload require for the page to be postbacked ? eg refreshed with a submit button ?
-
pick up the framework developyour sites and use zend server to update things
-
<?php // Connect to FTP server $conn = ftp_connect('ftp.example.com'); if (!$conn) die('Unable to connect to ftp.example.com'); // Login as "user" with password "pass" if (!ftp_login($conn, 'user', 'pass')) die('Error logging into ftp.example.com'); // Issue: "SITE CHMOD 0600 /home/user/privatefile" command to ftp server if (ftp_site($conn, 'CHMOD 0600 /home/user/privatefile')) { echo "Command executed successfully.\n"; } else { die('Command failed.'); } ?>
http://uk3.php.net/manual/en/function.ftp-fput.php use this to up files
-
custom question in the url must be custom_question for it to be registered in $_GET
-
Theoretically you could take any part of MVC and put something else in its place without changing other parts.
It's easiest to imagine when we consider View. You could have one View that generates fancy, colourful, CSS styled HTML Web pages for traditional browsers, and another that generates plain Web pages for mobile devices with low bandwidth. Both would be using same Models and same Controllers. You don't have to introduce any changes into Models or Controllers if you want to switch the view. You can also easily add another view for generating RSS, then another for.. .something else...
On the Model side one could easily imagine the need to switch from MySQL to Oracle to PostgreSQL... With MVC pattern switching a database engine should not require any changes to Controllers or Views.
i like the browser small device example
it woudl pan out like this
when you use these its apparent how much better it is, you can move functiuonality about easily everything is encapsulated and ajax becomes much more simple using this format of url pluss its google friendly
extjs
Ext.Ajax.request({
url: '/person/getname/id/1',
success: someFn,
failure: otherFn,
headers: {
'my-header': 'foo'
},
params: { foo: 'bar' }
});
Ext.Ajax.request({
url: '/person/getaddress/id/1',
success: someFn,
failure: otherFn,
headers: {
'my-header': 'foo'
},
params: { foo: 'bar' }
});
i use the zend_framework it comes fully strapped with functionaly directory structure classes and a bootstrap file mod rewrite app.ini to controle configuration complete rewrite of all php constructs
http://framework.zend.com/manual/en/
-
jquery has functionality for rounded edges let me find it
-
<script>
function handleClick(id){
element= document.getElementById(id);
if(!element) element= document.getElementsById(id);
if(element) {
if(element.name) alert('You clicked ' + element.name);
else if(element.id) alert('You clicked somthign that dosent have a name but id of ' + element.id);
//etc etc etc
}
else alert('could not find the element clicked');
}
<script>
<input type='button' id='button1' value='button1' onclick='handleClick('button1')' />
<input type='button' id='button2' value='button2' onclick='handleClick('button2')' />
<input type='button' id='button3' value='button3' onclick='handleClick('button3')' />
-
Both ajax and on page request (basically the same thing) would require at least one player at all times.
Even worse on page request you'd need to have one person visiting a page every minute.
So yeah, cronjob
i was thinking you could have an admin page that you just leave running on some admins computer with repeated ajax calls to the required script, or he coudl write a demon, cronjob is all good thogh
Which Button was Clicked?
in Javascript Help
Posted
ooooooooooooooooooooooooooooh sorry iwas being ignorant and dint read your code thorghly enogh, nice jerb.