tags:

views:

15

answers:

2

I am trying to parse some xml data by passing the variables with a form with the get method into my own domain.

If I put the link of the XML engine in my file it parses perfectly the information.

By using the form to change information dates, type of rooms, etc. i can get the variables in my url but I have no idea how to make that vars pass onto the hidden URL of the xml engine.

Ideas?

Here's a quick peak of what I am doing:

<form id="formulario" class="fechas" action="prueba.php" method="get"> 
<select class="checkin" id="checkin" name="checkin"> 
            <option value="2010-10-27">2010-07-27</option>
            </select>
<select class="checkout" id="checkout" name="checkout"> 
            <option value="2010-10-27">2010-07-27</option>
            </select>

This gets me something similar in the url such as

http://www.lisboando.com/prueba.php?checkin=2010-10-27&amp;checkout=2010-10-29

But I need this line of code to get the variables also, it isn't doing it:

$url ='http://www.somedomain.com/cgi/xml/engine/get_data.php?checkin=$checkin&amp;checkout=$checkout&amp;rval=$rval&amp;pval=$pval';

Am I doing something wrong?

Thanks beforehand for any help, really appreciate it.

Flavio

A: 

Just use double quotes:

$url ="http://www.somedomain.com/cgi/xml/engine/get_data.php?checkin=$checkin&amp;checkout=$checkout&amp;rval=$rval&amp;pval=$pval";
wodka
It isn't working wodka. Basically what I need is to copy the variables in the actual url in the browser and fill the variables into the php code.
Flavio
Now is working, I was missing some information. Will you explain a bitfurther differences between '' and ""? Just to add a bit of insight on this operators?
Flavio
http://php.net/manual/en/language.types.string.phphere a small example:$test = 1;echo "test=$test"; // will output test=1echo 'test=$test'; // will output test=$testcan you access the data by using $checkin? Based on the Form I'd say you should use $_GET['checkin'] (take the variable checkin from the url)
wodka
A: 

You need to make your form submit to your XML engine instead of the prueba.php page (which I assume is your form ??)

Change the action attribute of the form tag to the URL "http://www.somedomain.com/cgi/xml/engine/get_data.php"

TimS
Hi Tim, Thanks for that. Maybe I didn't explain well enough. I need to extract the info from their source and display it in my site, if I put their domain, the form will get to their site, and I don't want them leaving my site until they come to a final stage.
Flavio
:) I think you may need to re-tag your question as PHP if you need more help on how to do an HTTP request from within PHP.
TimS
thanks tim, already did it :)
Flavio