Jump to content

[SOLVED] Script is outputting file contents, not executing


Catfish

Recommended Posts

First: permissions on the file are 755 and its containing directory is 755.

 

This problems occurs both on my local machine and on my webhosts.

 

I have made the following two pages:

 

index.php:

<html>
<head>
  <title>facebook mafia wars id number link generator</title>
</head>
<body>
  <ol>
   <li>Join a MafiaWars group on facebook</li>
   <li>Add people as your friend - it is easiest if you create a friend list in your facebook account called MfiaWars or something - and add them to this group</li>
   <li>After they confirm the invitation, go to Friends -> All Friends -> MafiaWars friend list on the left</li>
   <li>Anyone with their invitation URL in their status you can just click and add to your Mafia then remove straight away</li>
   <li>Anyone with no URL in their status you can copy the link location of their names (right-click their name and select 'Copy Link Location' or similar) and paste them in the box below - ONE PER LINE (press enter after each one)</li>
   <li>Click the submit button and the URLs will be made for you to click.</li>
  </ol>
  <form action="convert.php" method="POST">
   <textarea name="friendLinks" rows="25" cols="100"></textarea>
   <input type="submit" value="Submit"></input>
  </form>
</body>
</html>

 

convert.php:

print("<html><head><title>Script Output</title></head><body>\n");
if (strlen($_POST['friendLinks']) > 0)
{
if ($localFriendURLs	= explode("\n", $_POST['friendLinks']))
{
	$i = 0;
	foreach ($localFriendURL as $index => $friendURL)
	{
		$localAddURL[$i] = str_replace("http://www.facebook.com/profile.php?id=", "http://apps.facebook.com/inthemafia/status_invite.php?from=", $localFriendURL);
		$i++;
	}
	foreach ($localAddURL as $addURL)
		print('<a href="'.$addURL.'">'.$addURL.'</a><br/>'."\n");
	print("<br/>Page and contents created by Catfish, 2009.");
}
else
	print("Script failed - could not split URLs on newline character.<br/>\n");
}
else
print("You did not paste any friend URLs into the input box. Click back and try again after you add some friend URLs.<br/>\n");
print("</body></html>");

 

and when i click the submit button on index.php the convert.php script is output to the browser as a HTML file, not executed like it should be. it does this locally and on my web host so not sure if its a configuration thing?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.