hello mods!!

i am facing a strange problem!! i have redirected a URL via php script using html page!!

whenever i open html page it redirects to my php code(script) on page instead of showing me the output of the data that i have put in i.e. the telephone number and the text on my page!!

The html redirects to my php code instead of giving some output!!

do tell me what 2 do!!
here is my sendsmstest.php code:-

<?php
include("config.inc");
include("functions.inc");
if(!empty($_POST))
{
$URL = 'http://localhost:13013/cgi-bin/sendsms?username=yourpassword&password=yourpassword&to='.$_POST.'&text='.htmlentities($_POST);
header('Location:'.$URL);
exit;
}
?>

AND HERE IS THE HTML PAGE WHICH IS REDIRECTING IT!!!

<html>
<head>
<title>SMS Message Sender</title>
</head>
<body bgcolor="#FFFFFF" text="#000000">

<h1>SMS Message Sender</h1>
<form name="sendsms" method="post" action="http://127.0.0.1/sendsmstest.php">
<p>
Telephone number:
<br>
<input type="text" size="30" name="to">
</p>
<p>
Message:
<br>
<textarea cols="20" rows="5" name="text"></textarea>
</p>
<input type="submit" value="Send Message" name="submit">
<input type="reset" value="Reset">
<br>
</form>


<p>
</p>
<hr>

</body>
</html>

???

I think you're totally off the track. Whatever you want to do: HTML can never ever output anything as well as PHP can't display anything.

If you want to so an output of data submitted by a user you have to do it exactly the other way round: Create a HTML-file with a nice form and set the 'action'-tag of '<form>' to your PHP-file.
In the PHP-file you can now see the input of the user.

Eg
The HTML-file

<form method="post" action="output.php">
<input type="text" name="userinput">
<input type="submit">

The PHP-file

$userinput=$_REQUEST["userinput"];
echo $userinput;

Open the HTML-file, fill out the form and click on "Submit".

So what shud be done!!this means that my php script is not being executed!!!


Thats why the whole script is being shown instead of an output such as

accepted for delievery(basically i m sending the sms thru this php application)


so what shud be done!!

Do reply!

Member Avatar for rajarajan2017

Might be this line will be your problem

header('Location:'.$URL);

@all

I HAVE found the solution 2 that problem!!

i did not install php in my fedora core!!
so when i installed it ,that redirected 2 output instead of the script itself.

Silly,but sometimes it happens!!

neways thanxx for ur help!!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.