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 4018740
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T10:01:13+00:00 2026-05-20T10:01:13+00:00

I use this script which submits links into a text file. The only problem

  • 0

I use this script which submits links into a text file. The only problem is, I need the form to post dynamically on the same page. Any ideas on how this can be done? What I’m using:
To post:

<form method="POST" action="addlink.php">
Link: <input type="text name="link">
<input type="submit" name="submit">
</form>

addlink.php:

<?
$link = $_POST['link']; 
$fn = 'textfile.txt'; 
$fp = fopen($fn, "a+");
$write = fputs($fp, $link."<br>");
fclose($fp);
?>

The call:

<?
$fn = 'textfile.txt';
$fp = fopen($fn, "r+");
$info = fread($fp,filesize($fn));
fclose($fp);
echo $info;
?>

Also any ideas on how I could make the script wait to publish the links so I can approve/delete them? I was thinking about MySQL but I’m not very great at writing DB’s. I also have the jQuery lib.

  • 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-05-20T10:01:13+00:00Added an answer on May 20, 2026 at 10:01 am

    Check out jQuery’s post() API: http://api.jquery.com/jQuery.post/

    jQuery makes it fairly straightforward to use AJAX on a form submission. I think you simply do exactly what you’re doing now, but behind the scenes with AJAX, then, if it is successful, just send back some text that will let you know that it worked.

    As far as the approval/denial of links goes, I would just, as you were thinking, set up a MySQL database table with at least the following fields: id, link, approved. Let us know exactly what else you need help with. If there are more specific questions that you have.

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

Sidebar

Related Questions

I have this .bat script which I use to maven package my application. Problem
I use this tool called Lazy C++ which breaks a single C++ .lzz file
I've got this script for calculating square area, which works perfect: <script language=javascript type=text/javascript>
I'm puzzled with this test script: #!perl use strict; use warnings; use encoding 'utf8';
This question is simple. What function would I use in a PHP script to
I use this line in my .htaccess file to automatically add a trailing slash
I wrote this script awhile back and have modified it to use css sprites
When my page is loaded I execute the following JS script, which I use
I have a basic html form which I want to use with two submit
I am converting a linux script from http://www.perlmonks.org/index.pl?node_id=217166 specifically this: #!/usr/bin/perl -w use strict;

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.