Log in

View Full Version : help please



Habtopia
19-12-2008, 11:56 AM
This is from housekeeping

this file is djsays.php
it posts to says.php

im wondering how i could change the page it posts to?

<? session_start();
include 'config.php';
$ip = $_SERVER['REMOTE_ADDR']; //get the ip of the current user
if(!isset($_SESSION['session_username']) || empty($_SESSION['session_username']) || $ip!= $_SESSION['session_ip']) {
//if the username is not set or the session username is empty or the ip does not match the session ip log them out
session_unset(); //clears firefox
session_destroy(); //clears IE
die("Hmm I Wonder Why You Have Ended Up Here :S"); }
include("online.php");?>

<font face="Verdana" size="1">
<?
$ip = getenv("REMOTE_ADDR");
if($_GET["action"] == "add") {
$session_username = $_SESSION["session_username"];
$ip = getenv("REMOTE_ADDR");
$comment = $_POST["comment"];
$add = mysql_query("INSERT INTO `shoutout` ( `comment` , `username` , `IP` ) VALUES ('$comment', '$session_username', '$ip')");
echo "Shoutout added on site";

} elseif($_GET["action"] == "delete") {
$delete = mysql_query("TRUNCATE TABLE `shoutout`");
$session_username = $_SESSION["session_username"];
$add = mysql_query("INSERT INTO `shoutout` ( `comment` , `username` , `IP` ) VALUES ('DJ Says Is Not In Use By The Current DJ', 'Offline!', '192.168.1.1')");
echo "All shoutouts deleted";

} elseif($_GET["action"] == "addalert") {
$cookiename = time();
$ip = $_SERVER["REMOTE_ADDR"];
$message = addslashes($_POST["message"]);
$update = mysql_query("UPDATE `alert` SET `id`='1',`cookiename`='$cookiename',`message`='$me ssage' WHERE `id`='2'");
echo "The alert was successful. All the visitors of the website have now been shown the alert.<p>This window will automatically go back. Please wait...(this is usually about 15 seconds)";
echo "<meta http-equiv=\"refresh\" content=\"5;url=djsays.php?action=alertrefresh\">";


} elseif($_GET["action"] == "alertrefresh" and $_SESSION['session_level'] == "1") {
echo "Pending... Please Wait";
$delete = mysql_query("UPDATE `alert` SET `id`='2' WHERE `id`='1'");
echo "<meta http-equiv=\"refresh\" content=\"2;url=djsays.php?action=alert\">";

} elseif($_GET["action"] == "alert") {
echo "You can no longer use &#92;n << Means u can only have 1 line
<form method='post' action='djsays.php?action=addalert'>
<table border=\"0\" cellspacing=\"5\">
<tr><td valign=\"top\"><font face=\"Verdana\" size=\"1\">Message:</td><td>
<textarea name=\"message\" rows=\"5\" cols=\"20\"></textarea></td></tr>
<tr><td></td><td><input type=\"submit\" name=\"submit\" value=\"Send Alert\"></td></tr>
</form>";

} else {
if($_SESSION['session_level'] == "1") { echo "<u><b>Set the Value</b></u><br><br> "; }
echo "<form method='post' action='djsays.php?action=add'>
<table border=\"0\" cellpadding=\"2\" cellspacing=\"5\">
<tr><td><font face=\"Verdana\" size=\"1\"><b>Valuer:</b></td><td><font face=\"Verdana\" size=\"1\">".$_SESSION["session_username"]."</td></tr>
<tr><td><font face=\"Verdana\" size=\"1\"><b>Value:</b></td><td><input type='text' name='comment' class='button' size='50'></td></tr>
<tr><td></td><td><input type='submit' name='submit' value='Publish New Value'></td></tr>
</form>";
}
?>
</font></td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>

Jackboy
19-12-2008, 01:40 PM
Cntrl + F

Type in "says.php"

THEN FIND IT IN CODE :)

It works, i tried it.

Habtopia
19-12-2008, 01:48 PM
Cntrl + F

Type in "says.php"

THEN FIND IT IN CODE :)

It works, i tried it.

It finds djsays.php but no says.php

I think it must add it to mysql an then fetch it in says.php

Habtopia
19-12-2008, 02:10 PM
in phpmyadmin how would i copy an paste a table?

Calon
20-12-2008, 02:47 AM
in phpmyadmin how would i copy an paste a table?
phpMyAdmin is a web application, not a desktop application, so you would not "copy an paste" a table.

But I see what you want, so goto the table > export > Copy and paste the text it outputs after you have pressed Go/Submit. > then Click "SQL" and update the names for the new table > Then you're done.

You should stay away from phpMyAdmin if you don't know what you're doing, as you could easily ruin your database and lose your data.

Habtopia
20-12-2008, 02:00 PM
Thanks for comments guys.

Please close thread

Want to hide these adverts? Register an account for free!