Jump to content

Recommended Posts

Hey^^

 

I got a problem, i made a couple of Javascript scripts ( also using jQuery ) And, i actually kinda need to save the whole page, into a Db...

I'm asking here for the best way to do it...

 

If you know a good way, please explain it, so i can use it multiple times

 

( The language is dutch, so dont mind that )

 

<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript">
$(document).ready(function(){ ;
  $("button.nieuw").click(function(){ ;
  	
var i = 1

var onderdeel=new Array()
var nutr=new Array()
var dat=new Array()
var wat=new Array()
var wie=new Array()
var ok=new Array()

var werk=new Array()

for ( i=1 ;i <= 1 ; i++)
{
	ak = false
	while ( ak == false )
	{
		nutr[i] = prompt("Wat is de naam van het machine")
		dat[i] = prompt("Datum van herstelling")
		alert("Naam : " + nutr[i])
		alert("Datum : " + dat[i])
		ak = confirm("Bent u hiermee akkoord?")
	}

	ak2 = false
	while ( ak2 == false )
	{
		wat[i] = prompt("Wat is/was het probleem")
		wie[i] = prompt("Wie heeft het toestel hersteld?")
		alert("Wat : " + wat[i] + " Wie : " + wie[i] + ".")
		ak2 = confirm("Bent u hiermee akkoord?")
	}

	ak3 = false
	while  ( ak3 == false )
	{
		werk[i] = confirm("Werkt het?")
		if ( werk[i] == true )
		{
			ok[i] = "Oke"
		}
		else
		{
			ok[i] = "Niet Oke"
			alert("U moet dit onderdeel toeveoegen aan de actie lijst!")
		}
		alert(ok[i])
		ak3 = confirm("Bent u hiermee akkoord?")
	}

	window.location.href = "http://localhost/i4.php?nutr" + i + "=" + nutr[i] + "&dat" + i + "=" + dat[i] + "&wat" + i + "=" + wat[i] + "$wie" + i + "=" + wie[i] + "&ok" + i + "=" + ok[i]
	$(".MyTable").append("  <tr> \
    <td width=\"auto\" valign=\"top\"><p align\"center\"> " + nutr[i] + " </p></td> \
    <td width=\"auto\" valign=\"top\"><p align\"center\"> " + dat[i] + " </p></td> \
	<td width=\"auto\" valign=\"top\"><p align\"center\"> " + wat[i] + " </p></td> \
	<td width=\"auto\" valign=\"top\"><p align\"center\"> " + wie[i] + " </p></td> \
	<td width=\"auto\" valign=\"top\"><p align\"center\"> " + ok[i] + " </p></td> \
  </tr>") ;
}
})
})
</script>

 

 

This all need to be saved, The "Nutr" "Dat" "Wat" "Wie" "Ok"

But ofcourse... when you go to the page again, like next day... it need to stand in correct order with the table

 

<table border="1"  cellspacing="0" cellpadding="0" width="710" class="MyTable">

  <tr align="center">
    <td width="128" height="37" valign="top"><p>Naam uitrusting</p></td>
    <td width="87" valign="top"><p>datum</p></td>
    <td width="187" valign="top"><p>wat</p></td>
    <td width="117" valign="top"><p>Wie</p></td>
    <td width="62" valign="top"><p>ok</p></td>
  </tr>
</table>

<p><button class="nieuw"> Nieuw onderdeel </button></p>

 

Im just a starter with JS and php... ^.^

 

So if anyone gots a good way to save this all... please post ^^

 

 

Link to comment
https://forums.phpfreaks.com/topic/212551-js-file-save-into-db/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.