premiso
Members-
Posts
6,951 -
Joined
-
Last visited
-
Days Won
2
Everything posted by premiso
-
[SOLVED] Simple question with listbox default value
premiso replied to patheticsam's topic in PHP Coding Help
Yep, it is. EDIT: A better question would be, "I have tried to get this listbox to set a default value from a DB but I cannot figure out how. Here is my current code, could someone help me out?" You probably would have got a solution from me then. Can you do this *insert thing* -
[SOLVED] Best practices for user authentication?
premiso replied to Boo-urns's topic in PHP Coding Help
It might take me a little while to fully understand this, but I'll get it.... I think this is where I get a little confused... When you say "when a user comes to my site"...the way I'll know that is by checking if they have a session first, right? Right, basic login situation. If no session, check for a cookie. If no cookie show login form. If cookie validate it vs the DB then assign a session, unset the old cookie and set a new cookie with a new random value that is stored in your DB for the next time they come back. Set the session data then they are on their way. -
You are using a class, we do not know what class or how your class works to solve this issue for you. Does the class return null? If not that null check will never work.
-
<?php // insert statement here $next_id = mysql_insert_id(); echo "the next ID to be inserted is $next_id"; ?> Reading up on the last_insert_id it is suggested not to use it, but if you must, I think this would work: $query = "SELECT last_insert_id(colname) as next_id FROM classifieds"; $next_id = mysql_fetch_assoc(mysql_query($query)); $next_id = $next_id['next_id']; echo "the next ID to be inserted is $next_id";
-
Should be about the same as any other DB. As long as it is on the server should work fine.
-
Is either, php or .net salting the hash automatically?
-
[SOLVED] I Really Need A MD5 Auto Decrypter, Please Help!!
premiso replied to jamesxg1's topic in PHP Coding Help
I think it is #1 actually. Caps are annoying but not as annoying as that... -
Reading values from Database, new lines giving issues
premiso replied to SharkBait's topic in PHP Coding Help
Post where the data is being entered into the DB. And this site uses nl2br for displaying posts You should not store the <br> in the DB. -
Reading values from Database, new lines giving issues
premiso replied to SharkBait's topic in PHP Coding Help
Echo out that to your browser without formatting and then view source and see if it is split at the \n character on a new line. -
Glad to hear. Remember to mark this as solved (bottom left hand corner).
-
Post the SQL statement you use the grab the first set.
-
REGEX might be better but this will also work. <?php $foo = "blahblahblahrandomstuff {youtube}imdKQ3NNnoM{/youtube} moreblahblahblahrandomstuff"; list($before) = explode("{/youtube}", $foo); list(,$before) = explode("{youtube}", $before); echo $before; ?> Now you may have to escape the { and } if it gives you an error to be \{youtube\} but give that a try and see.
-
Reading values from Database, new lines giving issues
premiso replied to SharkBait's topic in PHP Coding Help
It really depends on how the data was entered. If the magic quotes was on at one point and you escaped it again then it will show the "\n" character instead of a break. Do you see the "\n" ? If so that was the problem and you can try a stripslashes before the nl2br function and see if that works. If it does that was your original problem: <td><?php echo nl2br(stripslashes($line));?></td> If that does not do it, something else is going on. Let me know if that works or not and I will post information on how to fix your DB data. -
Is that how the string is actually formatted? If not then post the actual string you want to parse, without that we are shooting blanks.
-
[SOLVED] I Really Need A MD5 Auto Decrypter, Please Help!!
premiso replied to jamesxg1's topic in PHP Coding Help
You cannot decrypt it. MD5 is a 1 way hash. You have to regenerate a new password for them. -
[SOLVED] Best practices for user authentication?
premiso replied to Boo-urns's topic in PHP Coding Help
Using session_start should automatically set a cookie with session id. No need to regenerate id's. The IP you can store it, but not good for authentication due to the ease of spoofing them. -
I don't think you can know when the download is finished unless maybe you use a flash downloader. But the IP bit is flawed too. You could try session, but you would need ajax for flash for the actual downloader so you can know when it is finished.
-
You either need to send the email using the regular line breaks (no nl2br) or send it with HTML headers for it to display properly with using nl2br.
-
Dont do nl2br before inserting the data. It is better to keep the data in it's raw format and only use nl2br when displaying.
-
<script>function delete(id) { var answer = confirm("Do you want to delete this gallery?") if (answer){ window.location = "http://site.com/to/where/you/want/to/delete?delete=1&id=" + id; } }</script> <form><input type="button" onclick="delete(28)" value="Delete Gallery"></form> But if you are using a form you could just use that to submit the form.
-
Not sure if it is valid, but it works.
-
If you look in the code at the site I posted you would have found this: <input type=button value="Back" onClick="history.go(-1)">
-
Post about 10-20 lines of code around line 63.
-
my javascript is hazy: http://javascript.internet.com/navigation/back-button.html <a href="#" onClick="history.go(-1)">Back</a> Should work.