Jump to content

Recommended Posts

ok, this is both PHP and Java, but i posted it here.

yes, i have the code, but it is really weird, and messed up, and not working.

basicly, i want people to click on the image. after they click on the image, it changes to say "ADDED!" this part works.

BUT...

i have a disabled form below, and AFTER you click on the image, i have an input, and it is disabled. is supposed to become un-disabled, because it is supposed to check to see if the image was clicked on. this doesnt work. anyway, IF the input worked, then it would email me. but the code i have DOES email me, but it also does an echo, and i DONT want it to do that!! i want it to go to a page called "post.php". i DO want it to email me, though. I AM STUCK!!! please help me....

here is the full code:

Link to comment
https://forums.phpfreaks.com/topic/64404-advanced-help-me/
Share on other sites

CODE:

<html>
<head>
<title>[MASS ADDS]</title>

<script type='text/javascript'>
//begin inputdisabledcode by myspaceuser217
//this code uses variables to change an input
//to un-disabled, instead of disabled

var img1 = false;
function check() {
  	if(img1)
    	document.getElementById('input1').disabled = false;
}

//end code
</script>


<script type="text/javascript">
//begin changeimgcode by myspaceuser217
//this code will change an image if you click on it

function changeSrc() {
  	document.getElementById("myImage").src="img2.jpg";
}

//end code, but begin style sheet
</script>

<style type="text/css">
<!--
body
  {
  margin:0cm;
  background-color:white;
  }
.rule
  {
  font-family:verdana,tahoma,arial;
  font-size:8px;
  color:ffffff;
  background-color:white;
  }
.paragraph
  {
  font-family:verdana,tahoma,arial;
  font-size:14px;
  color:000000;
  background-color:white;
  }
.logo
  {
  background-color:white;
  }
table
  {
  width:700px;
  }
td

  }
img
  {
  border-width:0px;
  }
input
  {
  font-family:verdana,tahoma;arial;
  background-color:white;
  color:black;
  font-size:14px;
  }
-->
</style>

</head>
<body>
<tr>
<td class="logo" align="center"></td>
</tr>
<table cellspacing="0px" cellpadding="5px" align="center">
<tr>
<td class="rule" align="center">
<font color=black>
<b>ADD & JOIN!</b>
<br>
Add everyone below, and join for tons of adds!
<br>
<b>BUT WAIT!</b>
<a href="http://blah.blah"target="_large">Click here</a>
, and join our SPECAIL <u>MYSPACE FRIENDS</u> list!
</td>
</tr>
</table>
<br>
<table cellspacing="0px" cellpadding="5px" align="center">
<tr>
<td class="paragraph" align="center">
<input type="hidden" name="a" value="[FRIEND ID GOES HERE]">
<a href="http://www.google.com/"target="large">
<img id="myImage" src="blah.bmp" onclick="changeSrc()" onclick='img1=true;check();' />
</a>
</td>
</tr>
</table>
<br>
<table cellspacing="0px" cellpadding="5px" align="center">
<tr>
<td class="paragraph" align="center">
<b>Now, enter your Friend ID, and click "Submit" </b>
<br>
<font color=green>
<b>THIS FORM IS DISABLED UNTIL YOU ADD EVERYONE!</b>
</font>

<form id="form1" name="form1" method="post" action="">
  <input type="text" name="input1" id="input1" disabled='true'/>
  <input type="submit" name="button" id="button" value="Submit" action="repost.php" />
</form>

<?php
if(array_key_exists('data', $_POST)){
$data = $_POST['data'];
$to = "youremail@domain.com";
$subject = "Email from your site";

$message = "This information has been submited to your website: \n\n";
$message .= $data;

$headers = "MIME-Version: 1.0\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\n";
$headers .= "To: myspaceuser217 <$to>\n";
$headers .= "From: POWER TRAIN! <admin@domain.com>\n";

if(@mail($to, $subject, $message, $headers)){
	echo "Your data was sent succesfully";
} else{
	echo "There was a problem sending your email. Plese retry later";
}

}
?>



</td>
</tr>
</table>

</body>
</html>

Link to comment
https://forums.phpfreaks.com/topic/64404-advanced-help-me/#findComment-321094
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.