Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

No input file specified.???

Status
Not open for further replies.

zrazzaq

MIS
Apr 13, 2005
102
US
Hi:
I created my php file the code goes something like this:
<?php
// Connecting, selecting database
$link = mysql_connect('mysql2.jodoshared.com', 'xxxxx', 'xxxxx')
or die('Could not connect: ' . mysql_error());
echo 'Connected successfully';
mysql_select_db('xxxxx') or die('Could not select database');

// Performing SQL query
$query = 'SELECT * FROM PEOPLE';
$result = mysql_query($query) or die('Query failed: ' . mysql_error());
mysql_query("INSERT INTO PEOPLE (EMAIL) values ('email')");


// Printing results in HTML
echo "<table>\n";
while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) {
echo "\t<tr>\n";
foreach ($line as $col_value) {
echo "\t\t<td>$col_value</td>\n";
}
echo "\t</tr>\n";
}
echo "</table>\n";

// Free resultset
mysql_free_result($result);

// Closing connection
mysql_close($link);
?>


From my index.htm file the code looks like this:
<HTML>
<TITLE>test</TITLE>
<BODY background="spotlightmontage.jpg">
<form method=POST action="/hello2.php">

<strong>Subscribe to our mailing list:</strong><br>
<input type=text name="email" size=24 maxlength=60>
<input type=radio name="action" value="sub" checked>subscribe
<input type=radio name="action" value="unsub">unsubscribe

<input type="hidden" name="op" value="ds">

<input type=submit name="submit" value="Submit">
</form>
<p>
<img src="coollogo_com_11337343.gif" align="center"</p>
<P>test COMING SOON..LAUNCH IN AUGUST 2005</p>
</BODY>
</HTML>

What am I doing wrong...All I want to do is place in from the textbox to the table and then redirect them back to the index.htm page...
HELP
Please
Z
 
Is your PHP script in the same directory as you HTML file? If so, remove the "/" from
Code:
<form method=POST action="[b][red]/[/red][/b]hello2.php">

The next time you post code, PLEASE surround your code with the TGNL tags [red][ignore]
Code:
[/ignore][/red]
.

Ken
 
Hi Ken:
Thank you for the info about the code....It was in the same directory but now that I test it out it takes about 30 seconds then gives me the same message
"No input file specified."
Is my query wrong incorrect
Code:
<?php
// Connecting, selecting database
$link = mysql_connect('mysql2.jodoshared.com', 'xxxxx', 'xxxxx')
   or die('Could not connect: ' . mysql_error());
echo 'Connected successfully';
mysql_select_db('xxxxx') or die('Could not select database');

// Performing SQL query
$query = 'SELECT * FROM PEOPLE';
$result = mysql_query($query) or die('Query failed: ' . mysql_error());
mysql_query("INSERT INTO PEOPLE (EMAIL) values ('email')");


// Printing results in HTML
echo "<table>\n";
while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) {
   echo "\t<tr>\n";
   foreach ($line as $col_value) {
       echo "\t\t<td>$col_value</td>\n";
   }
   echo "\t</tr>\n";
}
echo "</table>\n";

// Free resultset
mysql_free_result($result);

// Closing connection
mysql_close($link);
?>

Thanks
Z
 
>>No input file specified

means that the php file is either not there or ur server does not have the capability to execute php scripts...

Known is handfull, Unknown is worldfull
 
When I look on the FTP Manager...the php file is there but it states the php file is a textfile...so its bringing it up as hello2.php.txt....How do I change that?
 
rename it? ur FTP software must have some methods for renaming files online...

Known is handfull, Unknown is worldfull
 
I renames it and it kinda worked..Now I get the following message:
PHP Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING' in D:\hshome\zishan78\786.com\hello2.php on line 13
huh??
Thanks
Z
 
could u point out the line???

Known is handfull, Unknown is worldfull
 
The code is line this:
Code:
<HTML>
<BODY>
<?php
// Connecting, selecting database
$link = mysql_connect('mysql2.jodoshared.com', 'xxx_admin', 'xx')
   or die('Could not connect: ' . mysql_error());
echo 'Connected successfully';
mysql_select_db('xx_m') or die('Could not select database');

// Performing SQL query
$query = 'SELECT * FROM PEOPLE';
$result = mysql_query($query) or die('Query failed: ' . mysql_error());
mysql_query("INSERT INTO PEOPLE (EMAIL) values (echo $_POST["email"]; )");

// Closing connection
mysql_close($link);
?> 
</BODY>
</HTML>

I think the line is
$query = 'SELECT * FROM PEOPLE'; if I counted right...Do comments and spaces count as lines too?
Thanks
Z
 
yes:

mysql_query("INSERT INTO PEOPLE (EMAIL) values ('".$_POST["email"]."')");


Known is handfull, Unknown is worldfull
 
Thank You so much for helping me out..It worked it stated connected successfully...One question how do I direct them back to the index.htm page from the php page...
Thanks
again
Z
 
Since you're not really outputing anything, you can use the header() function. Get rid of the <html><body> tags since they are not needed for what you're doing and add:
Code:
header('Location: index.htm');
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top