Jump to content

wwfc_barmy_army

Members
  • Posts

    320
  • Joined

  • Last visited

    Never

Everything posted by wwfc_barmy_army

  1. Hello. I have a php file which i can run via the broswer no problem and i recieve the email correctly and via the correct settings. So i set it up as a scheduled task in windows but i get this error: Any idea why i'm getting this? Is it looking at a different php.ini? I'm running: Windows Vista WAMP Web Server
  2. Whereever i seem to put it, it doesn't seem to work. It just wont show anything till the ajax result comes back. Can't see where i'm going wrong :S any ideas?
  3. Hello, I have this code which i found on the internet and modified to my needs: var xmlHttp function showResult(str) { if (str.length==0) { document.getElementById("livesearch"). innerHTML=""; document.getElementById("livesearch"). style.border="0px"; return } xmlHttp=GetXmlHttpObject() if (xmlHttp==null) { alert ("Browser does not support HTTP Request") return } var url="blockfind.php" 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 || xmlHttp.readyState=="complete") { document.getElementById("livesearch"). innerHTML=xmlHttp.responseText; document.getElementById("livesearch"). style.border="1px solid #A5ACB2"; } } } function GetXmlHttpObject() { var xmlHttp=null; try { // Firefox, Opera 8.0+, Safari xmlHttp=new XMLHttpRequest(); } catch (e) { // Internet Explorer try { xmlHttp=new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { xmlHttp=new ActiveXObject("Microsoft.XMLHTTP"); } } return xmlHttp; } Works fine. But i'm trying to add a loading image. I've tried adding; if (xmlHttp.readyState == 1) { document.getElementById('livesearch').innerHTML = "<p align='center'><img src='ajax-loader.gif'><br /> Please Wait. This process may take a minute.</p>"; } Into the function stateChanged() but it doesn't do anything. any ideas, suggestions or code? Thanks.
  4. In my post look at the 'quote'. On the third line the date should be 06/11/2008 not 11/06/2008. Which is something to do with this line of code: <br> let formate the date now it in a timestamp ".date("d/m/y",strtotime($date))." "; The format set in the code says d/m/y but it's showing m/d/y. Any ideas? Thanks.
  5. Sorry about the late reply. I'm just testing with this code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> </head> <body> <?php $date=date("06/11/2008"); echo "This is the date, $date <br> But heres the timestamp of date ".strtotime($date)." <br> let formate the date now it in a timestamp ".date("d/m/y",strtotime($date))." "; $time = time(); $formated=date("d/m/y", $time); echo "<br/>Today date in a timestamp formate is >$time< <br> but the date formated is >$formated<"; ?> </body> </html> The second bit is correct as it has the date the wrong way round than I would like it on the 3rd line of the quote. Any ideas why? Thanks again for your help and advice.
  6. How do i store them as a date. I know i would need to change the field type, but when inserting a value with PHP do i need to do anything special or just make sure what is being input goes in the format YYYY-MM-DD? thanks for your help.
  7. Hello. I have a field in my database which the date is stored as (for example) 25/12/2008 . When this date arrives i want to send an email. The date is stored as a string. I assume i will have to create a cron job to check for the dates, so it will be something like for each recorded find finishdate parse the date to understandable format? if $finishdate = todays date send email code I'm not sure how to parse and check if it's today. Any code or advice? thanks.
  8. Also, i've noticed that it closed cmd very quickly after the command was run, perhaps not being it enough time to run. Any suggests? Thanks.
  9. In addition i have looked at a process monitor and found these results: It appears to show that it's run it, but it hasn't. Any ideas? Thanks.
  10. Hello. Sorry about the late reply. Yes, i tried the exec command yesterday but it doesn't appear to do anything, the php script just continues to try and load and the command line doesn't appear to run either. Any ideas? Thanks.,
  11. Hello. I'm trying to use PHP to run a scipt on the webserver, i've tried using this: <?php $runCommand = 'C:\psshutdown.exe \\B17-01 -u administrator -p xp2005 -t 60 -f -k -m "This PC Will Blow Up In 60 Seconds! Run You Fool!?"'; //Wrong by purpuse to get some good output $WshShell = new COM("WScript.Shell"); $output = $WshShell->Exec($runCommand)->StdOut->ReadAll; echo "<p>$output</p>"; ?> But it just keeps thinking about it and never runs it. Works if i do the command manually. Any suggestions? Thanks.
  12. Hello. I have a field in a database with the date in it such as '31-10-2008', now i want to run a cron job (which i can setup) that sends an email when that date arrives. So if that date is today, then send email. How can i do that? Anyone got any php code for that? thanks.
  13. Spot on. After a lot of messing about i've got it working Thanks again.
  14. Hello. How can i disable an account using PHP and LDAP? I can bind to the server fine. web server - Windows xp with XAMPP server - windows server 2008 Thanks in advance.
  15. Thanks, from this i found out it was all lowercase. Thanks again!
  16. I'm using php to display users from the LDAP and i'm trying to output their usernames, so i am using this piece of code: for ($i=0; $i < $entries["count"]; $i++) { echo $entries[$i]["sAMAccountName"][0]."<br />"; } Although this produces the following error for each user: Notice: Undefined index: sAMAccountName in C:\xampp\htdocs\test4.php on line 45 Using 'displayname' works: for ($i=0; $i < $entries["count"]; $i++) { echo $entries[$i]["displayname"][0]."<br />"; } Anyone know what is causing this and how i could solve it? Thanks.
  17. Hello. Is it possible to use PHP to run a command in the command line on the web server? Thanks.
  18. Ah. Thanks anyway. Anyone else got any ideas? Thanks.
  19. Webserver for now will be running on xp with appserv till the new one comes in. The main server is server 2007 and all machines are XP. We have a global administrator username and password for all machines so presumably we can just use that? Thanks for any advice.
  20. Hello. Basically i work in a organisation and there are many rooms of computers all on the same network. So basically i want to know if the following is possible. What we would like is a web front end to be able to shut them down, either all of them or room by room. So, is it possible to run a command on the webserver (also on the network) to tell a certain computer or groups of computers (mac addresses can be found, along with computer names and IP addresses) to shutdown, or would i have to try and pass a variable to some software to do it? Any advice or code is welcomed? Thanks.
  21. Ah, i thought so. Thanks for the advice. Using Now. Thanks.
  22. Hello. I have this code, i have modified a script already available: <?php ob_start(); include("config.php"); if(isset($_GET['id'])) { $gid = mysql_real_escape_string($_GET['id']); $qs = mysql_query("SELECT url FROM $table WHERE tag = '$gid';") or die('MySQL error: '.mysql_error()); if (mysql_num_rows($qs) == 0) { $qs = mysql_query("SELECT url FROM $table WHERE `id` = $gid;") or die('MySQL error: '.mysql_error()); mysql_query("UPDATE url SET count=(count + 1) WHERE `id` = $gid;") or die('MySQL error: '.mysql_error()); } else mysql_query("UPDATE url SET count=(count + 1) WHERE `tag` = '$gid';") or die('MySQL error: '.mysql_error()); while($data = mysql_fetch_array($qs)) { if ($frame == 1) { include("frame.php"); echo "<iframe name=\"pagetext\" height=\"100%\" frameborder=\"no\" width=\"100%\" src=\"$data[0]\"></iframe>"; } else if ($frame == 0) { echo $data[0]; ?> <SCRIPT LANGUAGE="JavaScript"> <!-- Original: Corey (638@gohip.com ) --> <!-- Web Site: http://six38.tripod.com --> <!-- This script and many more are available free online at --> <!-- The JavaScript Source!! http://javascript.internet.com --> <!-- Begin var start=new Date(); start=Date.parse(start)/1000; var counts=10; function CountDown(){ var now=new Date(); now=Date.parse(now)/1000; var x=parseInt(counts-(now-start),10); if(document.form1){document.form1.clock.value = x;} if(x>0){ timerID=setTimeout("CountDown()", 100) }else{ <?php header("Location: $data[0]"); ?> } } // End --> </script> <SCRIPT LANGUAGE="JavaScript"> <!-- window.setTimeout('CountDown()',100); --> </script> <SCRIPT LANGUAGE="JavaScript"> <!-- This script and many more are available free online at --> <!-- The JavaScript Source!! http://javascript.internet.com --> <!-- Begin // Cache-busting LUBID bug. var ran = Math.round(Math.random() * 899999) + 100000; var lubid_string = "<img src=\"http://lubid.lycos.com/one.asp?site=members.tripod.lycos.com&ord=" + ran + "\" height=\"1\" width=\"1\">"; document.write(lubid_string); // // End --> </script> </center> <FORM NAME="form1"> You are being redirected in <INPUT TYPE="text" NAME="clock" SIZE="2" VALUE="10"> seconds. </FORM> </center> <?php //echo header("Location: $data[0]"); } } } ob_flush(); ?> After 10 seconds it should do the 'else', which is the header redirect. Although it's just doing it straight away without waiting the 10 seconds. Any ideas? Thanks.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.