2,113 Posted Topics
Re: There is also the **strong** tag inside the href attribute: http://www.famaspain.com/<strong>dogfactstemplate.php</strong>?name=$name Remove it: http://www.famaspain.com/dogfactstemplate.php?name=$name | |
Re: Use `AND` `OR` not comma. The logical operators available for MySQL are these: http://dev.mysql.com/doc/refman/5.0/en/logical-operators.html So your query becomes: $query = "SELECT * FROM customers WHERE firstname = '$firstname' AND lastname = '$lastname'"; | |
Re: Change line 5 and 6: $query = "SELECT * FROM customers WHERE firstname = '$firstname'"; $result = mysql_query($query); | |
Re: In case you want to use a different name, it can also be used an alias: $this->load->model('Model_name', 'admin_user'); $this->admin_user->something(); http://ellislab.com/codeigniter/user-guide/general/models.html#anatomy | |
Re: There is also the zip command: zip my_archive -r directory_to_zip/ will create my_archive.zip | |
Re: Use backticks for table and field names, and quotes only for values as here: $sql ="SELECT * FROM `task_2` WHERE `username` = '$myusername' and `password` = '$mypassword'"; bye! | |
Re: Yup, it's pretty simple: <?php function gravatar($email,$size = 75) { $avatar = md5(strtolower(trim($email))); return '<img class="avatar" src="http://www.gravatar.com/avatar/' .$avatar.'.jpg?d=identicon&s='.$size.'" alt="avatar" />'; } echo gravatar('random@mail.tld'); ?> It returns an image even if there's no registration there. | |
Re: What do you mean with "push back"? | |
![]() | Re: Add `CURLOPT_RETURNTRANSFER`: curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); And try `simplexml_load_string` here: $xml = simplexml_load_file(utf8_encode($xml_url), 'SimpleXMLElement', LIBXML_NOCDATA); bye! ![]() |
Re: Try to change quotes with backticks in the field names of the INSERT statement, as here: $req = "INSERT INTO $tablename(`$tablecol`) VALUES ('$tablecoldat')"; Also, to catch an error use `mysql_error()` at least in this stage: mysql_query($req, $connection) or die(mysql_error()); | |
Re: **@ska** check this: http://sourceforge.net/projects/php-proxy/ **But** if you set a proxy in your website to redirect youtube, you and the other users should also connect to it through a proxy or a VPN, so that authorities cannot trace your activity. Read this as reference: http://en.rsf.org/fighting-cyber-censorship-12-09-2012,43366.html | |
Re: Change this: <?PHP $username = $_POST['username']; print($username); ?> to: <?php if($_SERVER['REQUEST_METHOD'] == 'POST') { $username = $_POST['username']; print($username); } ?> and it should work, bye! | |
Re: Yup, add quotes to **$recover_password**: mysql_query("SELECT COUNT(`user_id`) FROM `users` WHERE `username` = '$username' AND `recover_password` = '$recover_password'") | |
Re: > This function sorts an array. Elements will be arranged from lowest to highest when this function has completed. source: http://php.net/manual/en/function.sort.php | |
Re: Also, if you want to resend passwords then create a new one automatically, or use AES_ENCRYPT / AES_DECRYPT in MySQL, change the password field to text or blob as in this example: CREATE TABLE `users_test` ( `id` int(9) NOT NULL AUTO_INCREMENT, `username` varchar(255) NOT NULL, `password` blob NOT NULL, `password_hash` … | |
Re: @lixamaga it's not safe because a user can disable javascript and submit malicious data, a server side filter, as blocblue suggested, is a necessary requirement. | |
Re: The first problem is `$xx` which is a string: var_dump($xx); # output: string(5) "$_GET" if you want to assign _GET as variable name then use `$$` as: $xx = '$' . $value; var_dump(${$xx}); # output: Notice: Undefined variable: $_GET but as seen, this is not enough, so change it to: … | |
Re: You are missing the `echo` in the first group: <label for="accommodationYes" class="accomm" id="accommY"> <input name="accommodation" type="radio" id="accommodationYes" style="display:none;" value="Yes"<?php echo set_radio('accommodation', 'Yes'); ?>> <span class="custom radio"></span> Yes </label> <label for="accommodationNo" class="accomm" id="accomN"> <input name="accommodation" type="radio" id="accommodationNo" style="display:none;" value="No"<?php echo set_radio('accommodation', 'No'); ?>> <span class="custom radio"></span> No </label> __EDIT__ You don't … | |
Re: Also, since you are querying a specific `mID` and then grouping by the same field, it's correct to get just a row. So try to change the `GROUP BY` clause. Bye! | |
Re: You should get the file list inside the directory to delete, loop ftp_delete() for each and ftp_rmdir() for each subdirectory, but they need to be empty as the main directory to delete. So it's a bit tricky, the functions you need to use are: ftp_delete() ftp_nlist() ftp_rmdir() http://php.net/manual/en/ref.ftp.php You can … | |
Re: You can use GeoIP library, for example: $countrycode = geoip_country_code_by_name($_SERVER['REMOTE_ADDR']); $loc = '/default/contents'; switch($countrycode) { case 'FR': $loc = '/fr/contents'; break; case 'IT': $loc = '/it/contents'; break; case 'US': $loc = '/us/contents'; break; } header('Location: '.$loc); at that point you can also place a cookie to switch automatically each time … | |
Re: Hello, if you are not referring to remote identification then try **php_uname()**: http://php.net/manual/en/function.php-uname.php echo php_uname(); there is also **posix_uname()** which returns the same information into an array format, but I'm not sure if it works on Windows without one of these: http://en.wikipedia.org/wiki/POSIX#POSIX_for_Windows print_r(posix_uname()); but in any case, as LastMitch wrote, … | |
Re: Try: $andy->load_Array(array("andy","bill")); right now you are sending two arguments, otherwise use **func_get_args()**: http://php.net/manual/en/function.func-get-args.php Also instead of `var $element` use private|protected|public: public $element; bye! | |
Re: can you post the output of `explain stock_names`? | |
Re: Have you tried to use **mysqladmin**? mysqladmin -uroot password your_password -h localhost If you are using Windows browse to the directory which contains the tool and add the extension **.exe** to mysqladmin command, it should be something like `cd \Program Files\MySQL\MySQL server5.0\bin` and then: mysqladmin.exe -uroot password your_password -h localhost … | |
Re: You can use cryptsetup: http://code.google.com/p/cryptsetup/ Here there is a tutorial for external drives: https://help.ubuntu.com/community/EncryptedFilesystemsOnRemovableStorage bye! | |
Re: Here there's the example of PHP manual: http://php.net/manual/en/curl.examples-basic.php <?php $ch = curl_init("http://www.example.com/"); $fp = fopen("example_homepage.txt", "w"); curl_setopt($ch, CURLOPT_FILE, $fp); curl_setopt($ch, CURLOPT_HEADER, 0); curl_exec($ch); curl_close($ch); fclose($fp); ?> but you can do the same with [**file_get_contents()**]( http://php.net/manual/en/function.file-get-contents.php) and [**file_put_contents()**](http://php.net/manual/en/function.file-put-contents.php): $url = 'http://www.example.com/'; $page = file_get_contents($page); file_put_contents('example_homepage.txt',$page); | |
Re: It's a bit old but you can download it from here: http://mirrors.fedoraproject.org/publiclist/Fedora/9/ | |
Re: You are missing the `$` sign in front of the variable name, change it to `$username`, bye! | |
Re: In practice you need a web crawler and from that the ability to search contents, there are some ready solutions for these tasks, you can check for Sphider: http://www.sphider.eu/docs.php#commandline Or read here: http://www.daniweb.com/web-development/php/threads/365235/create-a-php-spider bye! | |
Re: Works fine for me, maybe it's the **$dir** variable? As suggestion use `print_r()` on line 11, just before the while loop, to check the **$files** array: print_r($files); | |
Re: Hello, I still didn't tested Laravel but it seems interesting. While searching I've found this blogpost which is enough explanatory, at least in comparison to CI: http://philsturgeon.co.uk/blog/2012/12/5-things-codeigniter-cannot-do-without-a-rewrite A good point is the support for composer packages: http://getcomposer.org/ | |
Re: First this is wrong: if ($sql = $s){ here you are assignin a value, not comparing, to compare use `==` or for boolean `===`, so rewrite it to: if ($sql == $s){ Second, I don't see `$sql` declared anywhere, you will get an error here. Third, you have to extract … | |
Re: Have you read this? https://en.bitcoin.it/wiki/PHP_developer_intro bye. | |
Re: Same problem here. By the way, I don't know if this was already the behave: it seems **Business Exchange** requires log in. | |
Re: If you can, change the **DocumentRoot** in the Apache httpd.conf file or inside the virtual host configuration file: DocumentRoot /var/www/website/abc http://httpd.apache.org/docs/2.2/urlmapping.html#documentroot | |
Re: You can use the function **gethostbyname()**: http://www.php.net/manual/en/function.gethostbyname.php bye! | |
Re: Have you tried **pathinfo()**? http://php.net/manual/en/function.pathinfo.php | |
Re: As already suggested elsewhere change: $db['default']['hostname'] = "//localhost/"; to: $db['default']['hostname'] = "localhost"; bye. | |
Re: This kind of libraries usually are very strict, so if there's something wrong in your HTML then it will break with an error like yours. It will be more useful if you paste here the code of your page. In addition, as suggestion, get the HTML output and try to … ![]() | |
Hello, when I try to enter to the **PHP forum** (but also in the others under **Web Development** section) I get redirected to a malformed url: http://www.daniweb.com-development/php/17 I tried also with curl: curl --head http://www.daniweb.com/web-development/php/17 HTTP/1.1 301 Moved Permanently Date: Tue, 18 Dec 2012 15:31:11 GMT Server: Apache/2.2 Location: http://www.daniweb.com-development/php/17 … ![]() | |
Re: It seems **$FileHash** variable is false or not valid. Echo that and check if the path is correct. | |
Re: Change line 14 in your controller, from this: $data['result'] = $this->user_admin_model->saveItInsInfoByUser($user_id); to this: $data['result'] = $this->user_admin_model->selectItinfoByUserId($user_id); bye! | |
Re: Also consider you can get some collisions with **rand()** and overwrite previously existing files. Add a check for existing files and, in that case, rename the new one again. ![]() | |
Re: I cannot help you much on this but try **COM Library**: http://php.net/manual/en/book.com.php Use this article as reference: http://devzone.zend.com/238/com_dotnet/ | |
Re: It seems you are redirecting to a blocked directory, are you using **.htaccess** file to limit access? | |
Re: It depends on the options you choose: you can use the entire disk, just free space or a specific partition; in any case it's best to backup data before performing an installation. | |
Re: What do you get from the error log? Can you post the site_model code? | |
Re: I'm not sure to understand what you need but you could add a primary key with both fields: alter table staff_info add primary key('fieldA','fieldB'); just make sure these are less than 1000 bytes and not nullable; if the same value combination is submitted the query will fail for duplicate entry. … |
The End.