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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T23:38:30+00:00 2026-05-23T23:38:30+00:00

I have a jsfiddle and have edited it to include sessions for passing values

  • 0

I have a jsfiddle and have edited it to include sessions for passing values that the user inputs. Currently it does regex checking for phone numbers and parses the value in textbox into an array.
It uses localStorage to save the numbers in the list..

http://jsfiddle.net/y8Uju/17/

Currently it takes numbers into that textbox and adds them to the list. What I want to do is I want name and number to all be in that one textbox and both to be added into the list together WITH error checking. Now the real problem is that once the array passes the list over once you hit submit, I want to read those array values all into a textfile line by line for each array item.

So for example,
if a user enters 903456346346 kergfer kerger, due to the invalid number it should give error and tell them to redo…

but if their lists looks like:
2195679876 John Polski (array item 1)
2195395676 Cara Polski (array item 2)
2195679346 Jennifer Ray (array item 3)
2195456756 Matt Hardy (array item 4)

then they submit, it should make the textfile look like this:
2195679876 John Polski
2195395676 Cara Polski
2195679346 Jennifer Ray
2195456756 Matt Hardy

I know how to put all the text in a file into one line but thats not how I want it. I want it sorted like the above. I would really liek to use a db for this but I have never used one and they seem kind of complicated…Any tutorial I found starts off with prior knowledge of command-line so I am stuck and decided to either use sessions with session life set to 4 years OR use plain ol text file. The below is what I have and it puts everything into one line..

$myFile = "testFile.txt";
$fh = fopen($myFile, 'r');
$theData = fread($fh, filesize($myFile));
fclose($fh);
echo $theData;
  • 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-23T23:38:31+00:00Added an answer on May 23, 2026 at 11:38 pm

    You could very easily use fgetcsv() and fputcsv() to save the data into a .csv file. If you don’t want to use a database. It would be structured, have one entry per line and still be readable.

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

Sidebar

Related Questions

I have the following jsfiddle setup: http://jsfiddle.net/zZDqH/ Currently it is just a button that
Please see this jsFiddle: https://jsfiddle.net/Wmq6f/ I have a textarea that has a background image,
I'm using Anything slider (https://github.com/ProLoser/AnythingSlider/wiki) and I have edited it so that the visitor
I have a JSFiddle up and running that displays what I'm trying to accomplish:
I have this form: http://jsfiddle.net/michelejs/Pt6LQ/ The problem is that I am not be able
I have a jsfiddle that demonstrates the problem at: http://jsfiddle.net/michaelajohnsonwa/sDchM/7/ The generated dropdown elements
I have a jsfiddle where the user opens a grid and selects an option,
I have a jsFiddle set up here that i want to work on future
I have this script: http://jsfiddle.net/NV2uV/ It works, but I do not like it. Cons:
I have the following code: http://jsfiddle.net/SPWWx/ I'm completely new to javascript, this is my

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.