452 Posted Topics
Re: It's probably this: You use `while($row = mysql_fetch_array($result))` to fetch your data, so you cannot use `$_SESSION["valid_id"] = $row->id;` (an object) to access the fetched data. You should use `$_SESSION["valid_id"] = $row['id'];` (an array), since you are working with an array, not an object. | |
Re: Well, for as far as I know the ? indicates the start of a query string, while & indicates the start of a new key/value pair inside that query string. E.g.: website.com?key=value&key2=value2&this=that The ? indicates the start, the & separates the key/value pairs. | |
Re: Can't you just post the error messages here? :o Doesn't feel very safe having to download that stuff for no apparent reason (but that could be me..). | |
Re: As both posters above are saying, you can use a header to redirect the user to another page. Example: if($row["emp_username"] == $uname && $row["emp_password"] == $pwd) { // Set the header that will redirect the user to the given page // when this page's PHP script is done loading. header('Location: … | |
Just some stuff that I come across often: 1. Would save me a second of time and effort if the "Username" field would get auto focused on the login page. I know it's a minor improvement, but I like it ^^. Facebook does it, for example - I like the … | |
Re: Wasn't working because your "WHERE" got glued right onto the name of your table so it seems :). | |
Re: Also take note that it is not recommended to use the mysql_* functions (see the warning in [this](http://us2.php.net/manual/en/function.mysql-query.php) article, for example, on PHP's official website). | |
Re: Well I guess you could start by Googling for some Flash tutorials? ;) | |
Re: What is in $faq['slug']? By the way, why aren't you just using PHP to take care of the redirecting process? :) E.g.: redirect **everything** to index.php, then use `$_SERVER['REQUEST_URI']` to find out what needs to be done. E.g. www.yoursite.com/products/brand/diesel would redirect to index.php, which would then see that the URI … | |
Re: Hmmm I don't know but it seems kind of useless to me to put all this stuff inside a function that doesn't get executed, or does it when you pass it to jQuery? What about trying just: $(window).scroll(function() { // Let's check the scrollTop just to be sure stuff is … | |
Re: Well, have you assigned $dialingCode to a value? In other words, is there some place in some script that says `$dialingCode = $_POST['dialingCode'];`? :) You could check the value of $dialingCode by using `var_dump($dialingCode);` | |
Re: That really is one of the weirdest regex setups I've ever seen :p. The following does what you asked for, but in a simpler way: <?php $is_valid = true; // To check for allowed characters: $regex = '/^[a-z0-9!@?#]+$/i'; if(!preg_match($regex, $password)) $is_valid = false; // To check the length: $string_length = … | |
Re: Would it work if you would just retrieve the links to the files from you DB, then check what file type it is, and then display an icon for that file type instead of a preview of the file? For example for a .doc file you display a Microsoft Word … ![]() | |
Re: Well I'm not completely sure but I think you cannot declare variables like that in PHP. First of all I think you need to use *public*, *protected* or *private* instead of *var*. Secondly, you cannot refer to class variables without using "$this->". Also it is recommended that you set these … ![]() | |
Re: So CURLINFO_HTTP_CODE and CURLINFO_EFFECTIVE_URL are returning the exact same thing? | |
Re: You are not getting an error, only a *notice*. That means that there is not necessarily something wrong, it's just something to look at. The notice is probably occurring because of $_GET['erro'] not having been defined before the lines that say `echo $_GET['erro'];`. ![]() | |
Re: You could try using these .htaccess lines: RewriteEngine on Options -Indexes RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule .* index.php [L] Everything will be redirected to index.php. In index.php you can then use PHP to parse the url and take the required actions. E.g. by using `$_SERVER['HTTP_REFERER']` to read the … | |
Re: Just curious: When you say you have no idea do you mean you have no idea at all? As in: I don't know PHP nor MySQL? @Myronz I think you'll need to start your own topic for such a question :). | |
![]() | |
Re: EDIT: My bad wasn't reading correctly. Let me take another look :p. What is the error you are getting? | |
Re: What about a for loop? <?php for($i = 0; $i < count($array_1); $i++) { $record_1 = &$array_1[$i]; // The & creates a reference instead of copying the value. $record_2 = &$array_2[$i]; if($record1 == $record_2) { $record_2 = '000'; } } | |
Re: Haha :). You are right in your second post. function doSomething($value1, $value2 = 'test') { echo $value1 . $value2; } // Will output "hellotest" doSomething('hello'); // Will output "hellohello" doSomething('hello', 'hello'); However, keep in mind that it is RECOMMENDED to place predefined parameters at the end of your function. I … | |
Re: Do you know any PHP at all? Do you maybehave a start on this? What's the situation? :) | |
![]() | Re: I must say I find it prettier if HTML uses the double quotes instead of PHP. E.g. `echo '<a href="link">';` instead of `echo "<a href='link'>";`. But I don't think that's a *must*. Your line 11 contains a small error: `<imgsrc=...`. I would place a space in between the "img" and … |
Re: Have you ever heard of Apache's mod_rewrite and of $_SERVER['HTTP_REFERER']? :) That's the golden combo that is usally used to achieve what I think you want to achieve. Do you have any code yet? Can you be a bit more specific about what your starting point is? | |
Re: What do you do when you want to retrieve data by something other than ID? | |
Re: else if ($part!='user') { $this->url .= "/$part"; $repl = array('_', '...'); $this->breadcrumbs .= " $this->pointer ".'<a class="bc" href="'.$this->url.'">'.strtoupper(str_replace($repl, ' ', $part)).'</a>'; } This appears to skip any $part that is named "user", correct? It seems that there is not another `else { }` part in your script, so from what … | |
Re: Are you asking how you can scroll little by little instead of a complete section at a time? Or the opposite? | |
Re: It queries a MySQL database and, for example, fetches the data you need, or updates it, or deletes it, or creates it. If you need help to start with PHP or MySQL, I guess you'd be better of starting a new topic than asking your questions in this one :). | |
Re: Seems like you forgot a `session_start();` in the script that sends the email? ;) By the way, you don't have to use session_register(), you can just type `$_SESSION['key'] = 'value';` without registering it first. The session_register() function has even been [removed](http://php.net/manual/en/function.session-register.php) from PHP 5.4. | |
Re: shell_exec() states that > Execute command via shell and return the complete output as a string That means that the output should be returned as a string. Are you sure the program you are executing isn't printing anything to the screen? Note sure if that's even possible, I don't use … | |
Re: Maybe you could try this: $("#inputID").ready(function(){ $("#inputID input").focus(function(){ $(this).css("background-color","#fbecc5"); }); $("#inputID input").blur(function(){ $(this).css("background-color","#f5f5f5"); }); $("#inputID textarea").focus(function(){ $(this).css("background-color","#fbecc5"); }); $("#inputID textarea").blur(function(){ $(this).css("background-color","#f5f5f5"); }); }); I've added "#inputID" to all your jQuery selectors, so that only the inputs inside div#inputID are affected. | |
Re: You mean if you include all your classes at once? Of course, that does impact your performance in a way, but it will probably not be significantly in small projects. A question though: why would you include classes that you don't need on every page? | |
Re: > If you put an alias on htaccess file it's like a security blanket Could you explain this? :) And also why a website with more members could use more aliases? @toldav: Did you know that you can read a URI with PHP as well? Try `$_SERVER['REQUEST_URI']`. If you redirect … | |
Re: send_email($fname,$email,$phone,$subject,$message); You are using `$fname` instead of `$name`, that's the first thing I see that might go wrong. And where is the textarea/input in your form with the name "message"? Can it even get set? :o | |
Re: Well, have you checked where `$this->flexi_auth` gets defined? It must get defined somewhere ;). If it is not in the current class, it might be in the current class's parent class. | |
Re: Are you using a form to send the query? How is the request being sent? | |
Re: Hm yes I guess you could. You can place the internal pointer of a file to a specific position using [fseek](http://php.net/manual/en/function.fseek.php)(). However, I've never used it before myself, so I wouldn't know exactly how to use it. What you COULD do is, if you know the exact value of the … | |
Re: Is the $_GET info not already automatically stored in an array? E.g. ?key=value becomes `$_GET['key'] == 'value'` ![]() | |
Re: For as far as I can remember (but I'm not sure), installing Magento goes roughly like this (when using XAMPP). 1. Download XAMPP. 2. Install XAMPP. 3. Put the contents of your Magento folder inside a folder (which you will have to newly create) in your [drive letter]:\xampp\htdocs directory. 4. … | |
Re: I would suggest another code structure: Part 1 is the part where you create the table. You do not have to execute this every time the page is loaded, or even check if this needs to be executed; just create the table once, then remove the code. Part 2 is … | |
Re: Doesn't it work if you just add the following? if($result) { // Results were found. foreach($result as $row) { echo " This Car Belongs to " ; echo "<br />"."<br/>"; echo $row['Fname']." ". $row['Lname']."<br />"; echo $row[ 'RegoNo']. "<br/>"; echo $row['Model']." ". $row['Color']. "<br />" ; echo "<br />"; echo … | |
Re: An idea: Create arrays containing for example a-z or 0-9. Create a function that randomly selects an array key. Then create a loop that executes this function 6-30 times. | |
Re: Hm I don't know CI, but that sounds pretty unlogical to me. If you define the class Page as you are doing now, and if you include that class on every page that needs the navigation that it now contains, then there is no problem, right? As it would then … | |
Re: What about: <?php if($role == 'admin') { ?> ... Your textbox ... <?php } else { // No textbox. } ? | |
Re: That should work.. :\ Are you sure there are over 4 images in your database? | |
Re: `$action = isset($_POST['login']);` What you are doing here is checking if $_POST['login'] has been set. If it has, the value of $action will be `true`; if it hasn't, it will be `false`. Therefore, the `if()` statement a couple of lines ahead will not work as you probably want it to … | |
**The text:** `<form action="ajaxa/login" method="post" class="odf_ajax loading_image_left" data-target="ajax_login_form">` **The regex (to find the form's action):** `$regex = '/<form.+?action="(.+?)"/i';` **The expected result:** `Array (2): [0] => '<form action="ajaxa/login"', [1] => 'ajaxa/login'` **The actual result:** `Array (1): [0] => 'ajaxa/login'` Can anyone help me explain why this regex is not returning the … | |
Re: What about adding something like `WHERE percent > 0` to your statement? :) On a side note: I'm not sure if this is an efficient query. I'm not a MySQL expert, but for as far as my knowledge goes I think this query is executing its subquery a lot of … | |
Re: You have a couple of classes in PHP to read XML. An example is [SimpleXML](http://www.php.net/manual/en/book.simplexml.php). [Here](http://www.w3schools.com/php/php_xml_simplexml.asp)'s a W3Schools tutorial for that class. With it you can iterate through an XML file and while you do that, you can, for example, create a new array which you then traverse later on … |
The End.