Jump to content

strawbshaker

Members
  • Posts

    16
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

strawbshaker's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Ahh! It all makes sense now! My server uses 4.4.2. I'll sort it out! Thanks for all you help!
  2. I must be doing something wrong. I have copied the code from wildteen88 as it is and saved it as a php file. I have then uploaded that file along with my blank testpage.txt on to my server. I am then trying to access the php page and I am still getting the same message. Am I going about testing this file all wrong?
  3. Hi there, I'm using the following bit of code and get the error message: [color=red]Parse error: parse error, unexpected '{' in /xxx/file.php on line 4[/color] [code]<?php $file = "testpage.txt"; if (file_exists ($file)){ try { // The Error is occuring here if ($readfile = fopen ($file, "r")){ $curvalue = fread ($readfile,filesize($file)); $curvalue++; if (is_writable ($file)){ try { if ($writefile = fopen ($file, "w")){ fwrite ($writefile, $curvalue); echo "Wrote $curvalue to file."; } else { throw new exception ("Sorry, the file could not be opened"); } } catch (exception $e){ echo $e->getmessage(); } } else { echo "File could not be opened for writing"; } } else { throw new exception ("Sorry, the file could not be opened."); } } catch (exception $e) { echo $e->getmessage(); } } else { echo "File does not exist."; } ?>[/code] Can anyone see the problem?
  4. Thanks ignace! I will have a play and see what I can come up with.
  5. Hi There, I am busy working on a project building my own javascript/php html editor. The javascript part is fine and dandy. I have worked out how to upload files from my hard drive to the server but what I really want to achieve is saving the contents of a form textarea into an html file to overwrite the contents of the file. I do have the use of a MySQL database. I do want to try do it without the db though. Can anyone tell me were to start? (ie. point me in the direction of a good tutorial or ebook or something) Many Thanks!
  6. [color=blue][b]Last question:[/b][/color] Is it possible to have the form action set to 2 pages? For example: [code]<form action="login.php,loggedin.php" method="POST">[/code] The reason I want to do this is because: a) when it is set to login.php it updates things like the hyperlink box to display the right section of hyper link but then I get the blank screen on successful login. b) when it is set to loggedin.php I get to the page I want to be at but it doesn't update the hyperlinks box. Any advice?
  7. [color=red][size=18pt]REDARROW IS INDEED A PHP GURU! [/size] [/color] A true superstar! Thanks dude. Changing the form action to loggedin.php from login.php solved the problem. I can't believe I have spent ALL DAY (from 10am to 18:16pm UK time) trying to solve this silly mistake. Thanks again. I'm not sure I would ever have thought to revisit that part of my code. Thanks to everyone else for helping, you're all true gems!
  8. session_start(); is in the one of the includes. The code used looks like this: [code]session_start(); session_name('ClientLogin'); header("Cache-control: private"); //Fix for IE[/code] I have tried replacing $_REQUEST with $_POST and I am still getting the same result. Should the form method for the form in login_form.htm not be $_POST instead of just POST maybe?
  9. I ahve just noticed that when I get the blank screen the web address bar says I an still on login.php and not loggedin.php.
  10. I tried that and the loggedin.php page came up no problem. Have I missed a slash, colon or anything like that anywhere that might be causing this error?
  11. here's the login_form.htm: [code]<div align="center">Please Login</div> <form action="/login.php" method="post">   <table width="30%" border="0" align="center" cellpadding="0" cellspacing="0">     <tr>       <td width="19%">Username:</td>       <td width="81%"><input name="username" type="text" id="username" value="<?=$_POST['username'];?>" /></td>     </tr>     <tr>       <td>Password:</td>       <td><input name="password" type="password" id="password" /></td>     </tr>     <tr>       <td>&nbsp;</td>       <td><div align="center">           <input type="hidden" name="req" value="validate" />           <input type="submit" name="Submit" value="Submit" />         </div></td>     </tr>   </table> </form> [/code]
  12. I have moved the header() as suggested by redarrow and changed to content of my loggedin.php fole to check if the error is there. I have combed through every possible connecting script to check for errors and I can't find any thing wrong. I feel like crying as I got stuck on this when I went to bed last night and have been working on it all day so far and haven't got any where. AAAGGGHHH!!! Thanks for trying to help though and keep the suggestions coming! i really appreciate any help.
  13. I have added/updated the following code in my mai script and still no joy: [code]setcookie('userid', $unique_userid, time()+24*3600*60);[/code] [code]session_write_close(); header("Location: http://www.mydomain.com/loggedin.php");[/code] Any other advise? Thank you to those who have already contributed.
  14. Is ther a better line of code that I can use instead of: [code]header("Location: /loggedin.php");[/code]
  15. I have tried inserting the following as suggested: [code]$login_time = mysql_query("UPDATE dbtable                       SET last_login=now()                       WHERE id='{$row['id']}'");       }       session_write_close();       header("Location: /loggedin.php");[/code] I have tried using set cookie recommended in anther thread and that hasn't worked either.
×
×
  • 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.