Jump to content


  • Content Count

  • 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. //my php code sample <?php include_once('con.php'); if(isset($_POST['username'])){ $message = []; if(empty($_POST['username'])){ $message['username'] = 'username required'; } #some validation continue... $data = $_POST['username']; if (count($errors) === 0){ #ccode... $message['username'] = 'success your name saved'; } } ?> //my jquery ajax $('.username').click(function() { $.ajax({ url: 'user.php', method: 'POST', data: $('.user').serialize(), success: function(data) { swal('Wow!','success message from php','success'); }, error: function(data) { swal('Oops!','error message from php','error'); } }); return false; });
  2. what if user click the link by tomorrow at the same time
  3. how to calculate the difference between the current datetime from the stored one(ie date_field = 2020-08-09 23:13:06) in order to compare with 15min, i mean if the resulted time exceed 15 min and not the same day(date) the provided link will show expire message. i.e $some_variable = $date_in_db - current_date; if((time() - $some_variable > 15*60) && not the same day or the same day){ echo 'the link has expired'; }
  4. yes how? if you don't understand what do i mean, look on the textarea input, when i type some data in list format they are going to be saved in single column but i cant retrieve them as list but a single paragraph. why?
  5. But i have this question why I get undefined variable, when the field in mysql database is set to null value/type.
  6. thank you guys, it is working, i added alias on each table column and using if condition to detect if the data come from first table redirect to first page else second page
  7. My query look like this SELECT pr_id, pr_name FROM pr WHERE pr_name LIKE :q UNION SELECT pt_id, pt_name FROM pt WHERE pt_name LIKE :q The problem is when we search it combine all pr_id and pt_id in a single column and all I'd can be retrieved by using pr_id. So when user click the link which carry pt_id it redirect to the page with pr_id details. Help
  8. I have two table in my database combined by using UNION, when it come to searching via search form, all data are retrieved as expected, but the problem come when i click the link that has the data from second table it redirecting to the page with first table details. Assume i have retrieved data using while loop and the UNION. while($search = $query->fetch()) {?> <div> <a href="pageone.php?po=<?php echo $search['pr_id'];?>">Read More...</a> </div> <?php }?> //the result become <a href="pageone.php?po=1">Read More...</a> <a href="pageone.php?pt=3">Read More...</a> //But what if data come from both first and second table in a database, i want the link become to be as <a href="pageone.php?po=1">Read More...</a> <a href="pagetwo.php?pt=3">Read More...</a> // any idea please
  9. How can I instruct user with normal php, Since normal php depend on form submission while the plugin help and instruct user to fill correct data
  10. How can I add parsley attributes /rules in custom.js file instead of adding them in form field I have <form id="register"> <input type="email" name="email" id="email"> </form> //Js $("#register"). parsley ( //How to write all validation here not inside the input element. );
  11. I'm facing trouble on check box when register form is submitted without check the check button, but when the button is checked the error disappear . can you give me idea why and how to solve this issue. I saw many sites with such kind of button on registration form please any one who can solve this.
  12. Check here If(empty($username){ echo ' user name is required'; } At the same time We have written a jQuery that prompt the message 'user name is required' if he/she submit an empty value. Here all warning message will be printed at the same time, and it is going to be a bad idea since we have two messages at the same time. So how to handle this?!
  • 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.