Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7924665
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T17:51:58+00:00 2026-06-03T17:51:58+00:00

http://pastebin.com/dttyN3L6 The file that processes the form is called upload.php I have never really

  • 0

http://pastebin.com/dttyN3L6

The file that processes the form is called upload.php

I have never really used jquery/js so I am unsure how I would do this or where I would put the code.

It has something to do with this setInterval (loadLog, 2500);

Also, how can I make it so the user can submit a form without the page refreshing?

 $.ajax({  
  type: "POST",  
  url: "upload.php",  
  data: dataString,  
  success: function() {  

  }  
});  
return false;  `

and

 <?php 
 $conn1 = mysqli_connect('xxx') or die('Error connecting to MySQL server.');
 $sql = "SELECT * from text ORDER BY id DESC LIMIT 1";
 $result = mysqli_query($conn1, $sql) or die('Error querying database.');
 while ($row = mysqli_fetch_array($result)) {
      echo  '<p>' . $row['words'] . '</p>';
 }
 mysqli_close($conn1);

 ?>

 </div>

 <?php     
 if (!isset($_SESSION["user_id"])) {

 } else {
      require_once('form.php'); 
 }

 ?>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T17:52:00+00:00Added an answer on June 3, 2026 at 5:52 pm

    You can submit a form without refreshing a page something like this:

    form.php:

    <form action='profile.php' method='post' class='ajaxform'>
     <input type='text' name='txt' value='Test Text'>
     <input type='submit' value='submit'>
    </form>
    
    <div id='result'>Result comes here..</div>
    

    profile.php:

    <?php
          // All form data is in $_POST
    
          // Now perform actions on form data here and 
          // create an result array something like this
          $arr = array( 'result' => 'This is my result' );
          echo json_encode( $arr );
    ?>
    

    jQuery:

    jQuery(document).ready(function(){
    
        jQuery('.ajaxform').submit( function() {
    
            $.ajax({
                url     : $(this).attr('action'),
                type    : $(this).attr('method'),
                dataType: 'json',
                data    : $(this).serialize(),
                success : function( data ) {
                            // loop to set the result(value)
                            // in required div(key)
                            for(var id in data) {
                                jQuery('#' + id).html( data[id] );
                            }
                          }
            });
    
            return false;
        });
    
    });
    

    And If you want to call an ajax request without refreshing page after a particular time, you can try something like this:

    var timer, delay = 300000;
    
    timer = setInterval(function(){
        $.ajax({
          type    : 'POST',
          url     : 'profile.php',
          dataType: 'json',
          data    : $('.ajaxform').serialize(),
          success : function(data){
                      for(var id in data) {
                        jQuery('#' + id).html( data[id] );
                      }
                    }
        });
    }, delay);
    

    And you can stop the timer at any time like this:

    clearInterval( timer );
    

    Hope this will give you a direction to complete your task.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

HTML/JS Here: http://pastebin.com/JrtfeAtw PHP Here: http://pastebin.com/EcRHCwmY Based on Ajax F1's tutorial here: www.ajaxf1.com/tutorial/ajax-file-upload-tutorial.html Anyway,
I have a table called informations (http://pastebin.com/h3UiUhpx) and also have this associated tables educations,
I have the following inequalities on 21 variables: http://pastebin.com/raw.php?i=FTU970Em When I run Reduce[ineq,Integers] on
http://pastebin.com/bnMaxjep http://www.vidyasocks.com/index.php See the ticker at the bottom, I want to update that so
Edit: http://pastebin.com/W4iG3tjS - the file I have a text file encoded in utf8 with
http://pastebin.com/mYk8M038 here is what I have so far... I think it may be something
I have this code: http://pastebin.com/Sd9WKZFr When i call something like rate(60, -6000, 120000) it
When I run my program core.py ( http://pastebin.com/kbzbBUYd ) it returns: File core.py, line
please see: http://pastebin.com/5za3uCi1 I'm quite new to php and I'm editing the ventrilo status
I have a piece of html/javascript written in jQuery at http://pastebin.com/MzMPjtvF My issue is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.