-
Posts
2,527 -
Joined
-
Last visited
Everything posted by DeanWhitehouse
-
Impossible ?? Too Ambitious ?? Plain Crazy??
DeanWhitehouse replied to DeanWhitehouse's topic in PHP Coding Help
I was hoping to do it in just PHP without downloading any extensions etc. Or will i need some other languages. -
[SOLVED] PHP Location used for opening two urls
DeanWhitehouse replied to aeafisme23's topic in PHP Coding Help
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 } -
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
-
[SOLVED] PHP Location used for opening two urls
DeanWhitehouse replied to aeafisme23's topic in PHP Coding Help
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 -
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?
-
[SOLVED] Why isn't My Database Updating ?
DeanWhitehouse replied to god_zun's topic in PHP Coding Help
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']; -
If you are copying and pasting why not split it your self?
-
[SOLVED] Why isn't My Database Updating ?
DeanWhitehouse replied to god_zun's topic in PHP Coding Help
Vars dont carry over scripts like that . -
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.
-
[SOLVED] PHP Location used for opening two urls
DeanWhitehouse replied to aeafisme23's topic in PHP Coding Help
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> -
[SOLVED] Why isn't My Database Updating ?
DeanWhitehouse replied to god_zun's topic in PHP Coding Help
$sql="UPDATE $tbl_name SET Date='$Date', Merchant='$Merchant', TrackingNum='$TrackingNum' WHERE ID='$ID'"; Where is $date , etc. defined? -
[SOLVED] Why isn't My Database Updating ?
DeanWhitehouse replied to god_zun's topic in PHP Coding Help
Then read the errors produced by them and fix them -
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?
-
[SOLVED] Undefined Variable PHP_SELF ?
DeanWhitehouse replied to stublackett's topic in PHP Coding Help
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." > -
[SOLVED] Why isn't My Database Updating ?
DeanWhitehouse replied to god_zun's topic in PHP Coding Help
Add die statements to all of your sql querys , when debugging. -
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> '; } ?>
-
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?
-
Didnt change a thing
-
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.
-
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?
-
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
-
ahh ,well he has 2 ways now.
-
Could you not strip the spaces in the file name when requesting or are they needed?
-
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>
-
Is the that the whole page code?