Jump to content

T Horton

Members
  • Posts

    52
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

T Horton's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hi I have been doing a bit of searching on the web for you and found the following address: http://uk.php.net/manual/en/function.zip-open.php On there is some code that extracts files from folders and subfolders in zip files by someone called "xsign dot dll at clansuite dot com". Hopefully this might point you in the right direction. Best Regards Tom
  2. Hi Not sure why you are putting the "SELECT" statement at the beginning, but in order to update any records where the product ID is between 100 and 120, you would need to use the following SQL: <?php $sql = mysql_query("UPDATE contact_form_BACKUP SET Lang='1' WHERE ProductID BETWEEN '100' AND '120'"); ?> Hope this helps. Tom
  3. Hi I think something like this would do it: <select name="ID"> <?php $query = "QUERY HERE"; $rs = mysql_query($query); while ($row = mysql_fetch_array($rs)) { echo "<option value='$row[0]'>$row[1]</option>"; } ?> </select> Hope this helps Tom
  4. Thanks for your comments xtopolis. Next stage is the content. Hopefully got lots of that to come.
  5. Hi Just worked on your XHTML Strict suggestion and all is up and running now! Got it done quicker than I expected to be honest! I will work on that Greek word idea too. Good idea! Thanks again for all your help on this. Really appreciated.
  6. Hi Tags should now all be in lowercase.
  7. Hi Have you tried putting in an "if" statement in your code to see if the cookie has been set already? If you submit your php code on here I can have a look for you. Tom
  8. Not yet. That is work in progress (my next job)...
  9. Right all done. I have removed the text for now. I will have a think about what I should do with it (leave it out permanently, or put it elsewhere etc). Thanks again for your help.
  10. Hi I would personally use the stripslashes() function. <?php $str = "Submitted on \"PHPFreaks\" forum"; echo stripslashes($str); ?> Hope this helps. Tom
  11. Hi Does this help? <?php $domain = $_SERVER['HTTP_HOST']; ?> Tom
  12. It is basically because you have probably refreshed the submitted page so many times it is storing the information from before. Normally I find that when I get that message, going back to the first page, or closing the browser and starting on the homepage or first page again, that will disappear, as any sessions used previously will be lost. Hope this helps.
  13. Hi You are remembering to put: session_start(); ... at the beginning aren't you? I can't see it in your code you have pasted. :S Tom
  14. Hi there The problem is on this line: WHERE username =$_SESSION['username']"); What you will need to do is to declare the username string as a variable elsewhere, so your code would look something like this: <?php if(isset($_POST['name'])&&isset($_SESSION[username])) { $con = mysql_connect("localhost","root",""); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("myst", $con); $result = mysql_query("SELECT * FROM answers WHERE level='1'"); while($row = mysql_fetch_array($result)) { $a=$row['answer']; $b=$_POST['name']; if($a==$b) { $username = $_SESSION['username']; mysql_query("UPDATE users SET level = '2' WHERE username ='$username'"); header("Location:http://localhost/myst/welcome1.php"); exit; } else { header("Location:http://localhost/myst/welcome.php"); exit; } } } ?> <html> <body> <form method="post" action="<?php echo $_SERVER['PHP_SELF'];?>"> Name: <input type="text" name="name" /> <input type="submit" value="Submit" /> </form> </body> </html> Hopefully this should work for you. Tom
  15. Hi You would need to use: $text = "abcdefgh"; $newtext = str_replace("a", "b", $text); echo "Before: " .$text ."<BR>"; echo "After: " .$newtext; Hope this helps Tom
×
×
  • 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.