Jump to content

colap

Members
  • Content Count

    300
  • Joined

  • Last visited

Community Reputation

0 Neutral

About colap

  • Rank
    Advanced Member

Profile Information

  • Gender
    Male
  1. Do you suggest to use any php framework instead of raw/regular php? like zendframework?
  2. How can I update record in database for a specific tab of page loading? It's addform.php. there is a form to upload image through ajax into tmp_images table. this table has id,user_id,imagepath,post_id. post_id is irrelevant here. Everytime it inserts data with post_id=-1. What I tried at top of addform.php: $user_id = $_SESSION['id']; $dbh = getDbconn(); $stmt=$dbh->prepare("update tmp_images set mark=0 where user_id=:user_id and post_id=-1"); $stmt->bindParam(':user_id',$user_id); $stmt->execute(); this updates all records for that user when the page loads/reloads/refreshes, problem is: if there are multiple 'addform.php' openned and multiple images have been uploaded by same user in different tabs, then if I refresh one tab it updates all records uploaded in different tabs too.
  3. function updateTable($dbh, $table, $columns, $val, $conditions) { $set=""; for($i=0;$i<count($columns);$i++) { $t=$columns[$i] . "=:" . $columns[$i]; $set=$set . $t; if($i!=count($columns)-1) $set=$set . ","; } $cond=$conditions; $akeys=array_keys($conditions); $last_key=end($akeys); $where=""; foreach($conditions as $k=>$v) { $where=$where . "$k=:$k"; if($k != $last_key) $where=$where . " and "; } $sql="update $table set $set where $where"; $stmt=$dbh->prepare($sql); for($i=0;$i<count($columns);$i++) { $stmt->bindParam(":$columns[$i]",$val[$i]); } foreach($conditions as $k=>$v) { $stmt->bindParam(":$k",$v); } //exit; $stmt->execute(); $stmt=null; } updateTable($dbh, "wd", ["sentence","meaning"], [$sentence,$meaning], ["word"=>$wd,"id"=>"1"]); It's not updating table row and it's not showing any error too. Why is this? But updateTable($dbh, "wd", ["sentence","meaning"], [$sentence,$meaning], ["word"=>$wd,"id"=>"1"]); this works.
  4. What's wrong using php-captcha? Is it very easy to hack/break php-captcha?
  5. I wanted the phpcaptcha in this format: <div id='captcha_container_1'> <table> <tr> <td>Secure Image:</td> <td>that-securimage</td> </tr> <tr> <td>Type text:</td> <td>the-text-box</td> </tr> </table> </div> <div id='captcha_container_1'> <table> <tr> <td>Secure Image:</td> <td></td> </tr> <tr> <td>Type text:</td> <td><?php echo Securimage::getCaptchaHtml($options); ?></td> </tr> </table> </div> Output: http://imgur.com/a/e8vF8 Securimage::getCaptchaHtml($options); creates layout automatically.
  6. What does the obfuscator do? If someone gets the code, then he can easily run(steal) the website. Answer is: Protecting from other users, I didn't sell the code to, so that they can't run the website without buying that.
  7. If I don't give them the code, then how will they run the website?
  8. Suppose the code is given/sold to someone. Then he can give this code to someone else too. Then the 2nd person can also give it to 3rd person and so on. So everyone from person 1 to 3 can use the same code. Everyone has the source code. In c,c++ executable, we can't get the original source code. How can we hide/protect php code from others so that they can't use it?
  9. I tried this in .htaccess: RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule "^(.+)" "/" It works when the url looks like "http://localhost/project/xyz" , it redirects to "http://localhost/project/". But the url can be "http://localhost/project/xyz?id=5&t=abc", then it redirects to index page but the parameter is still there in url "http://localhost/project/?id=5&t=abc" , how can I remove all those parameters after redirecting to index page?
  10. See the informations about me at left side of the post. Why is this? We can't read this. Also the phpfreaks logo is in reverse order at top left.
  11. 1) Can we use any router library to avoid apache configuration? I don't want to touch apache configuration files. 2) If I must edit apache configuration, what are those rules to edit? 3) Or can we just edit apache configuration and avoid using php router library(vice-versa)? 4) Or should we need to use a php router library and edit apache configuration file(both needed)?
  12. How would php website know /10/abcd is index.php?id=10&title=abcd ? How would php know if the parameters are id and title or something else?
  13. But when we use any php framework we don't configure or change anything in apache. But the url looks like http://myproject.com/10/abcd . How do php frameowrks do that? https://laravel.com/docs/5.0/configuration#pretty-urls , Also I copied these in .htaccess and put this .htaccess in myproject/ root directory, rewrite module is enabled, then tried http://localhost/myproject/list/a , but it doesn't work. Options +FollowSymLinks RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^ index.php [L] apache2.conf => <Directory /var/www/> Options Indexes FollowSymLinks Options +SymLinksIfOwnerMatch AllowOverride All Require all granted </Directory> http://localhost/myproject/list.php?id=a works.
  14. https://www.phpcaptcha.org/documentation/quickstart-guide/ This is to add secure image and refresh image. <img id="captcha" src="/securimage/securimage_show.php" alt="CAPTCHA Image" /> <input type="text" name="captcha_code" size="10" maxlength="6" /> <a href="#" onclick="document.getElementById('captcha').src = '/securimage/securimage_show.php?' + Math.random(); return false">[ Different Image ]</a> How can I add the audio icon? Like this: https://www.phpcaptcha.org/try-securimage/
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.