开发者

Method GET to parse XML from another source into a hidden url

开发者 https://www.devze.com 2023-01-07 22:05 出处:网络
I am trying to parse some xml data by passing the variables with a form with the get method into my own domain.

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="2开发者_运维技巧010-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&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&checkout=$checkout&rval=$rval&pval=$pval';

Am I doing something wrong?

Thanks beforehand for any help, really appreciate it.

Flavio


Just use double quotes:

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


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"

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号