Home > Blockchain >  Generate links with data without database?
Generate links with data without database?

Time:01-24

Can someone help me? I have a text box on my index,and for example if i input "text1" into it and hit the submit button it will be redirected on a new page where the "text1" will be displayed. But everytime i input new text on my index textbox i want to generate new unique URL and remember the data inserted into text box from index. Is there a way to do this without mysql database? Think that every time my users access that unique URL to have that "text1" inserted from index. Thank you

CodePudding user response:

hey it kind of sounds like you want to use the $_GET function

so imagine like you want the name to be Negru you can do something like

<?php echo $_GET['name'] ?>
  index.php?name="namehere"

you can change the name and it will always display the name you give

CodePudding user response:

put your data in query strings. I don't know how to do that in PHP though.

The address will look like www.yourwebsite.com/new-page?data-you-want-to-pass="value"

CodePudding user response:

Try this

<form method="post" action="send.php" id="idOfForm">
  <textarea name="msg" id="msg"></textarea>
  <input type="submit" value="Send" />
</form>
<button onclick="doPreview();">Preview</button>
<script type="text/javascript">
    function doPreview()
    {
        form=document.getElementById('idOfForm');
        form.target='_blank';
        form.action='preview.php';
        form.submit();
        form.action='send.php';
        form.target='';
    }
</script>

CodePudding user response:

But how to get the name if someone share the link with another person? How the page can remember the data inserted first time?

  •  Tags:  
  • Related