Jump to content

yarnold

Members
  • Posts

    67
  • Joined

  • Last visited

Everything posted by yarnold

  1. Are you on a fixed IP address? If so you could have.. <?php if($_SERVER['REMOTE_ADDR'] == 'xx.xxx.xxx.xxx') { // Logged in } ?> Obviously replacing xx.xxx.xxx.xxx with your IP address.
  2. if(strlen($_POST['email'] > 0)) { // Process form information } else { // The length of the email field was zero, hence an e-mail address was not entered. }
  3. You haven't closed your ' tag have you? echo '<script type="text/javascript"> function changeContent(pos) {'; if (!$autodetect_noscoll) { echo ' centerpos = thumbstwg_offset[parseInt(pos)]; '; } else { echo ' if (thumbstwg_offset.length > ' . (($numberofpics * 2) + 1) . ') { centerpos = thumbstwg_offset[parseInt(pos)]; } '; } echo ' document.sohaform.item_name.value = ' . $image . '; reload=0; changeContentWait(pos);'; }
  4. Try using if(!array_key_exists('PHP_AUTH_USER', $_SERVER)) { // Your code here }
  5. To solve this problem using your solution, would mean that the sites you're "updating" remotely would have huge security risks associated with the process - instead of a phone number you could put malicious javascript and destroy their web page (even if only it's appearance.) It is unlikely that any sites would allow you to do it. I believe that it is possible to update lots of sites at the same time (in the same way that confused.com queries lots of different insurance company websites for quotations), however such a solution would probably be incredibly complex. I certainly wouldn't like to try it from scratch...
  6. You could use sessions to record the last submit date of the form. So, when the form processes, at the top of the form add <?php session_start(); if((array_key_exists('LastPostTime', $_SESSION) && (($_SESSION['LastPostTime'] + 60) <= time()) === false) { //Process form } $_SESSION['LastPostTime'] = time(); ?>
  7. Also if I were you I would replace $_REQUEST with $_POST... It's a little more secure.
  8. In the second file, add "session_start()" on the line before you try to echo out the session variable. session_start() needs to be exected at the top of ALL pages that call or set session variables.
  9. Does that not do the same as what I have in my .htaccess file at the moment? <IfModule mod_rewrite.c> RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^([_a-zA-Z0-9]+).php $1.php5 [L] </IfModule>
  10. Thanks. I will look into finding a more suitable web design image later on... I have changed the navigation so that the problem you outlined no longer exists (increased text-indent). I will also look at rephrasing my summary paragraphs, thanks for that point! Thank you for your kind comments
  11. Hi all At the moment, my client's web host only supports PHP5 when using .php5 as the file extension. For the moment I have worked around this by using .htaccess to rewrite .php to .php5. However, this means that whenever I upload the site to the server, I must go through all of the files directly accessed and change the file extensions to .php5. I was wondering if there is a line I could put into .htaccess to make apache "think" that .php extension files ARE .php5? Cheers for any help Ed
  12. <html><head><title>AlibreCam Verification System</title></head> <center><h3>AlibreCam Verification System</h3></center> <center><TABLE border=0 cellpadding=3><form name="input" action="verification.php" method="get"> <tr><td><center>Customer ID:</center></td> <td><input type="text" name="user"></td></tr> <tr><td colspan=2><center><input type="submit" value="Submit"></center></td></tr> </form><br></table><br> <?php include("connectioninfo.php"); $customer = $_GET['user']; $query= sprintf("SELECT * FROM invoiceid WHERE customerid=%s,$customer"); $query= mysql_real_escape_string($query); $cResult = mysql_query($query); $value=0; while($row=mysql_fetch_array($cResult)){ $value=$value+$row['numoflicenses']; } echo "Total number of licenses purchased: ".$value; ?> </html>
  13. There's another if statement that needs to be closed before your final closing tag, I believe.
  14. Then the session has been destroyed successfully. Instead of pressing the back button, manually navigate to the previous page, by typing the URL in the head of your browser. Give that a go.
  15. <?php session_start(); if(isset($_POST['text'])) { $text = $_POST['text']; $_SESSION['text'] = $text; ?> Were you meant to close that if { } statement there?
  16. I suppose you could try (note: not tested) <?php foreach($_POST as $key => $value) { $$key = $value; } ?>
  17. After your last session destroying code put print_r($_SESSION); and paste in this thread what appears.
  18. What code are you using to establish whether or not it worked?
  19. http://www.activestate.com/Products/komodo_edit/ Activestate Komodo Edit. I swear by it...
  20. Apologies Wildbug, I'm not used to your syntax
  21. <?php // Initialize the session. // If you are using session_name("something"), don't forget it now! session_start(); // Unset all of the session variables. $_SESSION = array(); // If it's desired to kill the session, also delete the session cookie. // Note: This will destroy the session, and not just the session data! if (isset($_COOKIE[session_name()])) { setcookie(session_name(), '', time()-42000, '/'); } // Finally, destroy the session. session_destroy(); ?>
  22. <?php $query = "SELECT account IS NULL AND pass IS NULL AND loginupdated IS NULL AS incomplete FROM users WHERE owname='{$_SESSION['s_username']}' LIMIT 1"; $result = mysql_query($query) or die (mysql_error()); if ($result && mysql_num_rows($result) && mysql_result($result,0) == 1) { ?> <script type="text/javascript"> alert("Our records show us that you have yet to submit your account login, please do so now."); location = "setpass.php"; </script> <?php } else { header('Location: members.php'); } ?>
  23. Make sure you use session_start() before using session functions.. also: In the PHP help pages of session_unset(), someone solved an identical error by using <?php session_unset(); session_destroy(); $_SESSION = array(); ?>
×
×
  • 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.