Click to See Complete Forum and Search --> : include file problem


dcjones
11-20-2003, 04:26 AM
Hi all,

I have a script which calls a include file.

The include file looks like this:

<?php
$wl_opt = "0";
$wl_minetype = "html/plain";
$host = "http://www.mydomain.com/S301.1/api?";
$wl_password = "mypassword";
?>


In the script I have a line that looks like this
<?
<form method="POST" action="http://www.mydomain/S301.1/api?"wl_password="mypassword"name="forma">
?>

The problem I am have is that the include brings in the correct password but with the quote marks around it making the password invalid.

Can someone help

Regards, keep safe and well.

Dereck

Khalid Ali
11-20-2003, 06:30 AM
you can probably remove the qoutes using one of the several available string removal functions in php such as this may work for you

str_replace("\"", "", $wl_password);

however its strange that you are getting qoutes with it.

dcjones
11-20-2003, 07:09 AM
Hi

I now have the following code:

<form method=\"POST\" action=\"$host\"wl_password=\"str_replace("\"", "", $wl_password) \"name=\"forma\">";

But I am getting a error:

Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /homepages/41/d43000764/htdocs/academy_translation/translate3.php on line 27

Parse error: parse error, expecting `','' or `';'' in /homepages/41/d43000764/htdocs/academy_translation/translate3.php on line 27

What do you think is wrong, help please.

Kind regards

Dereck

pyro
11-20-2003, 07:25 AM
Why do you even have the quotes there? Why not use something like:

<?PHP
<form method="POST" action="http://www.mydomain/S301.1/api?wl_password=mypassword&amp;amp;name=forma">
?>