Jump to content


  • Content Count

  • Joined

  • Last visited

Everything posted by mahenda

  1. no i dont want this /article/this-is-new-product to /article?title=this-is-new-product i want this /article?title=this%20is%20new%20product to be /article/this-is-new-product check here RewriteRule ^([a-zA-Z0-9]+)$ article.php?title=$1 RewriteRule ^([a-zA-Z0-9]+)/$ article.php?title=$1
  2. i dont have that, but i have the link like below if you have an example of an .htaccess to make a clean url please help me. //the title <div class="title"> <a href="<?php echo 'article? title='.$title['title'];?>" ><?php echo $title['title'];?></a> </div> which produce this after being clicked http://localhost/mysite/article?title=this is new%20product but i want to get this http://localhost/mysite/article/this-is-new-product if i try to use str_replace then there is no result shown after clicking the link
  3. One sure-fire way to get people to not help you is to tag them and plead for their help. What RewriteRule have you tried to do this? "Can't" do that with just mod_rewrite. The problem is that you want to replace spaces with hyphens. What you can do is rewrite /article/this-is-new-product to /article?title=this-is-new-product. So first make your article.php support that. When that's ready, What RewriteRule have you tried to do this? check on the htacess above
  4. i want to change the link looking like http://localhost/mysite/product?name=trouser to http://localhost/mysite/product/trouser and this one below http://localhost/mysite/article?title=this%20is%20 new%20product to http://localhost/mysite/article/this-is-new-product help me please because when i use a str_replace it work but noresult is displayed .htaccess RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME}\.php -f RewriteRule ^(.*)$ $1.php [NC,L] php_flag register_globals 0 php_flag magic_quotes_gpc 0 php_flag magic_quotes_runtime 0
  5. very helpful thanks but what if i want to change the SELECT * FROM posts WHERE title LIKE :search to SELECT * FROM posts WHERE title LIKE :search OR author LIKE :search; and want to get both by using single list like <li class="result" onClick="searchValue('<?php echo $row['some value here'];?>')"><?php echo $row['some value here'];?></li> here the result on search will be //title will display on key up //author will display on key up instead of <li class="result" onClick="searchValue('<?php echo $row['title'];?>')"><?php echo $row['title'];?></li> <li class="result" onClick="searchValue('<?php echo $row['author'];?>')"><?php echo $row['author'];?></li>
  6. http://localhost/mysite/index.php to http://localhost/mysite/ http://localhost/mysite/about.php to http://localhost/mysite/about/ i'm using htaccess file and i;m able to get this one here http://localhost/mysite/about where is"/"? also how to change this one here http://localhost/mysite/page?id=2 to http://localhost/mysite/page/2 help .htaccess RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME}\.php -f RewriteRule ^(.*)$ $1.php [NC,L] php_flag register_globals 0 php_flag magic_quotes_gpc 0 php_flag magic_quotes_runtime 0
  7. Oh! If I'll remove onclick function which is there for getting value after clicking , isnt possible to get such value in in input using jQuery if yes why and how?!
  8. let me return back again is saw something like localhost/maembe/product.php?product_id/2 or this localhost/maembe/product.php?product/hot-coffee-found-here when i click on the home link but i have no idea on how to do that my own is localhost/maembe/product.php?product_title = hot-coffee-found-here i dont want that '=' sign if i'll use preg_replace() will be collect isn't it or anyway ?
  9. thank you so much but why no bindParam()
  10. style="text-decoration:none;"
  11. //php code <?php include_once('con.php'); if(!empty($_GET['search'])) { $search = $connect->prepare('SELECT * FROM posts WHERE title LIKE :search'); $search->bindValue(':search', '%'.$_GET['search'].'%', PDO::PARAM_STR); $search->execute(); ?> <?php while($row = $search->fetch()) {?> <li class="result" onClick="searchValue('<?php echo $row['title'];?>')"><?php echo $row['title'];?></li> <?php } ?> <?php } ?> //ajax $('#inputsch').keyup(function(){ $.ajax({ type: 'GET', url: 'fetch.php', data:'search='+$(this).val(), success: function(data){ $('#box').show(); $('#box').html(data); } }); }); }); function searchValue(val) { $('#inputsch').val(val); $('#box').hide(); } //search box <form action="search.php"> <input id="inputsch" type="text" name="search" placeholder="search..." autocomplete="off" autofocus> <button type="submit" value="search" >search</button> </form> <div id="box"></div> //the problem here is when i click the result is only added to input, but i want it to autosubmit
  12. every user can see, even if he/she did not logged in
  13. $prepare = $connect->prepare($product_details); $prepare->execute(); $row = $prepare->fetch();
  14. i shortened the code assume all variable are available
  15. when user click the link with product picture, the link will open new page called product.php with product full detail from database in the product page the query accepted with get method $product_details = "SELECT * FROM product WHERE product_id=".$_GET['product_id'];
  16. //link to the product <a href="<?php echo 'product.php?product_id='. $row['product_id'];?>"style="text-decortion:none;"> //on the product page, the url look like this localhost/maembe/product.php?product_id=2 what will happen when attacker see this id and how to change it
  17. here my sample code <form> <input id="query" type="text" name="query" placeholder="search here..." autocomplete="off"> <button type="submit" value="query" >search</button> <div class="sugbx"></div> </form> //php code, assume we already run a whole php code ...... <ul class="list-group list-unstyled" style="cursor:pointer; color: #191919; position:absolute; top:12px;"> <?php foreach($query as $movie) { ?> <li class="list-group-item" onClick="searchValue('<?php echo $movie["movie_name"]; ?>'),;"><?php echo $movie["movie_name"]; ?></li> <?php } ?> </ul> <?php } ?> //ajax here $('#search').keyup(function(){ $.ajax({ type: 'GET', url: 'phpcode.php', data:'query='+$(this).val(), success: function(data){ $('.sugbx').show(); $('.sugbx').html(data); } }); }); function searchValue(val) { $('#query').val(val); $('.sugbx').hide(); } //ajax the input accept the value only after selecting one of the listed value on the suggesstion box and then i have to click the submit button the problem is, how to submit the value accepted when a list is clicked
  18. here my header to be included in different pages such as home.blade what is wrong, because i'm getting error undefined variable t_page_title //header file <!doctype html> <html xmlns="http://www.w3.org/1999/xhtml"/> <head> <title><?php echo $t_page_title; ?></title> </head> <body> //home.blade file <?php $t_page_title = 'This is page title';?> @include('repeated.header')
  19. so it means this is secure check what is happen when i'm trying searching http://localhost/member_app/results?page=1&search=mahenda i'm doubt with the number of page why is visible and how to hide them
  20. $keyword = $_GET['search']; $search = $con->prepare("SELECT * FROM members WHERE name LIKE :keywword"); $search->bindValue(':keyword', '%' . $keyword . '%', PDO::PARAM_STR); $search->execute(); or $keyword = mysqli_real_escape_string($con, $_GET['search']); ........ which is better for securing search input and why uri is http://localhost/member_app/results?search=<script>alert('hi')<%2Fscript> after submission
  • 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.