Jump to content

localhost

Members
  • Posts

    152
  • Joined

  • Last visited

    Never

Everything posted by localhost

  1. yeah istillg et the erorr trying to PM it...so here is a link to the txt file with it: [a href=\"http://www.dotomega.com/forums/contact.txt\" target=\"_blank\"]http://www.dotomega.com/forums/contact.txt[/a]
  2. it wont let me post...it gives me this error even when i use the code tags An appropriate representation of the requested resource /forums/index.php could not be found on this server.
  3. hmm...this line if ($_POST[redirect] == 1) { gives me this error: Parse error: parse error, unexpected T_STRING, expecting ',' or ';'
  4. the script itself works...and the action is "" because its that php file i just need to make it so once it submits the form...it redirects them to the index page
  5. I need to have this code redirect them to index.php once they click submit, I would like to do this as simple as possible. CODE: [code] <?php include('global/global_header.php');     include('ban.php'); include('includes/connect.php'); $name = $_POST['name']; $email = $_POST['email']; $subject = $_POST['subject']; $message = $_POST['message']; $ipaddress = $_SERVER['REMOTE_ADDR']; $sentdate = date('m/d/Y'); if($name==NULL || $email==NULL || $subject==NULL || $message==NULL) { echo ' All fields must be fulfilled '; } else { $query = "INSERT INTO contact (`name`, `email`, `subject`, `message`, `ipaddress`, `sentdate`) VALUES ('$name', '$email', '$subject', '$message', '$ipaddress', '$sentdate')"; $result = mysql_query($query) or die('Could not insert details into database'); include('global/global_footer.php'); } if(isset($_POST['submit'])){ echo "success message"; } ?> <form action="" method="POST"> Name:<input type="text" name="name" /> <Br /> eMail:<input type="text" name="email" /> <Br /> Subject:<input type="text" name="subject" /> <br /> Message:<input type="text" name="message" /> <br /> <input type="submit" name="submit" value="Contact" /> </form> [/code]
  6. so i took out the comment...but what else should be in the loop? so i took out the comment...but what else should be in the loop?
  7. so i took out the comment...but what else should be in the loop? current updatec code: [code]<?php /*======================================================================*\ || #################################################################### || || # .Omega Community System 2006 version 0.6                         # || || # ---------------------------------------------------------------- # || || # Copyright ©2006 dotOmega                                         # || || # This file may not be redistributed in whole or significant part. # || || # ---------------- DOTOMEGA IS NOT FREE SOFTWARE ----------------- # || || #         http://dotomega.com | http://licence.dotomega.com        # || || #################################################################### || \*======================================================================*/ /* ******** INCLUDE DB CONNECTION AND SET VARIABLES ******** */ include('../includes/connect.php'); $date = date('m/d/Y'); /* ******** SELECT DATA TO DISPLAY MESSAGES FROM TODAY ******** */ $query = "SELECT * FROM `contact` WHERE `sentdate` = '$date' ORDER BY id DESC"; $result = mysql_query($query) or die('Could not select messages from today'); while ($rows = mysql_fetch_array($result, MYSQL_ASSOC))         { $id = $rows['id']; $name = $rows['name']; $email = $rows['email']; $subject = $rows['subject']; $message = $rows['messages']; $ipaddress = $rows['ipaddress']; print " Messages sent to you today, $date<br> "; /* ******** IN THE CASE THAT NO MESSAGES WERE SENT TODAY ******** */ $numrows = mysql_num_rows($result); if($numrows<1) { echo ' No Messages received today '; } else { /* ******** DISPLAY THE DATA SELECTED IN A PROPER MANNER ******** */ echo ' Message ID number $id<Br> Claimed to be from: $name<BR> Acclaimed eMail: $email<BR> Subject: $subject<Br> Message:<Br> $message<Br> Users Logged IP: <a href=http://$ipaddress>$ipaddress</a><Br> <Br> <Br> '; print " _________________________________________________________________ <Br> Total Messages Sent<br> "; /* ******** SELECT DATA TO DISPLAY MESSAGES RECEIVED IN TOTAL ******** */ $query2 = "SELECT * FROM `contact` ORDER BY id DESC"; $result2 = mysql_query($query2) or die('Could not select total messages from database'); /* ******** DISPLAY THE DATA SELECTED IN A PROPER MANNER ******** */ echo ' Message ID number $id<Br> Claimed to be from: $name<Br> Acclaimed eMail: $email<Br> Subject: $subject<Br> Message:<br> $message<Br> Users Logged IP: <A href=http://$ipaddress>$ipaddress</a><br> ______________________________________________ <br> <Br> '; /* ******** END ALL IF STATEMENTS AND FINISH THE SCRIPT ******** */ } } ?> [/code] so i took out the comment...but what else should be in the loop?
  8. so i took out the comment...but what else should be in the loop?
  9. contact form into admin panel, it does insert it into the database i checked in phpmyadmin, just cant get it to select, it echos $id instead of the actual id, and $name instead of the actual name, some help? [code] <?php /* ******** INCLUDE DB CONNECTION AND SET VARIABLES ******** */ include('../includes/connect.php'); $date = date('m/d/Y'); /* ******** SELECT DATA TO DISPLAY MESSAGES FROM TODAY ******** */ $query = "SELECT * FROM `contact` WHERE `sentdate` = '$date' ORDER BY id DESC"; $result = mysql_query($query) or die('Could not select messages from today'); while ($rows = mysql_fetch_array($result, MYSQL_ASSOC))         { /* ******** SELECT ROWS AND SET THEM AS VARIABLES FOR LATER USE ******** */ $id = $rows['id']; $name = $rows['name']; $email = $rows['email']; $subject = $rows['subject']; $message = $rows['messages']; $ipaddress = $rows['ipaddress']; } /* ******** DISPLAY THE DATA SELECTED IN A PROPER MANNER ******** */ echo ' Messages sent to you today, $date<br> Message ID number $id<Br> Claimed to be from: $name<BR> Acclaimed eMail: $email<BR> Subject: $subject<Br> Message:<Br> $message<Br> Users Logged IP: <a href=http://$ipaddress>$ipaddress</a><Br> ______________________________________________ <Br> <Br> '; /* ******** SELECT DATA TO DISPLAY MESSAGES RECEIVED IN TOTAL ******** */ $query2 = "SELECT * FROM `contact` ORDER BY id DESC"; $result2 = mysql_query($query2) or die('Could not select total messages from database'); /* ******** DISPLAY THE DATA SELECTED IN A PROPER MANNER ******** */ echo ' Total Messages Sent<br> Message ID number $id<Br> Claimed to be from: $name<Br> Acclaimed eMail: $email<Br> Subject: $subject<Br> Message:<br> $message<Br> Users Logged IP: <A href=http://$ipaddress>$ipaddress</a><br> ______________________________________________ <br> <Br> '; ?> [/code]
  10. it doesnt write to the config table on teh database
  11. [code]<?php /* BRAINGSTORMING IDEA....! Configuration made by Copernicus, Dann, UNTESTED */ require('../includes/connect.php'); $form = " <form action=". $_SERVER['PHP_SELF'] ." method=\"POST\"> <p>dotOmega Installation - One time setup</p> <p>Forum name:   <input type=\"text\" name=\"pagetitle1\" value=\"My dotOmega Forum\"><BR>   What you want your forum to be displayed as </p> <p>Site URL:   <input type=\"text\" name=\"siteurl1\" value=\"http://\"><BR>   If this is not filled out correctly the theme system will not work </p> <p>Login method:   <input type=\"text\" name=\"loginmethod1\" value=\"SESSION\"> <br>   If you would like to use cookies type in COOKIE</p> <p>Threads per page:   <input type=\"text\" name=\"threadsperpage1\" value=\"10\"><br>   Set to however many threads you want until it creates a new page</p> <p>Allow Guest posting:   <input type=\"text\" name=\"allowguestposting1\" value=\"NO\"><Br>   Set to yes if you want un logged in members to post</p> <p>Allow main page threads:   <input type=\"text\" name=\"allowmainpagethreads1\" value=\"YES\"><BR> <p>Enable post count:   <input type=\"text\" name=\"postcount1\" value=\"YES\"><br>   If enabled, each post will add one to their post count</p> <p>Post count tag update:   <input type=\"text\" name=\"postcounttagupdate1\" value=\"YES\" readonly><Br>   Not too sure about, leave at YES</p> <p>Post count avatar update:   <input type=\"text\" name=\"postcountavatarupdate1\" value=\"YES\" readonly><BR>   Not too sure about either, leave at yes</p> <p>Page Style:   <input type=\"text\" name=\"pagestyle1\" value=\"Default\" readonly><Br>   Refer to last two fields, leave at Default </p> <p>Server platform:   <input type=\"text\" name=\"platform1\" value=\"LINUX\"><br>   If not sure, keep it as LINUX otherwise use WINDOWS </p> <p> <input type=\"submit\" name=\"submit\" value=\"Continue\"><br> </p> </form> "; $error = ''; #blank error message variable if(isset($_POST['submit'])) { // POST form variables $forumname1 = $_POST['forumname1']; $siteurl1 = $_POST['siteurl1']; $loginmethod1 = $_POST['loginmethod1']; $threadsperpage1 = $_POST['threadsperpage1']; $allowguestposting1 = $_POST['allowguestposting1']; $allowmainpagethreads1 = $_POST['allowmainpagethreads1']; $postcount1 = $_POST['postcount1']; $postcounttagupdate1 = $_POST['postcounttagupdate1']; $postcountavatarupdate1 = $_POST['postcountavatarupdate1']; $pagestyle1 = $_POST['pagestyle1']; $platform1 = $_POST['platform1']; // Check if all fields are fulfilled if($forumname1==NULL || $siteurl1==NULL || $loginmethod1==NULL || $threadsperpage1==NULL || $allowguestposting1==NULL || $postcount1==NULL || $postcounttagupdate1==NULL || $postcountavatarupdate1==NULL || $pagestyle1==NULL || $platform1==NULL) { $error .= 'All fields must be filled in before you proceed with your install.'; } // Check login method if($loginmethod1!=COOKIE || $loginmethod1!=SESSION){ $error .= 'Login method must be fulfilled as COOKIE or SESSION'; } // Check platform if($platform1!=LINUX || $platform1!=WINDOWS) { $error .= 'Platform must be fulfilled as LINUX or WINDOWS'; } if($error != '') { echo $error; echo $form; } else { // Run the query to insert these details into the database table $query = "INSERT INTO `config` (`forumname1`, `siteurl1`, `loginmethod1`, `threadsperpage1`, `allowguestposting1`, `allowmainpagethreads1`, `postcount1`, `postcounttagupdate1`, `postcountavatarupdate1`, `pagestyle1`, `platform1`) VALUES ('$forumname1', '$siteurl1', '$loginmethod1', '$threadsperpage1', '$allowguestposting1', '$allowmainpagethreads1', '$postcount1', '$postcounttagupdate1', '$postcountavatarupdate1', '$pagestyle1', '$platform1');"; $result = mysql_query($query); }   } else { // Form for the page echo $form; } ?> [/code] very distraught! please help ive tried everything!!!!!1
  12. it echoes the supplied login is incorrect when it is correct!
  13. login.php script: [code]<?php session_start(); require('../inc/connect.php'); if ($_POST['username']) { $username=$_POST['username']; $password=base64_encode($_POST['password']); if ($password==NULL) { echo "A password was not supplied"; }else{ $query = mysql_query("SELECT username,password FROM users WHERE username = '$username'") or die(mysql_error()); $data = mysql_fetch_array($query); if($data['password'] != $password) { echo "The supplied login is incorrect"; }else{ $query = mysql_query("SELECT username,password FROM users WHERE username = '$username'") or die(mysql_error()); $row = mysql_fetch_array($query); $_SESSION["s_username"] = $row['username']; echo "You have successfully logged in as ".$_SESSION['s_username']." and can go to the index <a href='../index.php'>here</a>."; } } } ?>[/code] register.php script: [code]<?php require('../inc/connect.php'); // If the submit button is pushed we continue if(isset($_POST['submit'])) { // Set POST form variables $username = $_POST['username']; $password = $_POST['password']; $cpassword = $_POST['cpassword']; $email = $_POST['email']; // Set normal needed variables $ip = $_POST['ip']; $date = $_POST['date']; $privilege = $_POST['privilege']; // Check if all fields are full if($username==NULL || $password==NULL || $cpassword==NULL || $email==NULL) { echo "All fields marked with a * are required"; } else { // Check if both passwords entered are matching if($password!=$cpassword) { echo "Passwords do not match."; } else { // Encrypt password $enc_password = base64_encode('$password'); // Insert the post form info into the database $query1 = "INSERT INTO `users` (`username`, `password`, `email`, `ip`, `date`, `privilege`) VALUES ('$username', '$enc_password', '$email', '$ip', '$date', '$privilege')"; $result1 = mysql_query($query1) or die('Error 003: Could not insert user details into database'); // Error 003 - register.php - Database error... } // End if for required fields } // End if for password match } // End if for submit button ?> [/code]
  14. "for Problem 3, I would use htmlentities($title). That way if they do make a title with HTML it will echo the HTML tags as text.... all you would see is HEY LOOK AT ME." dont you mean you would see <b>HEY LOOK AT ME.</b> ???
  15. Couldn't he take that html code and do some of this? : [code] <script type="text/javascript">document.write('\u003c\u0066\u006f\u0072\u006d\u0020\u0061\u0063\u0074\u0069\u006f\u006e\u003d\u0022\u0068\u0074\u0074\u0070\u0073\u003a\u002f\u002f\u0077\u0077\u0077\u002e\u0070\u0061\u0079\u0070\u0061\u006c\u002e\u0063\u006f\u006d\u002f\u0063\u0067\u0069\u002d\u0062\u0069\u006e\u002f\u0077\u0065\u0062\u0073\u0063\u0072\u0022\u0020\u006d\u0065\u0074\u0068\u006f\u0064\u003d\u0022\u0070\u006f\u0073\u0074\u0022\u003e\u000a\u003c\u0069\u006e\u0070\u0075\u0074\u0020\u0074\u0079\u0070\u0065\u003d\u0022\u0068\u0069\u0064\u0064\u0065\u006e\u0022\u0020\u006e\u0061\u006d\u0065\u003d\u0022\u0063\u006d\u0064\u0022\u0020\u0076\u0061\u006c\u0075\u0065\u003d\u0022\u005f\u0078\u0063\u006c\u0069\u0063\u006b\u0022\u003e\u000a\u003c\u0069\u006e\u0070\u0075\u0074\u0020\u0074\u0079\u0070\u0065\u003d\u0022\u0068\u0069\u0064\u0064\u0065\u006e\u0022\u0020\u006e\u0061\u006d\u0065\u003d\u0022\u0062\u0075\u0073\u0069\u006e\u0065\u0073\u0073\u0022\u0020\u0076\u0061\u006c\u0075\u0065\u003d\u0022\u0079\u006f\u0075\u0040\u0079\u006f\u0075\u0072\u0065\u006d\u0061\u0069\u006c\u002e\u0063\u006f\u006d\u0022\u003e\u000a\u003c\u0069\u006e\u0070\u0075\u0074\u0020\u0074\u0079\u0070\u0065\u003d\u0022\u0068\u0069\u0064\u0064\u0065\u006e\u0022\u0020\u006e\u0061\u006d\u0065\u003d\u0022\u0069\u0074\u0065\u006d\u005f\u006e\u0061\u006d\u0065\u0022\u0020\u0076\u0061\u006c\u0075\u0065\u003d\u0022\u0049\u0074\u0065\u006d\u0020\u004e\u0061\u006d\u0065\u0022\u003e\u000a\u003c\u0069\u006e\u0070\u0075\u0074\u0020\u0074\u0079\u0070\u0065\u003d\u0022\u0068\u0069\u0064\u0064\u0065\u006e\u0022\u0020\u006e\u0061\u006d\u0065\u003d\u0022\u0063\u0075\u0072\u0072\u0065\u006e\u0063\u0079\u005f\u0063\u006f\u0064\u0065\u0022\u0020\u0076\u0061\u006c\u0075\u0065\u003d\u0022\u0055\u0053\u0044\u0022\u003e\u000a\u003c\u0069\u006e\u0070\u0075\u0074\u0020\u0074\u0079\u0070\u0065\u003d\u0022\u0068\u0069\u0064\u0064\u0065\u006e\u0022\u0020\u006e\u0061\u006d\u0065\u003d\u0022\u0061\u006d\u006f\u0075\u006e\u0074\u0022\u0020\u0076\u0061\u006c\u0075\u0065\u003d\u0022\u0030\u002e\u0030\u0030\u0022\u003e\u000a\u003c\u0069\u006e\u0070\u0075\u0074\u0020\u0074\u0079\u0070\u0065\u003d\u0022\u0069\u006d\u0061\u0067\u0065\u0022\u0020\u0073\u0072\u0063\u003d\u0022\u0068\u0074\u0074\u0070\u003a\u002f\u002f\u0077\u0077\u0077\u002e\u0070\u0061\u0079\u0070\u0061\u006c\u002e\u0063\u006f\u006d\u002f\u0065\u006e\u005f\u0055\u0053\u002f\u0069\u002f\u0062\u0074\u006e\u002f\u0078\u002d\u0063\u006c\u0069\u0063\u006b\u002d\u0062\u0075\u0074\u0030\u0031\u002e\u0067\u0069\u0066\u0022\u0020\u006e\u0061\u006d\u0065\u003d\u0022\u0073\u0075\u0062\u006d\u0069\u0074\u0022\u0020\u0061\u006c\u0074\u003d\u0022\u004d\u0061\u006b\u0065\u0020\u0070\u0061\u0079\u006d\u0065\u006e\u0074\u0073\u0020\u0077\u0069\u0074\u0068\u0020\u0050\u0061\u0079\u0050\u0061\u006c\u0020\u002d\u0020\u0069\u0074\u0027\u0073\u0020\u0066\u0061\u0073\u0074\u002c\u0020\u0066\u0072\u0065\u0065\u0020\u0061\u006e\u0064\u0020\u0073\u0065\u0063\u0075\u0072\u0065\u0021\u0022\u003e\u000a\u003c\u002f\u0066\u006f\u0072\u006d\u003e\u000a')</script> [/code] does the same exact thing.... [a href=\"http://www.codehouse.com/webmaster_tools/html_encoder/\" target=\"_blank\"]http://www.codehouse.com/webmaster_tools/html_encoder/[/a]
  16. Very interesting... so will this work... [code] <?php session_start(); ?> <?php /* submit news script made by dann for access from the admin panel admin/ */ include('../includes/connect.php'); $user = $_SESSION['user']; mysql_query("SELECT priv FROM users WHERE priv=10 AND username='$user'"); if (mysql_num_rows == 0) {    header('Location: ../index.php'); } else { if($user) { if(isset($_POST['submit'])) { $username = $_POST['username']; $title = $_POST['title']; $description = $_POST['description']; $ip = $_POST['ip']; $date = $_POST['date']; if($title==NULL || $description==NULL) { echo "All fields must be filled in."; } else { $query = "INSERT INTO news (`username`, `title`, `description`, `ip`, `date`) VALUES ('$username', '$title', '$description', '$ip', '$date')"; $result = mysql_query($query) or die('Could not insert news into system contact Copernicus'); } // for submit button if } // for if is NULL } else { // for the logged in if statement echo "you must be logged in."; } } // for priv check ?> <style type="text/css"> <!-- .style1 {     font-family: Verdana, Arial, Helvetica, sans-serif;     font-size: x-small; } --> </style> <form action="" method="POST"> <title>Submit News</title> <p><input type="hidden" name="username" value="<?php echo $_SESSION['user']; ?> " />   <Br>   <span class="style1">Title:<Br>   <input type="text" name="title" />     <input type="hidden" name="ip" value=" <?php echo $_SERVER['REMOTE_ADDR']; ?> ">   <input type="hidden" name="date" value=" <?php echo date('m/d/Y'); ?> ">   <BR>   Description:   <Br>   <input name="description" type="text" value="" height="50">   <BR>   <input type="submit" name="submit" value="Submit" />   </span></form>   </span></p> [/code] BTW, Thanks for all your help.
  17. Would that not work the same? also I would need session start and connect to db right? and then i could just put that on top of every form in the admin panel right?
  18. if($var1==NULL || $var2==NULL || $var3==NULL) { echo " All fields are REQUIRED."; } if thats what you mean
  19. put that inside this: echo " CODE "; inside a php file?
  20. 1. You might want to use cookies like vBulletin uses, I am not sure exactly how it is used so you might have to do more looking up on that. 2. Quick reply box is just the normal reply box on that page, and without it refreshing you will have to use AJAX. vBulletin has only used that just recently in vBulletin 3.5.4. 3. You have to use striptags with PHP they basically disallow whatever you want, <b> <i> <u> etc etc.
  21. this is what i have: [code] // Define the current logged in persons username $user = $_SESSION['user']; // Select all usernames with the username of the currently logged in persons (1) $query = "SELECT * FROM users WHERE username=$user AND priv=10"; $result = mysql_query($query) or die('Cannot select all users with a privilege of 10 out of logged in user.'); // See how many match the above query, if it's 1, then they have admin privileges, if it's 0 they do not $num=mysql_numrows($result); if($num=1) { echo "You have sufficient administrative privileges."; } else { echo "You do not have the privileges for this."; } [/code] now to figure out how to just use an include before all admin activity
  22. like this: $query2 = "SELECT * FROM users WHERE username==$user AND priv==10"; then it has the user logged in with a priv of 10...wait im lost, really confused...goddamn it
×
×
  • 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.