Jump to content

1st course: Form validation with PHP and JavaScript


Recommended Posts

on 1st course: Form validation with PHP and JavaScript, 3rd video where it begins PHP from validation it seems in the video form.php and contact.php are not connected ( no link from form.php to contact.php).

It sais : Notice: undefined variable: error in /var/www/html on line and we have a number there

 

I could cover the errors with if and isset but I doubt that the values will fave a null value next time I complete the form again. Please advice. I watched the videos all day long and could not figure out what I should do. Tried to put an include in form.php but no luck and contact.php has no "error" variable   

Link to comment
Share on other sites

9 hours ago, administrator said:

.. Did you try?

1. I tried it and the appearance errors are gone

  BUT

2.the main problem is if you type line by line all the lines in the video the program does not save the data entered when I disable javascript.

3. I tried the source code and I have same issues, maybe there is an error or php version is outdated? ( I use the latest version of php on a Ubuntu laptop)

Edited by SalesMarius
Link to comment
Share on other sites

2 hours ago, SalesMarius said:

.the main problem is if you type line by line all the lines in the video the program does not save the data entered when I disable javascript.

So when the JavaScript is enabled, the data is saved? If so, that would suggest a JS issue, not PHP. Let me know!

Link to comment
Share on other sites

Stef, please download your source code and check it again, maybe my php version is doing some other things than it should or maybe I have a virus on my laptop. Please let me know if it works fine. My php version is "PHP Version 7.2.15-0ubuntu0.18.04.2". My Ubuntu OS sends me messages every time I turn it on System Error or so.

Please see the attached source file. (not modified at all)

It seems I can`t reply to this post anymore...

 

Screenshot from 2019-04-25 15-59-04.png

Edited by SalesMarius
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  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.

Loading...
×
×
  • Create New...