Jump to content

DeanWhitehouse

Members
  • Posts

    2,527
  • Joined

  • Last visited

Everything posted by DeanWhitehouse

  1. I was hoping to do it in just PHP without downloading any extensions etc. Or will i need some other languages.
  2. This will work if ($somevariable == "showpopup") { ?> <script type="text/javascript"> window.open("http://google.com","myWindow","status = 1, height = 300, width = 300, resizable = ") </script> <?php }
  3. Ok, adding a star is simple, i will leave you to work it out ,and use str_replace for the rest of what you want. http://uk2.php.net/str_replace
  4. So you would need js to make a pop up, something like window.open("http://google.com","myWindow","status = 1, height = 300, width = 300, resizable = ") Should do , i think
  5. Ok, well if you are putting it into a text area, and have made the new lines, using nl2br(); should split it into new lines, if that is the problem?
  6. Ok, you have no clue what your doing , do you? When you post a var , you retrieve it using $_POST[''];, and what you put in between the braces is the name of the field the value is in. e.g. <input name="name" type="text" id="name" value="<?php echo $rows['Date']; ?>"> //The post var would be $_POST['name']; , not $_POST['date'];
  7. If you are copying and pasting why not split it your self?
  8. Vars dont carry over scripts like that .
  9. When you say you have a string like that, is it generated from a flat file storage system or database? Edit: Also read what you wrote, there isnt a question there.
  10. The only way i can think of doing it is having them click the links manually, e.g. <a href='mysitelink.php'>My Site link</a> <a href="http://exterenalsite.com" target="_blank">External site link</a>
  11. $sql="UPDATE $tbl_name SET Date='$Date', Merchant='$Merchant', TrackingNum='$TrackingNum' WHERE ID='$ID'"; Where is $date , etc. defined?
  12. Then read the errors produced by them and fix them
  13. Im not sure what you mean, do you mean test a server connectivity, or a computers (as in personal computer) or are you thinking of testing an interet connections speed?
  14. Nope, because $PHP_SELF; is not there, so the source code will be <form method="post" enctype="multipart/form-data" action="" > or , if error_reporting is on, <form method="post" enctype="multipart/form-data" action="Something like, Warning Undefiened Variable $PHP_SELF." >
  15. Add die statements to all of your sql querys , when debugging.
  16. Ok, so this is a unique way i wanted to access some private sections of my site , what i want to is be presented with four radio selections each one a different value , and one of the values is one i will recognise (which is in the array $checks) So far my problem is the fact that when run some of the selection boxes have duplicate numbers in, any advice on this? This is the page http://webstatus.awardspace.info/Personal/ <?php $checks = array("28","08","19","91"); $X = 0; echo ' <form action="" method="post"> '; $new = rand(0,3); $new1 = rand(0,100); $new2 = rand(50,100); $new3 = rand(0,50); $random = array("0","1","2","3"); $arr = array('<input type="radio" name="check" value="'.$checks[$new].'">'.$checks[$new].'','<input type="radio" name="check" value="'.$new1.'">'.$new1.'','<input type="radio" name="check" value="'.$new2.'">'.$new2.'','<input type="radio" name="check" value="'.$new3.'">'.$new3.''); while($X < 4) { $test = rand(0,3); $test1 = $random[$test]; echo $arr[$test1]."<br>"; $X ++; } echo ' <input type="submit" name="go" value="Check"><br> </form> '; } ?>
  17. Is this possible, what i want to do is have on my site, live screen shots of peoples websites, i dont need them updating constantly , but when the person comes to there list of sites, i want PHP to generate a screenshot of the site ?? Does anyone know where to start?
  18. Didnt change a thing
  19. Yes ,but it is not a good idea, here is one way to do it index.php?page=photos <?php if(isset($_GET['page'])) { $page = $_GET['page']; require_once '$page.php'; } ?> Not very secure, but it will start you off, or if you want to do it your way You will have a table called content then two rows, one called title and one called content (which will be text, not varchar) Then do <?php if(isset($_GET['page'])) { $page = $_GET['page']; $page = mysql_real_escape_string($page); //assuming you are connected to the database $sql = "SELECT*FROM content WHERE title='$page'"; $query = mysql_query($sql); while($rows = mysql_fetch_assoc($query)) { echo $rows['content']; } } ?> That should start you off.
  20. This is my JS file // JavaScript Document function createhandler() { var xmlhttp; if (window.XMLHttpRequest) { xmlhttp = new XMLHttpRequest(); } else if (window.ActiveXObject) { xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); } return xmlhttp; } function chatarea() { var xmlhttp=createhandler(); xmlhttp.onreadystatechange=function () { if(xmlhttp.readyState==4) { document.getElementById("chatroom").innerHTML=xmlhttp.responseText; xmlhttp.onreadystatechange = null; xmlhttp.abort(); } }; xmlhttp.open('GET', 'chat.php', true); xmlhttp.send(null); var t = setTimeout("chatarea()",1000); return true; } function addchat() { var xmlhttp=createhandler(); xmlhttp.onreadystatechange=function () { if(xmlhttp.readyState==4) { document.getElementById("error").innerHTML=xmlhttp.responseText; xmlhttp.onreadystatechange = null; xmlhttp.abort(); } }; var message = document.getElementById('chatenter').value; var params = 'message='+message; xmlhttp.open('POST', 'createchat.php', true); xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); xmlhttp.setRequestHeader("Content-length", params.length); xmlhttp.setRequestHeader("Connection", "close"); xmlhttp.send(params); return true; } And the problem is in IE, it will still insert the chat message but wont load the new posts , any ideas why, it works fine in Firefox,Chrome and i think Safari. Any help would be good. Using Chromes javascript debugger , i get this when i post . JavaScript Debugger attached to Chat Room "Refused to set unsafe header Content-length," source: (1) "Refused to set unsafe header Connection," source: (1) Any one know what it means?
  21. Ok, when i click on a file (tracey in my room ...) it just loads quicktime and plays the song in the browser, so i cant see any problem , but try replacing any spaces with %20
  22. ahh ,well he has 2 ways now.
  23. Could you not strip the spaces in the file name when requesting or are they needed?
  24. ahh ok, well its not w3c complaint then, but the only way i can think of it would be using JS to move enter the number in a tag after. e.g. <?php echo "<span id='tag'></span> foreach(glob("*.php") as $val){ $file = basename($val, '.php'); echo "<li>$file</li>"; $i++; //At the end of each loop, this counter is incremented. } //Since you don't want to echo the number of results EVERY time.......put it outside the "loop" echo "</ol>"; ?> <script> var i = <?php echo "There are ".$i." users in the database."; ?> document.getElementById("tag").innerHTML = i; </script>
  25. Is the that the whole page code?
×
×
  • 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.