tags:

views:

61

answers:

2

I have created a button specific for submitting appeals for punishments.

Here is the page: oldserver.net/button/lookup.php?id=80

It doesn't work like it should... I included test.php inside the main file at lookup.php and it doesn't work at all. Search queries work just fine. It's javascript that is not working right. So I don't know how to fix it, I included javascript through "include("js.html"); inside test.php.

Here is the working one without it on my page: http://oldserver.net/button/test.php

What I am trying to do is make test.php work on my page with the appeals. I want to do this so on the template, I can add in MySQL data into the template that is sorta like autofill. So they can copy the template, and go to my site and submit it.

Do you know what the problem is why the button is not functioning like it should?

Here's what I have in the first one.

while($row=mysql_fetch_array($result)){

 $offender=$row['xxxx'];
 $enforcer=$row['xxxx'];
 $purpose=$row['xxxx'];

//-display the result of the array

echo "<ul>\n"; 
echo "<li>Username: " . $xxxx . "</li>\n";
echo "<li><font color=\"green\"><i>Moderated by: " . $xxxx . "</i></font></li>\n";
echo "<li><font color=\"red\">Reason for moderation: " . $xxxx . "</font></li>\n";
echo "</ul>";
include("test.php");

And this is what is inside test.php

<title>Test The search</title>
<?php 
include("js.html"); 
include("config.php");
?>

Js.html just contains the functions for javascript,

here's config.php ->

<input "type="button" value="Submit an Appeal" id="button1" onclick="executeAll();"/>
<input "type="button" value="Send Appeal" id="button2" style="visibility:hidden" onclick="window.open('http://oldserver.net')"/&gt;&lt;br&gt;
<textarea id="app" style="visibility:hidden" onclick="select_all();">...Template... </textarea><br>
<div id="instructions" style="display:none"><i>Copy this appeal then click send<i></div>

Does anyone know whats wrong? Please help meee.

Thank you very much for your consideration, patience, and valuable time. =)

+2  A: 

Maybe type="button" instead of "type="button" will fix the problem?

dev-null-dweller
I removed that 1 quote and it did not fix it. =\ I searched for any more typos I added in and there was none that I saw. I come to think it's javascript not functioning inside the <php? blocks.Any idea how I could fix that but still have it work?
OldServer
A: 

What are 'app' and 'button2' in the JavaScript function executeAll()?

function executeAll(){
wat(app);
wat2(button2);
valChange();
select_all();
toggle_visibility('instructions');
}

You've hard coded the IDs in the functions, so this will work:

function executeAll(){
wat(true);
wat2(true);
valChange();
select_all();
toggle_visibility('instructions');
}

For whatever reason, in test.php, 'app' and 'button2' are being evaluated as true. This isn't happening in lookup.php.

If anyone can provide the explanation for that, I'd be grateful.

George Marian
Thank you. I forgot about that when I added else to it. I corrected this.Also by the way... you fixed my problem! OMG I am so happy. I thought it was going to be impossible to fix because I had javascript inside the PHP blocks. Fixing the true/false fixed it! Thank you so much! I am so happy now, thank you so much for making my day!!! =D
OldServer
THANK YOU SO MUCH!
OldServer