Jump to content

mahenda

Members
  • Content Count

    81
  • Joined

  • Last visited

Community Reputation

0 Neutral

About mahenda

  • Rank
    Regular Member

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Thanks you guys I solved the problem. It was the view part not a PHP code
  2. Here the data is sent in a database but the echo '<span>Hi '.$name.'</b>,subscription is now active.</span>'; doesn't work. In else statement
  3. All queries are inserted successfully but why this statement is not showing on page to tell user about subscription is sent successfully This one echo '<span>Hi '.$name.'</b>,subscription is now active.</span>';
  4. The first echo after The echo after the above code is show and it is okey but the problem is there on the echo after insertion of data the echo doesn't show the given success message on the page
  5. <?php global $con; $name = $_GET['name']; $email = $_GET['email']; if((!empty($name)) && (!empty($email))){ $check = $con->prepare('SELECT email FROM subs WHERE email = ?'); $check->execute([$email]); $row = $check->fetch(); if($email == $row['email']){ echo '<span>'.$email.' already in database, try another email!.</span>'; }else{ $subscribe = $con->prepare('INSERT INTO subs (name, email) VALUES (?, ?)'); $subscribe->execute([$name, $email]); if($subscribe){ echo '<span>Hi '.$name.'</b>,subscription is now active.</span>'; }else{ echo '<span>Try again</span>'; } } }else{ echo '<span>please enter something</span>'; } ?> the problem found at if($subscribe){ //the echo not showing the span element when data is inserted } any help please?
  6. 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
  7. 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
  8. 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
  9. 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
  10. 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>
  11. 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
  12. 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?!
  13. 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 ?
×
×
  • 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.