0

I have the below function call that needs to pass url parameters to the php file. How would I go about passing these using the $_GET function. Below is what I have, obviously not working. THanks.

$.ajax({   type: "POST",   url: '"chkinpost.php + "?eventid=<php echo $_GET['eventid']?> +  ?eventname= <php echo $_GET['eventid']?>"' });
1
  • 3
    You have two question marks in your URL for one. And your quotes are all screwed up. Commented Feb 7, 2013 at 17:29

2 Answers 2

1

How about

$.ajax({
    type: "POST",
    url: "chkinpost.php?eventid=<?php echo $_GET['eventid']; ?>&eventname=<?php echo $_GET['eventname']; ?>"
});

Although I'm not entirely sure why you're using a POST to pass GET params, that would at least be how the formatting and correct syntax would look. Also, I changed the second variable being taken from the PHP to eventname, since I doubt you meant to pass the eventid as both the id and the name.

Sign up to request clarification or add additional context in comments.

1 Comment

Thank you Jeremy, that was it.
1

Try:

$.ajax({   type: "POST",   url: '"chkinpost.php + "?eventid=<? echo $_GET['eventid']?> +  ?
eventname= <? echo $_GET['eventid']?>"' });

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.