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

  • SEARCH
  • Home
  • 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 8826045
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T07:01:33+00:00 2026-06-14T07:01:33+00:00

I have to send a name and a link from client side to the

  • 0

I have to send a name and a link from client side to the server. I thought of using AJAX called by Javascript to do this.

This is what I mean. I wished to make an ajax request to a file called abc.php with parameters :-

1. http://thumbs2.ebaystatic.com/m/m7dFgOtLUUUSpktHRspjhXw/140.jpg

2. Apple iPod touch, 3rd generation, 32GB

To begin with, I encoded the URL and tried to send it. But the server says status Forbidden

Any solution to this ?

UPDATE ::

It end up calling to

http://abc.com/addToWishlist.php?rand=506075547542422&image=http://thumbs1.ebaystatic.com/m/mO64jQrMqam2jde9aKiXC9A/140.jpg&prod=Flat%20USB%20Data%20Sync%20Charging%20Charger%20Cable%20Apple%20iPhone%204G%204S%20iPod%20Touch%20Nano

Javascript Code ::

function addToWishlist(num) {
var myurl = "addToWishlist.php";
var myurl1 = myurl;
myRand = parseInt(Math.random()*999999999999999);

var rand  = "?rand="+myRand ;
var modurl = myurl1+ rand + "&image=" + encodeURI(storeArray[num][1]) + "&prod=" + encodeURI(storeArray[num][0]);
httpq2.open("GET", modurl, true);
httpq2.onreadystatechange = useHttpResponseq2;
httpq2.send(null);
}
function useHttpResponseq2() {
if (httpq2.readyState == 4) {
if(httpq2.status == 200) {
var mytext = httpq2.responseText;
document.getElementById('wish' + num).innerHTML = "Added to your wishlist.";
}
}
}

Server Code

<?php
include('/home/ankit/public_html/connect_db.php');

$image = $_GET['image'];
$prod = $_GET['prod'];
$id = $_GET['id'];



echo $prod;
echo $image;
?>

As I mentioned, its pretty basics

More Updates :

On trying to send a POST request via AJAX to the server, it says :-

Refused to set unsafe header "Content-length"
Refused to set unsafe header "Connection"
  • 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-06-14T07:01:35+00:00Added an answer on June 14, 2026 at 7:01 am

    2 things.

    1. Use encodeURIComponent() instead of encodeURI().

      Here is a detailed discussion on this: When are you supposed to use escape instead of encodeURI / encodeURIComponent?

    2. If you are new to JavaScript, use some lib to help you do the AJAX work. Like mootools, jQuery, etc.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to send data from client-side to server-side (asp.net c#), if you really
I have a link from that link: http://api.maxxiscentral.com/maxxiscentral/GetTyrePatterns from this link i want to
Creating a client server application i have managed to get the server to link
I have send an email using php mailer class. mail was sending successfully but
I am using Lotus Notes Java API for my application. I have send one
I have to send .csv file to remote server through REST in rails. I
Here I have to send and receive dynamic data using a SysV message queue.
Using Socket.IO's WebSocket I have successfully managed a chat application from my home computer
I am fetching data from the following database: I have arduino-box that send that
I am trying to send a sample email from my rails application. this is

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.