Author |
Message |
Achaean
Regular


Joined: Mar 22, 2004
Posts: 64
Location: Missouri, USA
|
Posted:
Mon Sep 06, 2004 7:50 pm |
|
Hey guys Im back, got a question, just want some simple code to add to a php index, for a basically a button that can say return to home page or something heres the code,
Code:<?php
/************************************************************************/
/* PHP-NUKE: Web Portal System */
/* =========================== */
/* */
/* Copyright (c) 2002 by Francisco Burzi */
/* http://phpnuke.org */
/* */
/* Based on php Addon Feedback 1.0 */
/* Copyright (c) 2001 by Jack Kozbial */
/* http://www.InternetIntl.com */
/* jack@internetintl.com */
/* */
/* This program is free software. You can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License. */
/************************************************************************/
if (!eregi("modules.php", $_SERVER['PHP_SELF'])) {
die ("You can't access this file directly...");
}
require_once("mainfile.php");
$module_name = basename(dirname(__FILE__));
/**********************************/
$index = 1;
$subject = "$sitename - Event Sign Up";
/**********************************/
include("header.php");
if ($cookie[1] != "") {
$sql = "SELECT name, username, user_email FROM ".$user_prefix."_users WHERE user_id='$cookie[0]'";
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
if ($row[name] != "") {
$sender_name = $row[name];
} else {
$sender_name = $row[username];
}
$sender_email = $row[user_email];
}
OpenTable();
$sql = "SELECT ei, pn FROM ".$user_prefix."_events_players WHERE ei='$event_id'";
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result)) {
$ei = $row[ei];
$pn = $row[pn];
if ($event_id = $ei) {
if ($username == $pn) $okay = 2;
}
else $okay = 1;
}
if ($okay == 1) {
sql_query("INSERT INTO ".$user_prefix."_events_players VALUES ('$event_id','$username','')", $dbi);
echo "<table><tr><td><b>Thank-you $username. Sign up successful for match vs. $opponent!</b></td></tr></table>";
}
else {
sql_query("INSERT INTO ".$user_prefix."_events_players VALUES ('$event_id','$username','')", $dbi);
echo "<table><tr><td><b>Thank-you $username. Sign up successful for match vs. $opponent!</b></td></tr></table>";
}
CloseTable();
include("footer.php");
?>
|
|
_________________ http://www.1staxis.com |
|
 |
 |
GanjaUK
Life Cycles Becoming CPU Cycles

Joined: Feb 14, 2004
Posts: 633
Location: England
|
Posted:
Mon Sep 06, 2004 8:27 pm |
|
Code:
echo "<form method="get" action="index.php"><input type="submit" name="submit" value="Return Home"></form>";
|
|
_________________ Only registered users can see links on this board! Get registered or login! |
|
|
 |
Achaean

|
Posted:
Mon Sep 06, 2004 8:45 pm |
|
aye but where in the code do I put this again? |
|
|
|
 |
GanjaUK

|
Posted:
Mon Sep 06, 2004 9:01 pm |
|
I have no idea where you need the button. That info would help a lot.  |
|
|
|
 |
Achaean

|
Posted:
Mon Sep 06, 2004 9:02 pm |
|
at the bottom of the text hehe, perhaps a <br> or two below the final text. |
|
|
|
 |
GanjaUK

|
Posted:
Mon Sep 06, 2004 9:05 pm |
|
ugh, what text? If you mean under the current module, then I would add it in theme.php above the footer. |
|
|
|
 |
Achaean

|
Posted:
Mon Sep 06, 2004 9:24 pm |
|
under the Thank-you $username. Sign up successful for match text that will be shown on the page. |
|
|
|
 |
GanjaUK

|
Posted:
Mon Sep 06, 2004 9:45 pm |
|
I thought you wanted this button on all pages.
Just put a <br> in after the text then add the button code.
Code:<b>Thank-you $username. Sign up successful for match vs. $opponent!</b><br><form method=\"get\" action=\"index.php\"><input type=\"submit\" name=\"submit\" value=\"Return Home\"></form>
|
|
|
|
|
 |
|