452 Posted Topics
Re: That is because a DELETE query will always return TRUE if it could be executed, and it *can* be executed, even if no rows are affected by it. If you want to count the number of rows affected (the number of rows deleted), which would tell you if anything has … | |
Re: Well that is because you use double quotes, and any PHP variable typed plainly within double quotes will take and output the value of that variable. In other words, if $root = NULL, it will output empty space if used inside double quotes. If you want to output literally "$root" … | |
Re: That will work, but how will you create each unique file? By hand or? ;) Here's a quick setup on a basic login script: 1. Create a database table containing user login data (user_id, username, password (encrypted if you wish!)). 2. Create a login script, that matches the submitted login … | |
Re: First of all, using $_REQUEST may pose some danger to security, because if I would now go to your PHP file's location and put "?submit=true&email=somedangerousvirus" in the link, I would gain access to writing a file to your server. Then, why would your file writing not be working? Did you … | |
Re: Well that's probably because something has gone wrong while executing your query. Try adding OR exit(mysql_error()) to your query lines, so that it would become, for example: ` $checkUserQuery = mysql_query("SELECT * FROM $tbl_name WHERE userName = '$user'") OR exit(mysql_error());` `$checkEmailQuery = mysql_query("SELECT * FROM $tbl_name WHERE email = '$email'") … | |
Re: Don't you have access to your DNS settings? If so, you could just change the DNS settings of your domain A to load domain B instead. I'm no DNS expert, but I think that is possible. If so (or if not) I hope that there's anyone else here that can … | |
Re: > Types of errors in php: 1.) Parse Error or Syntax Error, 2.) Fatal Error, 3.) Warning Error, 4.) Notice Error And of those number 1 and 2 will stop executing your script, while 3 and 4 will not. In other words: in case 1 and 2 your script will … | |
Re: Mr. unknown, are you following a tutorial on how to start with PHP or? :) | |
Re: When do you want to display this information? During the upload process, or after the upload process has completed? I presume it is the first, in which case I would advise you to search Google for an AJAX file uploader. There are plenty of them on the internet, I'm convinced … | |
Re: $sql="select image from images where id='$_GET[id]';"; I think you should remove the first semicolon in that line and place it after the following line: $row = mysql_fetch_array($result) Next question: What is the error you are getting? :) Also, if you are using PHP's mysql functions to connect to your database, … | |
Re: Did you: 1. Check if you started a session in both files, using session_start()? 2. Validate that each $row actually contains the values you expect it to contain? You can use var_dump($row), for example, to output a row (or print_r($row)). 3. On your second page - manage-products2.php - you could … | |
Re: That error means that you do not have your CURL extension enabled. Are you running a local server or a hosted server? If you are using a local server, you can navigate to the folder in which your php.ini file resides (for me that's "\xampp\php"), open up that php.ini file, … | |
Re: Have you checked out the create_function() function? See here: http://php.net/manual/en/function.create-function.php | |
Re: Plus there are huge communities for PHP, so if you get stuck you'll probably be able to get help fast. There are a lot of popular CMS'es being written in PHP, so if you want to use those, having some PHP knowledge can be useful. | |
Re: Change this: function browse($dir) { global $filenames; if ($handle = opendir($dir)) { while (false !== ($file = readdir($handle))) { if ($file != "." && $file != ".." && is_file($dir.'/'.$file)) { $filenames[] = $dir.'/'.$file; } else if ($file != "." && $file != ".." && is_dir($dir.'/'.$file)) { browse($dir.'/'.$file); } } closedir($handle); … | |
Re: Well there certainly seems to be no error on line 37 of the script you presented to us. Could you echo your query and post it here? (E.g. $query = [your query goes here]; echo $query; ) | |
Hello there, I would like to know if anyone knows a solution for excluding a group within a group in a regular expression. For example: /(name|(?:last[ ])name|(?:first[ ])name)/i I would only like the word "name" to be returned (this is just an example), but when I take match number 1 … | |
Re: Hmmm if you want both to be valid, try: '/^(\d{5})?([a-z.\-&'",\/\\ ]+)(\d+)$/i' This checks for: Must start with a digit of length 5 (because of the {5} part) or no digits (because of the questionmark after the ")") Must then be followed by one or more words Must end in a … | |
Re: "x equals x" is written with 2 times an "=", not one time ;). You are now setting a new value for $n in each if() statement. You should write it as $n == 3 instead of $n = 3. Also you're not comparing your results correctly. In line 2 … | |
Re: Try using absolute paths to your css files. E.g. not css/stylesheet.css, but /css/stylesheet.css or http://www.yourwebsite.com/css/stylesheet.css | |
Re: Your code should work, as you have a redirect in logout.php, which means that if you were to press backspace after you've been redirected, you would end up in logout.php again, which would redirect you to index.php :o. | |
Re: So where are you getting these links? Are they the link of the page the user is currently on? Or are you retrieving them from a database or something like that? For the rest, you could use regular expressions to find the base part of the link. I think something … | |
Re: > Also, for the error function, add a parameter (data) to it so that you can see what error is coming back. What stbuchok says :). Usually when I get an error it's because the specified file cannot be found. Javascript does not always use the same working directory as … | |
Re: It is, but I think you should just follow the tutorials that explain how to do that (or download the full scripts and implement them). It's a bit much to explain here I'm afraid. Lucky for you, you already have one "tutorial" waiting for you there (http://www.building58.com/examples/tabSlideOut.html). For the other … | |
Re: Hm this might not be what you're looking for but have you thought about using HTML for that? ;) For example: <a href="[specify a link]">[specify a title]</a> Which could become: <a href="website.com/page.php?id=$id">CLICK HERE</a> | |
Re: Usually the value of "href" is included within double quotes. E.g. <a href="http://www.google.com">Google</a>. Have you tried that? :) | |
Re: Well I don't think it is necessary to have sec_id and topic_id be the same ID. What you can do is: **Table 1 (sections):** id | section_name **Table 2 (topics):** id | section_id | topic_name Then when a user opens for example the section with the ID 1, you could … | |
Re: I haven't ever implemented such a thing myself, but when I googled PHP long polling, this is what looked interesting to me: http://www.nolithius.com/game-development/comet-long-polling-with-php-and-jquery http://blog.perplexedlabs.com/2009/05/04/php-jquery-ajax-javascript-long-polling/ Maybe it can help you :). | |
Re: You can either create a JOIN in your original query, or execute a subquery for each subcategory. In the first case you'd have to use PHP to detect the start of a new section. **With a JOIN:** <?php $q = 'SELECT tbl_categories.cat_id, tbl_categories.cat_name, tbl_subcategories.subcat_id, tbl_subcategories.subcat_name, FROM tbl_subcategories JOIN tbl_categories ON … | |
Re: Check out this website: http://phpsec.org/projects/guide/ It has some info on PHP security :). | |
Re: Well for starters, there appears to be missing a " at the start of your content definition (content=<div id=\"content\">) :). | |
Re: Yea you should probably use AJAX for that :). That's an Asynchronous Javascript And XML call, which enables you to execute PHP even after the page has loaded. Check out how it works here: A tutorial at w3schools: http://www.w3schools.com/ajax/ The jQuery documentation: http://api.jquery.com/jQuery.ajax/ | |
Re: Just a thought here: why don't you just use one field that you name "tags" (in your database). You can insert a comma separated list of tags into that field. When you retrieve it, you can [explode](http://php.net/manual/en/function.explode.php) it on the comma to create an array with tags. In that case … | |
Re: Great ^^. How did you do it? What I'd do is: <?php $parts = explode(' ', $name); for($i=0; $i<count($parts); $i++) { $first_letter = $parts[$i][0]; // Gets the first letter of the given part. $letters[] = $first_letter; } $initials_only = implode('.', array_map('strtoupper', $letters)); | |
Re: **About your regex:** You are checking only the first letter of your input string :). [A-Za-z0-9] checks one characters [A-Za-z0-9]+ checks 1 - infinity characters (until one is found that does not match), which means that at least one MUST match [A-Za-z0-9]* checks 0 - infinity characters, which means no … | |
| |
Re: What is says is that $media->group->thumbnail[0] is not an object. Maybe you could find out why? I haven't worked with simplexml for a while, but maybe it doesn't give all the properties it contains the possibility to use the attributes() function? Just some thoughts ^^. | |
Re: Hm that is strange indeed. Usually you should be able to modify globally defined variables from within a function. What's particulary strange is that the $film_ids variable does get filled within the function, but then appears to be empty in your global scope. I assume you are checking the value … | |
Re: I'm not sure but what you could try is containing the $(".delete").click(function() { alert("hello"); }); part inside the first function of your hover() function. | |
Re: Yea or ORDER BY your counts, which diafol has named a, b, c, d, etc. :) ![]() | |
Re: Just a usability note: "Your form submission has an error." is kind of an unclear error message. Do you really want the user to read such a thing? He might get confused ;). | |
Re: Well what you could do is: Put the logout script in a separate file. Then, when the user clicks "logout", he is sent to that file. The logout file redirects him to the homepage. So then, when the user clicks "back" when he is on the home page, he is … ![]() | |
Re: What you can do is redirect everything to index.php, then in index.php you read your URI by using $_SERVER['REQUEST_URI'], and then parsing that info. E.g. if REQUEST_URI returns "page/a-nice-html-page/" you could explode that data on the "/", scan that array and take the required actions in index.php. E.g. if $return[0] … | |
Re: Yup, the focus() function sets the focus to the target element :). For documentation, click [here](http://www.w3schools.com/jsref/met_html_focus.asp). | |
Re: Hmm what you could do is make your system remember where it puts which images. For example if it saves an image under the name "randomname123.jpg" and that image belongs to page 1, you could put a record in your database saying that "page 1" is connected to "randomname123.jpg", if … | |
Re: If I'm not mistaking, jQuery's [animate()](http://api.jquery.com/animate/) function let's you specify a function to execute when the animation finishes. If you put a [timeOut](http://www.w3schools.com/js/js_timing.asp) in that function that launches your second animation upon timeout, you should see what you want to see, I guess ^^. | |
Hey there. The situation is like this: 1. The user clicks a button. 2. Tooltip pops up. 3. The user clicks the button again OR the user clicks anywhere outside the tooltip. 4. The tooltip is removed. Now I can get either of the events described in step 3 to … | |
Re: For the first problem: <?php $q = 'SELECT anything FROM copyright WHERE copyr_md5 = "' . mysql_real_escape_string($md5check) . '" LIMIT 1'; $rq = mysql_query($q); $fetch = mysql_fetch_assoc($rq); if($fetch) { // A record that matches $md5check has been found. } ?> For the second problem: <?php $q = 'SELECT field1, field2, … | |
Re: Well you could write that a bit cleaner :). For example I'd use a switch (but maybe you should think about putting all this in a database). <?php $diagnostics = $_POST['diagnostics']; $room = $_POST['room']; if($diagnostics == 'Plomb CREP') { switch($room) { case '95': $price = 120; break; case '100': $price … | |
I just started wondering.. I have a bass class, let's say a class called Framework. This class contains a lot of functions and sets a couple of variables that are used inside other classes. What would be the most efficient way to access these variables from inside other classes? Should … |
The End.