Jump to content

Zane

Administrators
  • Posts

    4,362
  • Joined

  • Last visited

  • Days Won

    11

Everything posted by Zane

  1. you're passing an attribute of this that doesn't exist in this element. You made need to alter your javascript IF statement to include the word "Continue".. you'll also have to change what you're passing to hidey. like this
  2. onclick should be onClick EDIT: nevermind.. i don't think HTML attributes are case-sensitive.
  3. If you want the overlay to appear on the click of something, then yeah... you'll have to use jQuery, or JavaScript if you're old fashioned like that.
  4. what you need to do to your overlay, not mask, is give it a position of fixed... and that should solve your scrolling problem.
  5. What exactly are you trying to do? Hide the checkbox?
  6. Here's the obvious part that was mentioned.. and yes, it is what you pointed out. But to elaborate more, it is the @ symbol that suppresses the errors. When you write @mysql_query, no errors are reported. Sure, the query might return false and cause your error message to come through, but you really have no idea whatsoever WHY. Take out the @ symbol first. Then you'll want to make use of a PHP funciton called mysql_error. This function will tell you exactly, if any, what error there is..... and there are pretty much two ways of using this function. You can either halt your script completely with the die function $qry = mysql_query("UPDATE user SET email='$email', password='".md5($_POST['password'])."' WHERE login='$login'"); $result = mysql_query($qry) or die("Your SQL error is: " . mysql_error()); Or you can put it into your error message variable. $result = mysql_query($qry); if($result) { header("location: register-success.php"); exit(); }else { die("Query failed - 2 .... because \n" . mysql_error() ); } After c/ping that I realized you already using the die function, but you're not using mysql_error. Regardless, don't suppress errors unless you absolutely need to.
  7. This is correct, though it isn't exactly effect more than it is a technique. This is not AJAX. This is called posting a form to an iframe. You can easily google that and figure that out. Here's a decent example http://stackoverflow.com/questions/168455/how-do-you-post-to-an-iframe As far as AJAX goes; if you know how to upload a file with PHP (with little to no help), then you're already half the way there. One of the most mainstream ways of performing an AJAX request is through jQuery.... a framework built around JavaScript.... which in turn makes AJAX nothing more than a variety of JavaScript functions. The key to uploading through AJAX is to have a hidden DIV element... it doesn't even have to be hidden, it could simply be a small blue square, what matters is that you have two files... your form file and your upload file. Also, depending on how you code it, you could easily get away with having one file altogether. What happens behind the scenes is that you submit the form to the upload form, using jQuery's $.ajax function or $.post or $.get... then you take the response of what you posted to the script and update the aforementioned DIV. Now, if it's progress bars that you're looking for, then that's an entirely different avenue altogether.. but you'd still be using the same technique.
  8. This topic has been moved to PHP Regex. http://www.phpfreaks.com/forums/index.php?topic=337970.0
  9. $text = "User Name (Real Name)"; $regex = preg_match("/^(.*)\s\((.*)\)$/", $text, $matches); $username = $matches[1]; $realname = $matches[2];
  10. Can you elaborate more on this "lock" and what InnoDB has to do with it? Have you completed this "lock" with MyISAM? What is your overall goal... other than this one-liner
  11. you would have to take the Auto increment off your id field, but yeah. You would also have to change the datatype to accommodate the MD5
  12. .20 stands for 20 out of 100 or 20/100 or 2 tenths or 2/10. This is exactly what the percentage sign is for in mathematics, to create a shorthand for x out of 100. Now that I have explained that explain how to take something more trivial and turn it into a decimal number. Suppose you have 47.5%. In order to put that into a decimal number, one needs to divide by 100.. or even better, move the decimal place 2 spaces to the left. The 2 spaces represent the 2 zeroes in 100. Once you have this decimal number, which is .475, it can be used to find 47.5% of something. Lemme back up even more. 1 X 1 = 1 ... right? So we want 50% of 1, which is .5, the equation would be 1 X .5 = .5 Why? Because anything times 1 equals itself. Ok, so now lets say you want to add 50% to 1. Well, we already know that 100% of 1 is 1, so we need to know what 150% would be. Now if you move the decimal place in that 2 times, which is at the end by the way, we get 1.5 Then the equation turns out to be 1 X 1.5 = 1.5 But since it's multiplied by 1, again, we end up with the same number. To mix it up a little, let's say we had 75 dollars and we wanted to add 20% to it. Since we want to ADD to the 75, we have the same dilemma as the 150% example. Instead, this time, we're wanting 120%, because we KNOW 100% of 75 is 75 The equation would then be 75 X 1.20 = 90
  13. I pointed you to the forums because I suck at mod_rewrite. Although, I did figure out the problem.. I couldn't figure out a solution. What is wrong with your rewrite, that I pointed out to you on those lines, is that you have the same pattern for two rules, causing variables to be sent to a different script.. causing an SQL error like a chain reaction. This url should go to the OP's mobile_themes.php file. http://mobilephones.pk/cell-phone-themes/nokia-5800-xpressmusic-themes-pg-2.php but instead, it redirects to mobile_themes_cat.php, because of these lines. 91: RewriteRule cell-phone-themes/(.*)-(.*)-(.*)-themes-pg-(.*).php mobile_themes_cat.php?bid=$1&pid=$2&cat=$3&page=$4 [L] 92: RewriteRule cell-phone-themes/(.*)-(.*)-(.*)-themes.php mobile_themes_cat.php?bid=$1&pid=$2&cat=$3 [L] The OP mentions that there is a database error on longer URLs, but what I tried to explain to him is that it's not the length of the URL, it is the number of characters between dashes.... or better yet, the number of dashes before -themes or -themes-pg. On line 94.. of his htaccess file. RewriteRule cell-phone-themes/(.*)-(.*)-themes-pg-(.*).php mobile_themes.php?bid=$1&pid=$2&page=$3 [L] I would say the solution to this would be to add another (.*) in there, but that would cause the categories to quit working. Since you said in IRC that you won't budge from your URL layout for SEO reasons, I'd say your best bet would be to list all possible categories within your regex for mobile_themes_cat.php, like this 92: RewriteRule cell-phone-themes/(.*)-(.*)-(games|cards|food|fruit|beer|squash)-themes.php mobile_themes_cat.php?bid=$1&pid=$2&cat=$3 [L]
  14. that else should echo func_get_arg(0) not 1.
  15. give your body tag a width of 860px and a margin of 0 auto; body { width: 860px; margin: 0 auto; } then give .bodyContainer a wdith of 100%;
  16. $q = sprintf("UPDATE members SET notes = '%s' WHERE uname = '{$_SESSION['user']}'",mysql_real_escape_string($notes)); mysql_query($q);
  17. post code (in CODE tags) for quality assistance.
  18. Never include/require a page within a loop. It's not just bad practice, it's downright illogical. Include at the top like you said before.
  19. What was your major busby? If you majored in Computer Information Systems, then I can understand how you came out not knowing enough to catch a junior level position. From 2005 - 2010, I majored in both Computer Info Systems AND Web Technologies (a double degree). In that time, I learned nothing new that would help me in the long run. Sure, I got to play with ASP.NET, VB.NET, PowerBASIC (for those who have heard of that) and XML/XSLT, but the curricula in those classes never reached passed the beginner level. PowerBASIC was only taught to us by sponsorship from a local tax software business who used that language to write the software. There was only one class offered on this language in this school and I took it, but that wasn't enough for Tax Services place to offer me a job in programming, much less technical support. In 2004, I took a PHP class, while in a Computer Science major at a university, just to see if I would get an A. By the second week of that class, I ended up running around the class helping people fix parse errors and invalid query errors that the professor had not even planned time for. There were times when we spent the entire class trying to make it to the same point. Unfortunately, everyone couldn't help but to forget a semicolon here, or an end parenthesis there. I even had to help the professor set phpmyadmin up. Needless to say, that professor lost his job, for lack of a Master's degree, I made an A and the rest of the class was still dumbfounded on the purpose of PHP at all. We failed to finish any projects, other than connecting to phpmyadmin. The best education I ever received concerning programming, in all of 6 years, was my first year's schedule. CS130 taught me quite a bit of Javascript and CS150 taught me more or less, OOP through Java. Even in CS150, we had questions like the one you posted. My point and question in all this is "What was your major?" and perhaps you chose the wrong one.
  20. You have to bind the click function to the live function when you have dynamic elements on your page. For instance, for your second example you would do this for the click part $(document).ready(function() { loadReviews(); $("a.test").live('click', function() { // Do something alert("test"); }); });
  21. $store_id = $rsfindBarIdBy['store_id']." - "; This line is where you would get such information. to get the storename you would simply add this $theName = $rsfindBarIdBy['storename']; etcetera...
  22. Are you serious? This thread is 1 month and 18 days old. Why are you digging up old questions and attempting to answer them? It doesn't help whatsoever. Unless of course the OP actually logs back in, after all that time and checks.
  23. You've got it right,.. but my advice would be to set a variable in SESSION called is_logged or auth or something that let's you use a boolean value. This way you can do this session_start(); echo "Hi "; if(isset($_SESSION['Username']) && $_SESSION['auth']) { echo "You are not logged in!"; echo " Please login below:"; } ?> But using that method, you should immediately have $_SESSION['auth'] set false by default until logged in... then set it true.. Doing this will allow you to know the last user logged in from the session... AND whether they are still logged in or not. Because, it is possible for a person to login AND logout in one browser session.
  24. SESSIONS is a superglobal. Just like SERVER, COOKIE, POST and GET, it is saved for a period of time, whether it be in a URL or in a POST form submission... the superglobals are there. The $_SESSION variable is a bit different though. It's difference is that it retains everything in its memory until the user's browser is closed, but in order to access the information in it, you must call the PHP function: session_start By calling this function you can: - set values - ... and retrieve values The main difference in SESSIONS and COOKIES, is that: - COOKIES are stored on the client's computer (the person with the browser) - SESSIONS are stored on the webserver... AKA the website. Once you have called session_start().. setting and getting SESSION variables are as easy as: session_start(); $my_name = $_SESSION['fname']; $_SESSION['fullname'] = $myname . " Smith";
×
×
  • 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.