Jump to content

Recommended Posts

this is so frustrating. i know my coding isnt wrong. the most basic form doesnt even work (always).

 

formp1.php

<form method="post" action="formp2.php">
<input type="text" name="text" id="text">
<input type="submit">
</form>

 

formp2.php

<?php echo $_POST['text']; ?>

 

heres the thing it works SOMETIMES. i send the form and it shows. i go back and do it again and it doesnt. another time it shows another time it doesnt. all the same text input to. i put the number 1.

 

what could possibly do this? its not my browser i tried 2 different browsers. it makes no sense what so ever someone give me something PLEASE

Link to comment
https://forums.phpfreaks.com/topic/235745-what-the-heck-is-going-on/
Share on other sites

i tried what you said. it shows the array. it shows the array with the data SOMETIMES just like it did with the form. this is absouletly crazy. someone please try it out yourself. put data in the text field and submit it. it works. then go back refresh form do it again. tell me if it doesnt work sometimes. and also on page 2. resend data. once resent it usually doesnt show data.

 

http://frozenasfs.com/form/formp1.php

 

i even tried it on two different website servers. and this is all thats on each page exactly.

 

formp1.php

<form method="post" action="formp2.php">

<input type="text" name="text" id="text">

<input type="submit">

</form>

 

formp2.php

<?php

 

if (isset($_POST)){

var_dump ($_POST);

}else{

 

echo "No POST data!";

 

}?>

 

 

 

 

 

 

If you run server showing errors you'd get

syntax error, unexpected T_ENCAPSED_AND_WHITESPACE,

for this part of the code

$_POST['text']

I couldn't get this to fail.

<?php echo "$_POST[text]"; ?>
<form method="post" action="formp2.php" />
<input type="text" name="text" id="text" />
<input type="submit" value="Submit" />
</form>

what does it matter if after 5+ refreshes it drops the data? I'd leave the website if I had to submit more then once? j/w

The point is to write reliable code that doesn't fail.

And yes, the <form tag> I posted above doesn't need to be escaped, just input tags.

 

What? Whats unreliable about it? In what situation would you NEED to resubmit the form 5+ times?

lol  :wtf: i'm going to go ahead and escape this line of convo as you make no sense and I don't want to fill the op's thread up trying to debate it with you.

 

btw the only time the data is lost is after 5 times of resending the data(refreshing page after submission).. if you do exactly as the op instructed before..

 

Fill out the form> submit > see result > Click Back button > refresh page> repeat it>> .... works everytime.

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.