Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7518883
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T01:48:50+00:00 2026-05-30T01:48:50+00:00

Hello o have an html form and a php script and html passes some

  • 0

Hello o have an html form and a php script and html passes some values with a form in the php script. well here is jquery code

<script type="text/javascript">
        $(document).ready(function() {

            $('#convert').click(function(){

                //pairno tis times ap tin forma
                var name = $('#name').val();
                var tel = $('#tel').val();
                var tel2 = $('#tel2').val();
                var street = $('#street').val();
                var minconsum = $('#minconsum').val();
                var closedtill = $('#closedtill').val();
                var opentill = $('#opentill').val();
                var city = $('#city').val();
                var type = $('#type').val();

                if($('#city').val()=='ΑΤΤΙΚΗ')
                {
                    var perioxi = $('#perioxiAtt').val();
                }else if($('#city').val()=='ΚΥΠΡΟΣ')
                {
                    var perioxi = $('#perioxiKypr').val();
                }else if($('#city').val()=='ΘΕΣΣΑΛΟΝΙΚΗ')
                {
                    var perioxi = $('#perioxiThess').val();
                }else{
                    var perioxi = $('#perioxiGen').val();
                }   

                var dataString = "name=" + name + "&tel=" + tel + "&tel2=" + tel2 + "&street=" + street  + "&minconsum=" + minconsum + "&closedtill=" + closedtill + "&opentill=" + opentill + "&city=" + city + "&perioxi=" + perioxi + "&type=" + type;


                $.ajax({
                type: "POST",
                url: "ajax_converter.php",
                data: dataString,
                success: function(data){
                //pairno ta dedomena
                $('#results').show();

                //vazo ta dedomena sto results div tag.
                $('#results').html(data);
            }
         });

and i get the date in my php script as usual

$name = $_POST['name'];
$tel = $_POST['tel'];
$tel2 = $_POST['tel2'];
$street = $_POST['street'];
$minconsum = $_POST['minconsum'];
$closedtill = $_POST['closedtill'];
$opentill = $_POST['opentill'];
$city = $_POST['city'];
$perioxi = $_POST['perioxi'];
$type = $_POST['type'];

everything works fine except the strange charachters &,<,>, etc so that is my problem!

any help would be really helpfull!

here is my html form at least a part of it where i have the problem

<label for="name">Όνομα:</label> 
<input type="text" name="name" id="name" value="" />

I forgot to mention my output if i enter a name like “zo & za” without the quotes i get “zo” that’s all. all the rest of the input string is lost

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T01:48:51+00:00Added an answer on May 30, 2026 at 1:48 am

    For the sake of readability I would define the Ajax parameters like below and let jQuery convert it into the querystring for you encoding it properly. Building it manually will cause issues if you had an ‘&’ character in one of the variables for example (Christofer Eliasson’s answer may do this too):

    $.ajax({
        type: "POST",
        url: "ajax_converter.php",
        data: {
            "name": name,
            "tel": tel,
            "tel2": tel2,
            "street": street,
            "minconsum": minconsum,
            "closedtill": closedtill,
            "opentill": opentill,
            "city": city,
            "perioxi": perioxi,
            "type": type
        },
        success: function(data){
            //pairno ta dedomena
            $('#results').show();
    
            //vazo ta dedomena sto results div tag.
            $('#results').html(data);
        }
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

First try with ajax, please have patience. <html> <script type=text/javascript src=jquery-1.4.2.min.js></script> <script type=text/javascript> $(document).ready(function()
I have below code in html <div id=divTest> Hello <input type=text id=txtID/> <input type=text
Hello i have a html form in side php everything is working fine and
Hello i have an html form and i'm posting data but i'm unable to
For example, I have a HTML form with several input buttons, <form action=/index.php method=post>
I have the following html/php/javascript code: <?php $textBox1 = $_POST[textBox1]; ?> <html> <head> </head>
I have a text box in an HTML form where the user will input
I am doing the following: <script type=text/javascript> $(function(){ $(#ipad).submit(function() { $.post(ipadcheck.php, $(#ipad).serialize(), function(data) {
I have a form with html browse type and a submit button. I chose
I am following this tutorial https://developer.android.com/guide/tutorials/views/hello-tabwidget.html and have completed it. Now I would actually

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.