198 Posted Topics
Re: I think he meant to ask you to print_R $_SESSION to see what's in your session, the post data has nothing to do with your session data. `die(print_r($_SESSION, 1));` That will print out the structure of your session array so we can see how it's formed | |
Re: If you wanted to load the txt file after the page has already been generated without refreshing you'll have to send an AJAX request to another PHP script which reads the text in the file and sends it back. The script that reads the file can be PHP but the … | |
Re: It is running every 2 seconds, but after the first time it runs the first time you're setting the background position to -600, not subtracting -600 so the animation does nothing after the first go around. Try this instead which substracts 600 px each time: `$("#carousel").animate({backgroundPosition:'-=600px'}, 500);` | |
Re: Create a LastOnline timestamp row in the DB. When someone is logged in, everytime they load a page, update the timestamp When you want to know who is logged in do a DB query and get everyone who's timestamp is within the previous x amount of time. For example on … | |
Re: Two issues. Your IF statement is failing because you missed the = between name and "submit" online 23 so the name of your submit button isn't being passed: `<input type="submit" name"submit" value="Log In"/>` Change To `<input type="submit" name="submit" value="Log In"/>` This looks like a tpyo, $_PASS should be $_POST on … | |
Re: From here: `extract($row);` That's taking the DB Row and turning the assoiative array and turning it into variables named by their array key. in this case the only thing we get is product from the DB so rather than having to type $row['product'] every time the above line lets you … ![]() | |
Re: you want to get the offsetTop preoprty of the main menu than get the scrollbar position. If the scrollbar is down more pixels than the main menu, add your top menu. Here is a small example in jQuery (untested): var main_menu_top = $('#main_menu').offset().top; //Change the number to the height of … | |
Re: `document.getElementsByName("mytext")[0].disabled = true;` | |
Re: PHP is run by the server prior to passing everything to the browser which processes JavaScript. Once this code gets to your browser it will look like this: <HTML> <HEAD> <script Type="Text/javascript"> function add() { document.getElementById("test").innerHTML = "3"; } </script> </HEAD> <BODY> <Table><TR><TD><button onclick="add();">CLICK</button><P id="test">One</P></TD></TR></Table> </BODY> </HTML> So it doesn't … | |
Re: Relevance isn't a command, you have to declare it: SELECT * FROM listings WHERE MATCH(title) AGAINST('ipod' IN BOOLEAN MODE) AS relevance ORDER BY relevance DESC | |
Re: My guess is you need to set another property in the items something like itemUrl, but we would need to see the rest of the JS code (the part that actually ouputs the HTML) to know exactly what it needs | |
Re: var means variable, it just tells JS that you want x to be a variable holder. So this takes the value of the demo element and stores it in x. It than checks to see if x is blank (x=="") or (||) if x is Not a Number (NaN). | |
Re: After your main content add: `<div style="clear:both;"> </div>` | |
Re: The low % of people who use tablet/mobile on Dani could also be partly as a result of the poor user experience on those devices. I know when we made changes to one of our sites to make it more mobile/tablet friendly we had nearly a 10% increase in use … | |
Re: input:hover{ color: #FFF; } input:focus{ color:#FFF; } input:active{ color:#FFF; } | |
Re: Missing quotes: `$query = "SELECT * FROM monsters WHERE id='$id'"` If that doesn't work, var_dump your $id and make sure it's being set properly | |
Re: All your DIV's have absolute positioning so that overrides the margin: o auto; you can use the Jorge's example but you'll need to change a few things. First you'll need to add relative positioning to your wrapper: `#wrapper {width:##px;margin:0 auto;position:relative;}` Than you're going to have to play with the left … | |
Re: The fopen failed, which when that happens it returns false which is causing the other two errors. As for the first one we would need to see some code to see what's going wrong, the error alone doesn't tell us much. | |
Re: Add an or die(mysql_error()) to your query to see if it's failing. It's a very bad idea to add un-verified data to your DB. At the absolute very least you should make sure your POST data is set. Without any form of error handling it's difficult to say where exactly … | |
![]() | Re: Add a stopPropagation() call to the live functions on your action images, ie: $("delete_img").live('click',function(e) { e.stopPropagation(); //other actions here }); ![]() |
Re: More than likely the script in the body of your page is trying to run prior to the jQuery being loaded. Try putting it in an onload function and adding a type: script.type = 'text/javascript'; script.onload=scriptLoaded; script.src = 'https://ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js'; document.getElementsByTagName('head')[0].appendChild(script); function scriptLoaded { $('#main').click(function(){ alert('hi'); }); } That being said … | |
Re: Is your XML declared as XML?? `<?xml version="1.0" encoding="ISO-8859-1"?>` | |
Re: This should work for re-routing the domain, just change domain to your wanted domain: RewriteEngine on RewriteCond %{HTTP_HOST} !^www\.domain\.com$ RewriteRule (.*) http://www.domain.com/$1 [R=301,L] | |
Re: > But this one I can't believe you asking this question. You can't write a query for this plus creating a table? I don't think they want the code to do queries, they are just asking on an opinion if the table structure they came up with was a good … | |
Re: Basically what it is saying is if you take the visitor's IP and encode it, hide it in your HTML code along with the timestamp that you visited should you ever come across a page which has copied your code you can look at their code and asusming the didn't … | |
Re: Best way to do this would be to use AJAX. Have an empty DIV for your results on index.php and send the POST data via AJAX to search.php. Than take the results from search.php and add them to the empty results DIV. You would also need to change your pagination … | |
Re: Not in PHP but in your .htaccess file you can put this: RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME}\.php -f RewriteRule ^(.*)$ $1.php That will remove the .php from the end of the URL ![]() | |
Re: > If following an existing tutorial was as easy as setting up an existing CMS system such as WordPress, then WordPress wouldn't be that popular!! Unless you're doing it just as a learning project, don't just reinvent the wheel for the sake of reinventing the wheel. +1 A fully functioning … | |
Re: Maybe it's just me but this question doesn't make much sense... Syntax is the format in which code is written (i.e. PHP always starts with <?php and ends with ?>, $ implies a variable name, you end lines with ;, etc) Contructs are creating objects / calling language functions (echo, … | |
Re: all mysqli_real_escape_string does is add a \ in front of the characters to neutralize them, it doesn't remove them. When you echo out the value PHP also uses the \ to output the literal character rather than interpurate it so you won't see the \ in your echo'd text | |
Re: You missed the substr function in your elseif: if(substr($_SERVER["REQUEST_URI"], 0, 13) == '/our-people') { return TRUE; } elseif (substr($_SERVER["REQUEST_URI"], 0, 21) == '/information-sessions') { return FALSE; } else { return in_array($type,array('3_column_interior_page', '3_column_faculty_bio_page')); } | |
Re: If you're talking about dynamically acquiring the information without submitting the form you'd need to do an AJAX Call to another PHP Script which queries the DB and returns your Data. | |
Re: The mysql_num_rows if failing because your query is failing not because it returned 0 results. Add a die statement to your query to output the error to see what's happening: `$tinysql = mysql_query("SELECT * FROM products WHERE subcategory ='". $subcategory ."' LIMIT 4") or die (mysql_error());` On a side note … | |
Re: Try this: var re = form.firstName.value; if(re.indexOf(value) !== -1) {alert(alerttxt);return false} else {return true} | |
Re: Nothing is standing out, the only thing I can think of is mix-matching a field. Make sure your DB cols are of the correct type for the data your supplying... i.e. the to col isn't of type CHAR or something to the effect | |
Re: You can load the recaptcha with JS and than handle the answer with the PHP plugin. Just upload the php library to your site and add the following code to line 31 above: require_once('recaptchalib.php'); $privatekey = "your_private_key"; //Chnage this to your private key $resp = recaptcha_check_answer ($privatekey, $_SERVER["REMOTE_ADDR"], $_POST["recaptcha_challenge_field"], $_POST["recaptcha_response_field"]); … | |
Re: Nothing wrong with your PHP. Would need to see the JavaScript to know for sure what's going on however I did notice you're missing a comma. After you echo your image link and close the " you'll need another comma to identify the next item you're adding to your jQuery … | |
Re: I was counter voting xbat's down votes in the first thread when the whole thing happened, but that was before he went off the deep end and down voted 300 times. I just went through and up voted a few pages of his posts, I don't have much rep power … | |
Re: You should just be able to do this: $number = '+' . $Code."".substr( $mobnum, 0 ); ![]() | |
Is there any chance of getting an option to disabled the post preview the automatically shows up below the textarea as you type? Even just a simple check box or something on the page to disable for that post would be great. I spend a lot of time trolling the … | |
Re: He has three different DB queries, one is getting admins ($row1) one is geting staff with a banned account ($row) and the other gets Staff withour a banned account (no variable set for this one). While this method works it would be just as easy to make this all one … | |
Re: Wrap your nav div in a wrapper div. Set the wrapper div width:100% set the nav div to the width of the page content than margin:0 auto; : .nav_wrapper{ width:100%; background-color: #FFF; //Change this to the background color of your nav bar } .nav_bar{ width: 800px; //Change this to the … | |
Re: Your inputs all have the same ID / Name so when JS does the getElementById it just gets the first element it finds on the DOM. You could convert everything into an array and turn it into JSON, you'd have to look up how to do this with standard JavaScript … | |
Re: I don't know what you want to dictate what element gets what color. But if you create three different CSS styles you can change the class of a td element: document.getElementById("234").className = "green_box"; | |
Re: Once you submit that form to PHP all your radio box values will be available in the $_POST array by their name (i.e. $_POST['Answer1'] would have a value of LID1_1 or LID1_2 depending on which answer was selected. From there you just need to do a conditional if statement if($user_answer … | |
Re: Its diffacult to help when we don't have any code, how can we suggest "another" solution when we don't know what you're doing now? On a side note, this is an HTML CSS issue not a PHP issue so it's posted in the wrong place as well. Generally, if you … | |
Re: A lot of the big social media websites have what's called an API (i.e. https://dev.twitter.com/ and http://developers.facebook.com/) which will allow you to have a user login to their account from your website at which point you can interact with their friends. | |
Re: I agree with pritaeas, when it comes to security the more "layers" you can have the more secure you will be. While PDO helps to mitigate risk, there will always be unexpected input or ways discovered to circumvent that particular security check. For proper risk management I would alwyas verify … ![]() | |
Re: The printf function expects a string passed to it as a parameter to output. i.e. printf('Hello Word') you don't need it, you can just run the query. $qry="Insert into `postjob` (jobtitle,positions,category) VALUES('".$_POST['title']."','".$_POST['position']."','".$_POST['cate']."')"; `mysql_query($qry) or die (mysql_error());` | |
Re: Just thinking outside the box here, could always be a misconfigured session setting in php.ini or cookies disabled. |
The End.