premiso
Members-
Posts
6,951 -
Joined
-
Last visited
-
Days Won
2
Everything posted by premiso
-
It would help, A JM, if you posted some code for us to help you implement it, namely where you want this to occur.
-
The session saving is meant to be that way. To prevent this the only way I know how is having a session timeout after x amount of time. So you have a field in the DB that is "last activity" and if the time from last activity has been more then say 15-20 minutes of no activity you just make them re-authenticate to get back to what they were doing. This is heavily used on banking websites etc. And I believe that IE8 also has this "Save session" feature as well, but not 100% sure, but yea. Hope that helps. EDIT: Also welcome to the forums!
-
It is generally better to code for output buffer off, especially if you plan on selling or giving the script away. But it also depends on what you are doing, for instance, if you plan on gzipping your pages up, it would be better to have output buffer on so you can serve that out easier. But for most scripts you should have it off and do proper coding where you store output in a variable and echo it out at the end of the script, so you do not mix processing with outputting, to avoid errors such as this no matter the circumstance. That and output buffering is considered a "bandaid" for solving header errors.
-
You are not closing the file properly. fclose($fp); Should be: fclose($handle); Fix that and see if that solves your problem.
-
Radio! Who needs a radio? (Busts into a horrible version of mocking bird).
-
Why do you need to add that in the .htaccess in the first place? If the webserver is setup to parse PHP then you should not need that. Perhaps contacting GoDaddy Customer Support might yield some more accurate answers. The best answer is that GoDaddy limits their .htaccess file or does not have php 5 installed.
-
Please HELP in mail() function to send email from localhost
premiso replied to priyankabhar's topic in PHP Coding Help
If on localhost it could be that your ISP blocks port 25 (which is common among most cable providers). Verify that your ISP does or does not block Port 25. If they do, there really is not away around that other than find a smtp host that does not use Port 25. -
Creating a new .txt file in PHP. It's not aggreing with me.
premiso replied to gergy008's topic in PHP Coding Help
Check the permission of statuses folder, it would need to be 0777 for it to be writeable. There is nothing wrong with the code (just tested it on my local server) so the issue lies with permissions as the error states. EDIT: Also if the file already exists make sure those permissions are set alright, as that could be a problem as well since it is technically opening the file for writing. -
$string = "test" which hashed via: SHA1: a94a8fe5ccb19ba61c4c0873d391e987982fbbd3 <?php // SHA1 tests output $string = "test"; $sha = sha1($string); echo '$string = "test" which hashed via:<br />SHA1: ' . $sha . ' <br /> '; ?> Sometimes the best thing to do is just try a simple test script and see. EDIT: To more thoroughly answer your question: SHA Hash Functions Wiki for a good read. So, yes, SHA1 hashes only contain Alpha-numeric.
-
For an example / explanation of Session read the tutorial: Sessions and cookies: Adding state to a stateless protocol And for future code postings, please post them within // your code here tags
-
There is the problem Of course you are only getting the last answer, you do not have those options set as arrays. How do you expect PHP to know that you have 5 fields named the exact same and how to handle them? You may want to look at this article for a better understanding of what is happening.
-
Post some code. It is hard for us to help based on 3 sentences of a description. An attempt to help, look into sessions for sending the data to the second PHP script and see if that helps.
-
Sure can, you want to take a look into curl
-
Yea that is pretty impressive. 30,000 servers, what a nightmare! Imagine being the Network Admins for that ewww.
-
want to display images dependant on number in MYSQL field
premiso replied to nade93's topic in MySQL Help
I have no clue why it is not displaying. First up, you have to have "star.gif" image on your server. Second, you have to re-do that query to match your database. I do not know what you store in "field" if it is a number, then the code I provided should work. If the only problem is the image is not displaying that is because you have to modify that to be where you have the actual image. If you would like us to help you more, please provide some code so we can see what you are doing. Without it we are left to our psychic abilities (which mind you are not very good). -
Show us your queries, it may be possible to do what you want just within a single query, unless the point of this is to do it with PHP.
-
Do a while within a while...but why not just pull the data out of the database properly using Joins in MySQL?
-
If it sounds good, I like it. (I really like oldies too) To name some bands: NoFx, Rancid, Ramones, RHCP, SoaD, Slipknot, Goldfinger, Pink Floyd, Pantera, Metallica, Incubus, 311, Led Zepplin, Sublime, Garth Brooks, Tim McGraw....etc etc I am not really limited to what I listen to, if I like what I hear then I keep listening
-
want to display images dependant on number in MYSQL field
premiso replied to nade93's topic in MySQL Help
Sorry, I meant str_repeat. My mistake, here is an example of it's usage: $result = mysql_query("SELECT field FROM table WHERE condition = x") or trigger_error("Query Failed: " . mysql_error()); $output = ""; while ($row = mysql_fetch_assoc($result)) { $output .= str_repeat('<img src="star.gif" />', $row['field']); } echo $output; -
You want to change this: if (!$_SESSION['uid']) header('Location: login.php');?> To: if (!isset($_SESSION['uid']) || !$_SESSION['uid']) header('Location: login.php');?> EDIT: Basically what mike said, just provided a solution Using isset checks if it is set, so if it is not set they are definitely not logged in.
-
I would just start a new topic in the JS forum and post what the new problem / issue is with code examples and you can put as a reference a link to this topic.
-
Shouldn't it be $this->mysqli->error? Or should the query part be $mysqli->query Also remove the @, there is no reason to suppress errors, later on when it is on production you can turn error display off. $this->result = $this->mysqli->query($query) or trigger_error($query.'<br />'. $this->mysqli->error.'<br />'. __FILE__.__LINE__.__FUNCTION__);
-
Instead of using die let's use trigger_error with mysql_error to tell us what the issue is: $qry1 = "SELECT isReading, isPhysical FROM tblStudents WHERE isReading='1' AND isPhysical='0' AND SchoolSystem='" . $res0['systemName'] . "'"; $qry2 = "SELECT isReading, isPhysical FROM tblStudents WHERE isReading='0' AND isPhysical='1' AND SchoolSystem='" . $res0['systemName'] . "'"; $qry3 = "SELECT isReading, isPhysical FROM tblStudents WHERE isReading='1' AND isPhysical='1' AND SchoolSystem='" . $res0['systemName'] . "'"; $result1 = mysql_query($qry1) or trigger_error("Error 1: " . mysql_error()); $result2 = mysql_query($qry2) or trigger_error("Error 2: " . mysql_error()); $result3 = mysql_query($qry3) or trigger_error("Error 3: " . mysql_error()); See what is being returned from the mysql error function.
-
want to display images dependant on number in MYSQL field
premiso replied to nade93's topic in MySQL Help
str_pad is what you are going to be after. -
Add the or trigger_error part to your code as shown above and see what error MySQL is throwing so you can accurately fix it.