Jump to content

php.ajax.coder

Members
  • Posts

    78
  • Joined

  • Last visited

    Never

Everything posted by php.ajax.coder

  1. You need to use Sessions check it out at php.net
  2. Try this 'SCRIPT_FILENAME' if not you should be able to find it here -> http://uk3.php.net/manual/en/reserved.variables.server.php
  3. Would highly recommend wordpress because of the free plugins and designs
  4. Try using a cms like wordpress it's free add has lots of cool features http://wordpress.org/
  5. Try using a cms like wordpress it's free add does this and more http://wordpress.org/
  6. try removing '$conn =' and add a closing } to the foreach statement on the line $conn = mysql_connect($dbhost, $dbuser, $dbpass) or die ('Error connecting to mysql');
  7. you don't need the quote makes around the db name in the insert query INSERT INTO sample_db
  8. Try using xampp http://www.apachefriends.org/en/xampp-windows.html or EasyPhp http://www.easyphp.org/index.php both open source and include PHP Apache Mysql plus others
  9. You have to request the file through the web browser http://localhost/file.php
  10. I found a good tutorial to do this http://www.tanguay.info/web/tutorial.php?idCode=phpDevelopment&sectionIdCode=installApache
  11. Try looking at this http://www.w3schools.com/php/php_mysql_create.asp
  12. Have a look at this http://uk.php.net/manual/en/function.mysql-fetch-row.php
  13. This is more of an SQL question post it there and you might get you answer
  14. I would have three tables in the database 1. Users - UserID, IP 2. Posts/Announcements PostID etc 3. viewed - UserID and PostID Add each new IP to the users table and then add an entry to the viewed table when the post is read. Then check for entry to see if viewed
  15. Try looking at this post http://www.phpfreaks.com/forums/index.php/topic,95433.0.html
  16. Try this Script <?PHP $chars = array("A","B","C","D","E","F","G","H","I","J","K","L","M","N", "O","P","Q","R","S","T","U","V","W","X","Y","Z","a","b", "c","d","e","f","g","h","i","j","k","l","m","n","o","p", "q","r","s","t","u","v","w","x","y","z", "1","2","3","4","5","6","7","8","9","0"); //Lenght of String $string_length = 6; //Result String $result = ""; //Array Length $count = count($strs) - 1; for ($i = 0; $i <= $string_length; $i++){ $rand = rand(0, $count); $result = $result . $strs[$rand]; } echo $result; ?>
  17. Try looking at this http://uk2.php.net/manual/en/function.mysql-fetch-row.php
  18. make it clear what you want to do
  19. You could use a timestamp with a random number added to the end e.g. <?Php echo time() + rand(0,9); ?>
  20. Try Something like this <?php $con = mysql_connect("localhost","peter","abc123"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("my_db", $con); $result = mysql_query("SELECT * FROM person"); while($row = mysql_fetch_array($result)) { echo $row['FirstName'] . " " . $row['LastName']; echo "<br />"; } mysql_close($con); ?>
  21. Try this script <script type="text/Javascript"> var xmlHttp; try{ // Firefox, Opera 8.0+, Safari xmlHttp=new XMLHttpRequest(); }catch (e){ // Internet Explorer try{ xmlHttp=new ActiveXObject("Msxml2.XMLHTTP"); }catch (e){ try{ xmlHttp=new ActiveXObject("Microsoft.XMLHTTP"); }catch (e){ window.location="noajax.html"; return false; } } } function pageRequest(page){ xmlhttp.open('GET', page); xmlHttp.onreadystatechange=function(){ if(xmlHttp.readyState==4){ document.getElementById('content').innerHTML=xmlHttp.responseText; }else{ document.getElementById('content').innerHTML='<center><img src="images/loading.gif" alt="Loading" style="border:0px;"/><br />Loading, Please Wait...</center>'; } } xmlhttp.send(null); } </script> Just use the GET method by adding the value to the page name EXAMPLE news.php?value=4 <a href='javascript:pageRequest("news.php?value=4")'> From the file use <?Php echo $_GET['value']; ?> to get the value
  22. Just use the GET method by adding the value to the page name e.g. news.php?value=4 From the file use <?Php echo $_GET['value']; ?> to get the value
  23. Try <?PHP $category = $_GET['category']; $sql = "SELECT * FROM products where category= '$category' "; ?>
×
×
  • 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.