# Form data fetch problem

**URL:** <https://forum.infinityfree.com/t/form-data-fetch-problem/82364>\
**Category:** Hosting Support\
**Created:** [September 8, 2023, 6:50am UTC](https://forum.infinityfree.com/t/form-data-fetch-problem/82364 "2023-09-08T06:50:42Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Washimul](https://forum.infinityfree.com/letter_avatar/washimul/32/5_5575768a8748004e209b776fc1b2916d.png) [@Washimul](https://forum.infinityfree.com/u/Washimul)\
**Post date:** [September 8, 2023, 6:50am UTC](https://forum.infinityfree.com/t/form-data-fetch-problem/82364/1 "2023-09-08T06:50:43Z")

</div>

### ([https://imwashimul.rf.gd/](https://imwashimul.rf.gd/))

I used node.js and connected with SQL database, but when I submitted the form it continuously error to saving form

```auto
 const response = await fetch("https://imwashimul.rf.gd/submit-form", { (Failed to load resource: the server responded with a status of 404 ()
        console.error("Error saving form-data"); (Error saving form data)
HTML form - 
<form action="/submit-form" method="post" style="font-size: 12px;">
server.js
app.post('/submit-form', (req, res) => {
  const formData = req.body;
  const sql = 'INSERT INTO feedbackform (name, email, contactNumber, feedbackText, createdAt) VALUES (?, ?, ?, ?, NOW())';

  connection.query(sql, [formData.name, formData.email, formData.contactNumber, formData.feedbackText], (err, result) => {
    if (err) {
      console.error('Error saving form data:', err); // Log the actual error message
      res.status(500).send('Internal Server Error');
    } else {
      console.log('Form data saved successfully');
      res.status(200).send('Form data saved successfully');
    }
  });
});

```

### Error Message

script.js:31 Error saving Form data  
(anonymous) @ script.js:31

### Other Information

please help me, I would be grateful.

---

<div class="post-metadata">

**Author:** ![anon42008019](https://forum.infinityfree.com/letter_avatar/anon42008019/32/5_5575768a8748004e209b776fc1b2916d.png) [@anon42008019](https://forum.infinityfree.com/u/anon42008019)\
**Post date:** [September 8, 2023, 7:21am UTC](https://forum.infinityfree.com/t/form-data-fetch-problem/82364/2 "2023-09-08T07:21:17Z")

</div>

This hosting only supports PHP as the backend language, how are you even using node.js?

---

<div class="post-metadata">

**Author:** ![Washimul](https://forum.infinityfree.com/letter_avatar/washimul/32/5_5575768a8748004e209b776fc1b2916d.png) [@Washimul](https://forum.infinityfree.com/u/Washimul)\
**Post date:** [September 8, 2023, 9:02am UTC](https://forum.infinityfree.com/t/form-data-fetch-problem/82364/3 "2023-09-08T09:02:40Z")

</div>

already no web is running, except the form, data

---

<div class="post-metadata">

**Author:** ![Washimul](https://forum.infinityfree.com/letter_avatar/washimul/32/5_5575768a8748004e209b776fc1b2916d.png) [@Washimul](https://forum.infinityfree.com/u/Washimul)\
**Post date:** [September 8, 2023, 9:03am UTC](https://forum.infinityfree.com/t/form-data-fetch-problem/82364/4 "2023-09-08T09:03:10Z")

</div>

> [@Washimul](#):
>
> already my web is running, except the form, data

already my web is running, except the form, data

---

<div class="post-metadata">

**Author:** ![anon42008019](https://forum.infinityfree.com/letter_avatar/anon42008019/32/5_5575768a8748004e209b776fc1b2916d.png) [@anon42008019](https://forum.infinityfree.com/u/anon42008019)\
**Post date:** [September 8, 2023, 9:19am UTC](https://forum.infinityfree.com/t/form-data-fetch-problem/82364/5 "2023-09-08T09:19:03Z")

</div>

You did not answer my question.

---

<div class="post-metadata">

**Author:** ![Washimul](https://forum.infinityfree.com/letter_avatar/washimul/32/5_5575768a8748004e209b776fc1b2916d.png) [@Washimul](https://forum.infinityfree.com/u/Washimul)\
**Post date:** [September 8, 2023, 11:10am UTC](https://forum.infinityfree.com/t/form-data-fetch-problem/82364/6 "2023-09-08T11:10:42Z")

</div>

So I can not do with node.js

---

<div class="post-metadata">

**Author:** ![anon42008019](https://forum.infinityfree.com/letter_avatar/anon42008019/32/5_5575768a8748004e209b776fc1b2916d.png) [@anon42008019](https://forum.infinityfree.com/u/anon42008019)\
**Post date:** [September 8, 2023, 11:11am UTC](https://forum.infinityfree.com/t/form-data-fetch-problem/82364/7 "2023-09-08T11:11:23Z")

</div>

You cannot use Node.js on Infinityfree, unsure where you are even hosting it.

---

<div class="post-metadata">

**Author:** ![Washimul](https://forum.infinityfree.com/letter_avatar/washimul/32/5_5575768a8748004e209b776fc1b2916d.png) [@Washimul](https://forum.infinityfree.com/u/Washimul)\
**Post date:** [September 8, 2023, 11:22am UTC](https://forum.infinityfree.com/t/form-data-fetch-problem/82364/8 "2023-09-08T11:22:54Z")

</div>

You see my domain, I customized my site frontend using - js, jquery, and designs for bootstrap,  
for backend inlocalhost is used , node.js, and alos deployed this mean just uploaded on the infinity directory, however i noticed that, node.js commands are not working, thats, why I asked.

---

<div class="post-metadata">

**Author:** ![anon90933456](https://forum.infinityfree.com/letter_avatar/anon90933456/32/5_5575768a8748004e209b776fc1b2916d.png) [@anon90933456](https://forum.infinityfree.com/u/anon90933456)\
**Post date:** [September 8, 2023, 11:40am UTC](https://forum.infinityfree.com/t/form-data-fetch-problem/82364/9 "2023-09-08T11:40:31Z")

</div>

I’m not gonna repeat it again: hosting Node.js apps is not a thing on free hosting. You can consider writing your backend in PHP instead, or use a service like Replit to host your Node.js app, but take note that MySQL remote access is not available on free hosting:

> [@Connecting to MySQL from an external application](https://forum.infinityfree.com/docs?topic=49339):
>
> Sometimes, you may want to connect to your MySQL database on your free hosting account using external software, like a desktop database manager (like MySQL Workbench) or an external program you wrote yourself (like an Android or iOS app). You cannot connect to a free hosting MySQL database from outside your hosting account. You can only interact with your free hosting database through PHP scripts uploaded to your free hosting account, or through our phpMyAdmin installation. The ability to con…

---

<div class="post-metadata">

**Author:** ![Washimul](https://forum.infinityfree.com/letter_avatar/washimul/32/5_5575768a8748004e209b776fc1b2916d.png) [@Washimul](https://forum.infinityfree.com/u/Washimul)\
**Post date:** [September 8, 2023, 5:08pm UTC](https://forum.infinityfree.com/t/form-data-fetch-problem/82364/10 "2023-09-08T17:08:17Z")

</div>

thank you for your kind, response, Can you please suggest to me any provide who will be the best fit for - node.js, core-js, and Mongodb? ( as i want to develop my site only using, core-js and node.js and for database mongodb) thank you in advance.

---

<div class="post-metadata">

**Author:** ![anon42008019](https://forum.infinityfree.com/letter_avatar/anon42008019/32/5_5575768a8748004e209b776fc1b2916d.png) [@anon42008019](https://forum.infinityfree.com/u/anon42008019)\
**Post date:** [September 8, 2023, 5:23pm UTC](https://forum.infinityfree.com/t/form-data-fetch-problem/82364/11 "2023-09-08T17:23:32Z")

</div>

I don’t think there is a hosting provider which can provide all these but you may have better time paying for a cheap VPS and setting things up on your own.

---

<div class="post-metadata">

**Author:** ![system](https://infinityfree-forum-uploads.s3.dualstack.eu-central-1.amazonaws.com/original/3X/b/0/b024fd3fa88bae093c9576e55c2c94e33f890206.svg) [@system](https://forum.infinityfree.com/u/system)\
**Post date:** [September 15, 2023, 5:24pm UTC](https://forum.infinityfree.com/t/form-data-fetch-problem/82364/12 "2023-09-15T17:24:14Z")

</div>

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
