452 Posted Topics

Member Avatar for Indians

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.

Member Avatar for minitauros
0
729
Member Avatar for ikel

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.

Member Avatar for ikel
0
193
Member Avatar for tqmd1

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..).

Member Avatar for tqmd1
0
79
Member Avatar for Indians

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: …

Member Avatar for minitauros
0
11K
Member Avatar for minitauros

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 …

0
138
Member Avatar for Eagle.Avik

Wasn't working because your "WHERE" got glued right onto the name of your table so it seems :).

Member Avatar for minitauros
0
560
Member Avatar for annyangel

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).

Member Avatar for annyangel
0
387
Member Avatar for suresh.govindula
Member Avatar for ryantroop
0
153
Member Avatar for simplypixie

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 …

Member Avatar for simplypixie
0
270
Member Avatar for pawan768

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 …

Member Avatar for pawan768
0
167
Member Avatar for everton.retweets

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);`

Member Avatar for minitauros
0
362
Member Avatar for everton.retweets

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 = …

Member Avatar for everton.retweets
0
260
Member Avatar for dannybarh

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 …

Member Avatar for diafol
0
192
Member Avatar for Sandra_1

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 …

Member Avatar for diafol
0
130
Member Avatar for karthik_ppts

So CURLINFO_HTTP_CODE and CURLINFO_EFFECTIVE_URL are returning the exact same thing?

Member Avatar for karthik_ppts
0
323
Member Avatar for PF2G

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'];`.

Member Avatar for LastMitch
0
188
Member Avatar for gogs85

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 …

Member Avatar for veedeoo
0
4K
Member Avatar for Rishav_1

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 :).

Member Avatar for ehpratah
0
143
Member Avatar for blueguy777
Member Avatar for tibor.marias

EDIT: My bad wasn't reading correctly. Let me take another look :p. What is the error you are getting?

Member Avatar for tibor.marias
0
149
Member Avatar for blueguy777

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'; } }

Member Avatar for blueguy777
0
243
Member Avatar for mmcdonald

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 …

Member Avatar for mmcdonald
0
174
Member Avatar for gurupts
Member Avatar for tpunt
0
305
Member Avatar for JazzibAli

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 …

Member Avatar for minitauros
-1
367
Member Avatar for gogs85

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?

Member Avatar for JorgeM
0
266
Member Avatar for pritaeas

What do you do when you want to retrieve data by something other than ID?

Member Avatar for pritaeas
1
332
Member Avatar for andreiviziru

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 …

Member Avatar for minitauros
0
185
Member Avatar for darkofpain

Are you asking how you can scroll little by little instead of a complete section at a time? Or the opposite?

Member Avatar for darkofpain
0
473
Member Avatar for ShadyTyrant

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 :).

Member Avatar for ShadyTyrant
0
217
Member Avatar for eltonpiko

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.

Member Avatar for minitauros
0
321
Member Avatar for pawan768

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 …

Member Avatar for minitauros
0
246
Member Avatar for davy_yg

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.

Member Avatar for davy_yg
0
226
Member Avatar for PerplexedB

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?

Member Avatar for PerplexedB
0
344
Member Avatar for toldav

> 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 …

Member Avatar for minitauros
0
295
Member Avatar for yachile

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

Member Avatar for minitauros
0
344
Member Avatar for renierdbruyn

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.

Member Avatar for minitauros
0
205
Member Avatar for sudhakrish
Member Avatar for sudhakrish
0
220
Member Avatar for websponge

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 …

Member Avatar for minitauros
0
201
Member Avatar for boney

Is the $_GET info not already automatically stored in an array? E.g. ?key=value becomes `$_GET['key'] == 'value'`

Member Avatar for diafol
0
181
Member Avatar for ManzarOx

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. …

Member Avatar for minitauros
0
484
Member Avatar for rohan.verma.52012

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 …

Member Avatar for minitauros
0
268
Member Avatar for titos97

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 …

Member Avatar for minitauros
0
381
Member Avatar for pssubash

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.

Member Avatar for minitauros
0
138
Member Avatar for davy_yg

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 …

Member Avatar for Dani
0
337
Member Avatar for shrikanthnk

What about: <?php if($role == 'admin') { ?> ... Your textbox ... <?php } else { // No textbox. } ?

Member Avatar for minitauros
0
163
Member Avatar for branding4you

That should work.. :\ Are you sure there are over 4 images in your database?

Member Avatar for minitauros
0
659
Member Avatar for Hassan_5

`$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 …

Member Avatar for minitauros
0
264
Member Avatar for minitauros

**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 …

Member Avatar for minitauros
0
152
Member Avatar for ourloop

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 …

Member Avatar for minitauros
0
185
Member Avatar for MWEB

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 …

Member Avatar for minitauros
0
161

The End.