Jump to content

odetron

Members
  • Posts

    19
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

odetron's Achievements

Member

Member (2/5)

0

Reputation

  1. So im getting an error saying one of my tables doesn't exist. So I re-run my table makeing script and its not working <?php $dbhost = 'xxxxxxx'; $dbuser = 'xxxxx'; $dbpass = 'xxxxxxxx'; $con = mysql_connect($dbhost, $dbuser, $dbpass) or die ('Error connecting to mysql'); $dbname = 'xxxxxxxxx'; mysql_select_db($dbname, $con); $sql="CREATE TABLE news ( Name VARCHAR(15), Subject VARCHAR(15), Message VARCHAR(1000), Date VARCHAR(10), ID int, )"; mysql_query($sql,$con); ?> whats wrong?
  2. I was useing the news system code on this site yet im haveing trouble when running part of it. <?php $db_host = "xxxxxxx"; $db_username = "xxxxxxxx"; $db_password = "xxxxxxx"; $db_name = "xxxxxxx"; mysql_connect($db_host,$db_username,$db_password) or die(mysql_error()); mysql_select_db($db_name) or die(mysql_error()); $query = "SELECT name, subject, message, date FROM news order by date DESC"; $result = mysql_query($query); echo "<br><center>"; while($r=mysql_fetch_array($result)) { echo "<tr>"; echo "<td bgcolor='#FFFFFF'><h10>// $r[subject]<HR color='#660000'></td>"; echo "</tr>"; echo "<tr>"; echo "<td bgcolor='#FFFFFF'>$r[message]<HR color='#660000'></h10></td>"; echo "</tr>"; echo "<tr>"; echo "<td bgcolor='#FFFFFF'>Posted By: $r[name]</a> $r[date]<br><br><br></td>"; echo "</tr>"; } echo "</table>"; ?> Im haveing trouble running line 17. It looks right yet I get this message: How can I fix this?
  3. now it says oi can't modify the headers... how do i fix that?
  4. ok so i ave this code session_start(); $username = $_POST[‘username’]; $password = md5($_POST[‘password’]); $logingood = 1; $query = "SELECT * FROM users WHERE username = '" . $username . "' AND password = '" . $password . "'"; $result = mysql_query($query); if (mysql_num_rows($result) != 1) { $error = 'Bad Login'; include (“login.html”); } else { $_SESSION[‘username’] = '$username'; $logingood = 2; } if ($logingood == 2) { echo "Welcome! I will now redirect you to your control Panel!"; if ($username == Odetron) { header("location: http://odetron.freehostia.com/Test/comics/comics/admin/"); } else { echo "You are not an admin so get out "; } } ?> I am mainly looking at the section if ($username == Odetron) { header("location: http://odetron.freehostia.com/Test/comics/comics/admin/"); } else { echo "You are not an admin so get out "; } } What its supposed to do is make the user be redirected to the admin cp if there username is odetron, but even thought the username is odetron its saying you are not an admin. what was my error?
  5. $query = “select * from users where username=’$username’ and password=’$password’”; whats wrong with this?
  6. $pg = 1; $_GET[$pg]; //Draws the page data if ($pg == 1) { include("news1.inc.html"); } if ($pg == 2) { include("news2.inc.html"); } what i whant this code to do is change the site content depending on what the url is. like index.php?pg=2 would bring up hello world 2 and just index. php would bring up hello world. but on both i keep getting the one for $pg = 1 why won't this work?
  7. Lets say i have the text [1] and i whant it to change a variable when clicked on. so variable $i would be changed from 1 to 2. How do i do this?
  8. I have never seen this error before: Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/www/phimil.freehostia.com/Test/index.php on line 168 $pg2 = "<fieldset><legend><b>mission, complete!</b> - <i>January 6, 2007</i></legend><div class='infld'><BR>This site is 100% completed! Finnaly the downloads section is back! It took awhile to develope because it needed extra CSS to finish. Check it out.! Also feal free to register in the un-completed forums. ( I still need to upload some images) </a></div></fieldset><fieldset><legend><b>Forum is Back!</b> - <i>December 28, 2006</i></legend><div class='infld'><BR>w00t! this site has more of a use now! Check out our forums <a href="/community">Here!</a></div></fieldset><fieldset><legend><b>Project Resumed!</b> - <i>December 28, 2006</i></legend><div class='infld'><BR>The current 3D Project has started again! The first screen shots should be expected late january.</div></fieldset>"; so, whats wrong with this? ???
  9. Parse error: parse error, unexpected T_VARIABLE in /home/www/phimil.freehostia.com/Test/index.php on line 168 thats what i get whe i execut my script. it says theres a T_Variable yet i find no error in the variable on line 168. $pg2 == {"<fieldset><legend><b>mission, complete!</b> - <i>January 6, 2007</i></legend><div class='infld'><BR>This site is 100% completed! Finnaly the downloads section is back! It took awhile to develope because it needed extra CSS to finish. Check it out.! Also feal free to register in the un-completed forums. ( I still need to upload some images) </a></div></fieldset> <fieldset><legend><b>Forum is Back!</b> - <i>December 28, 2006</i></legend><div class='infld'><BR>w00t! this site has more of a use now! Check out our forums <a href="/community">Here!</a></div></fieldset> <fieldset><legend><b>Project Resumed!</b> - <i>December 28, 2006</i></legend><div class='infld'><BR>The current 3D Project has started again! The first screen shots should be expected late january.</div></fieldset>"} I think its because of the html i put in it so if thats the problem, how do i put that in a variable?
  10. yeah, i just realized word pad isn't the best editor. so when i chnged it to note pad i saw it was word pads fault.
  11. now it looks like this {\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fswiss\fcharset0 Arial;}} {\*\generator Msftedit 5.41.15.1507;}\viewkind4\uc1\pard\f0\fs20 \par \par \par \par \par \par \par Name:[ ] \par Nick name: [ ] \par Something That describes you:[ ] \par Your banner url:[ ] \par [submit]\par \par \par © 2006 odetron\par \par \par \par } Edit Never mind, its just the text editor im useing.
  12. Im haveing trouble with this error i found in a code Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /home/www/phimil.freehostia.com/pwnage/index.php on line 9 Parse error: parse error, unexpected T_STRING in /home/www/phimil.freehostia.com/pwnage/index.php on line 9 Heres the code i have <HTML> <HEAD> <TITLE> Pwned </TITLE> </HEAD> <BODY> <?php <form action="pwner.php" method="get"> Name: <input type="text" name="name" /><br> Nick name: <input type="text" name="nick" /><br> Something That describes you: <input type="text" name="des" /><br> Your banner url:<input type="text" name="ban" /><br> <input type="submit" /> </form> ?> &copy 2006 odetron </BODY> </HTML> Whats wrong with it?
  13. yeah, im lousy at php. anyways whats wrong this code? I can't seem to fix it. [code] if (mysql_num_rows($result)!= 1) { $error = “Bad Login”;     include “login.html”; } else {     $_SESSION[‘username’] = “$username”;     include “memberspage.php”; } ?>[/code] Theres an unexpected T-String in the top row.
  14. alright I got it. it had to be changed to [code]$query = mysql_query("SELECT * FROM `users` WHERE `username`='{$username}' `password`='{$password}'");[/code]
×
×
  • 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.