premiso
Members-
Posts
6,951 -
Joined
-
Last visited
-
Days Won
2
Everything posted by premiso
-
Is there a reason you want to use special characters? As far as I know it is not allowed and would be difficult to do as the url would have to be encoded to display. Your best bet is to try it many different ways to, if you cannot get it, chances are it is not possible.
-
You can use sessions to store an array of locations recently found and do a loop to check that array and if the location was found find a new one. If you want this to last longer than the session, permanently, I would suggest creating a new table in your database, "locations_found", which will list a memberid and locationid of the locations that a member has already found. Then you would just check against that to see if the locations has already been discovered by a user. Hope that makes sense, good luck!
-
trying to retrieve info but SELECT command not working
premiso replied to bruceleejr's topic in MySQL Help
You can test for just the dashes, or do not incorporate the dashes and separate it into 3 different fields and just combine the fields if they are not empty. Unable to really see what you are talking about as the site errors out to a checking for malicious content page. -
Issue reading as spaces (they encode as the ? diamond in FF)
premiso replied to cooldude832's topic in HTML Help
It could be your editor / how you are saving the file. Try and create a new file and paste the code in it and see if that fixes it. -
IE can test for a posted button. If you want a definitive answer to your problem post your form code.
-
Well for me, I have no clue what your ultimate goal is of obfuscating with PHP. Can you elaborate more on what you want to input and the output you expect out? What are you trying to hash up with MD5 and send? And just a note MD5 is a hash method and not an encryption method. But yea. please elaborate on what you are trying to do with examples etc and I bet you will find the help more plentiful.
-
The password you have in your database is raw text and non-hashed. The PASSWORD function in mysql will hash the password before checking it against the data. Either, when you input the user data, use PASSWORD as well or do not use PASSWORD. Either way be consistent or else they will not match.
-
As far as I know, they do not care as long as the link works.
-
Use a foreach loop. if(is_array($errors)) { foreach ($errors as $error) echo $error; } That will loop through and display each item of the array.
-
Add some better error reporting. Also try not to use or die, instead use or trigger_error as errors can be turned off for production: <?php ini_set("display_errors", "1"); error_reporting(E_ALL); require_once('db_login.php'); include('blog_entry.inc'); $conn = mysqli_connect($db_host, $db_username, $db_password, $db_database) or trigger_error('Error connecting to MySQL: ' . mysql_error()); if(isset($_POST['btnSign'])) { $title = trim($_POST['txtTitle']); $body = trim($_POST['txtBody']); $sql = "INSERT INTO posts (post_id, title, body) VALUES ('', '$title', '$body')"; $result = mysql_query($sql) or trigger_error('Error, query failed: ' . mysql_error()); } ?> Give that a shot and see what the error is, note the use of mysql_error which will give you a more indepth error message.
-
Do you have any current code? If not you probably will not get much help from this forum. As this forum is for people who are having issues with scripts they code. So either give it a try and when you get hung up use the forums for that question or post this in the freelance and offer to pay someone to create it.
-
Once you set a cookie it will not be available via the $_COOKIE until the next page reload. Here is a simple test on cookie setting: <?php if (isset($_GET['set_cookie'])) { setcookie("name", "value", time()+3600, "/"); }elseif (isset($_GET['unset_cookie'])) { setcookie("name", false, time()-3600, "/"); unset($_COOKIE['name']); } if (isset($_COOKIE['name'])) { $output .= "The cookie name with a value of " . $_COOKIE['name'] . "<br /><a href=testcookie.php>Click here to refresh the page</a> <a href=testcookie.php?unset_cookie=yes>Click here to unset it</a>"; }elseif (isset($_GET['set_cookie'])) { header("Location: testcookie.php"); }else { $output .= "The cookie has not been set yet. <a href=testcookie.php?set_cookie=yes>Click Here</a> to set one."; } echo $output; ?> That is a simple way to test cookie setting and un-setting. The code may have some syntax errors etc as it is untested, but hopefully you get the idea. (Note that the site does a redirect after the setting of the cookie so you can see the cookie, as without that you will not be able to access the cookie till the next page reload).
-
To find the error use this: $personality = mysql_query("select * from rp_staff ORDER BY `rp_staff`.`country`,`rp_staff`.`state,`rp_staff`.`city` ASC") or trigger_error("Query Failed: " . mysql_error()); And see what error is returned from the query.
-
SELECT City, State, Country FROM users ORDER BY Country, State, City Should be what you are looking for.
-
As far as I know it will prevent all SQL Injections. Now you will want to use regex if you need to validate values, such as a username cannot have certain characters or a password requires x characters etc. But for preventing SQL injections mysql_real_escape_string will do the trick, as that is what is coded for.
-
It seems like it may be a limitation of XP Home Edition: http://episteme.arstechnica.com/eve/forums/a/tpc/f/99609816/m/331006081831 Switching to Windows 7 / Vista or Windows XP Pro may allow for all memory to be utilized. Just hope it is not a limitation of your moBo.
-
To prevent SQL injection, simply use mysql_real_escape_string if you also want to prevent an XSS exploit use htmlentities as well, which will convert any special HTML characters to their proper entity. Hope that helps.
-
Switching from ASP to PHP...Need Help connecting to Access Database
premiso replied to cdogstu99's topic in PHP Coding Help
I would second Thorpe's suggestion. But if you are stuck on ASP stuff, SQLServer is way better then access as well. Access is just...well its own little demon. If you are switching to Linux / PHP, definitely switch to MySQL as well. And yea, I used to develop in ASP / SQLServer / VB C# too. But my boss used SQLServer, which was way better then access. I still hated coding in VB when I had to though. -
I am not great at knowing which type of join to use, but this should work: SELECT * FROM (SELECT thread, MAX(id) AS id FROM messages GROUP BY thread) t1 INNER JOIN messages t2 ON t2.thread=t1.thread AND t1.id=t2.id JOIN users t3 ON t2.fromme = t3.id WHERE tome = '$userid' AND INDELETE !='y' ORDER BY t1.id DESC See if that does what you want it to.
-
Blue Screen of Death with various Wamp servers
premiso replied to francisexpress's topic in Apache HTTP Server
I have never used HOME edition, but it could be that the HOME edition does not like servers being on it. I know that you cannot install IIS on HOME because it is the home edition and they want you to pay more for that functionality. I may be wrong since you are trying to install Apache, but I bet that is where your problem lies. Either what or you have an unknown driver and you need to find the right driver software for it and get that fixed. Next time it BSoD's write down that the error was, specifically the type of error and the file causing the error as that may help. -
Does the script upload a file? If so you should check what the maximum POST size is, as that will need to be modified as well to be able to upload larger files.
-
If you want it all to be relative to the root of the webpage this add this to the html output in the header.php file: <base href="http://www.domain.com/"> As that would set the base url to that for each page so the links etc are all relative to that path. If that is not what you wanted please let me know and try to describe better what you want.
-
Please do not make repeat posts. Your questions has been answered in your other post.
-
$ needs to be escaped inside of double quotes: eval("if( !isset(\$_SESSION['server']) ) { \$_SESSION['server'] = \"Direct TV\"; echo \$_SESSION['server']; } else { echo \"<b>Server</b> already set! (\". \$_SESSION['server'] .\")\"; } ");