Jump to content

HaZaRd420

Members
  • Posts

    37
  • Joined

  • Last visited

    Never

Everything posted by HaZaRd420

  1. Im getting a parse error, unexpected T_VARIABLE, expecting ',' or ';' where i put the url. I need some help, i dont see where the error can be. heres the code. [code]<td><b><a href="viewdetails.php?id=<?='$row[alias]';?>"></td>[/code] Its just that line.
  2. Ok, First things first. I wanna be able to Link an ID to the rest of the stuff thats on the database, for example. I have a roster, On the first page i only have it displaying the '.$row["alias"].' and a few other, but in that same db it also has computer specs. So i want to be able to link the viewprofile, to the rest of the stuff on another page when you click it. Please help me out on this one, hit me up on A.I.M if you can explain it easier there. Thanks. A.I.M = xdimebagxpantera
  3. just mess around with the subsilver template, and rename everything then mess with the .tpl files. thats what i did, and it turnt out ok.
  4. O so sorry man. Thanks so much dude. I added your AIM if thats cool with you!
  5. Hey man, that worked, but now when i go to edit it, the subject just dissapears and doesnt insert it. :(
  6. Ok Heres the problem, I got to edit it, click the link, I edit the textarea, i click submit, and nothing happends. Its suppose to use the echo "Thank you! Information updated" When i click the submit button but it doesnt, it just goes back to the link to edit again. Please Help me. [code] <? //connect to mysql //change user and password to your mySQL name and password mysql_connect("localhost","DB","password");      //select which database you want to edit mysql_select_db("DB"); //If cmd has not been initialized if(!isset($cmd)) {    //display all the news    $result = mysql_query("select * from news order by id");       //run the while loop that grabs all the news scripts    while($r=mysql_fetch_array($result))    {       //grab the title and the ID of the news       $subject=$r["subject"];//take out the title       $id=$r["id"];//take out the id       $author=$r["author"];             $date=$r["date"];             $content=$r["content"];                   //make the title a link       echo "<a href='edit.php?cmd=edit&id=$id'>$subject - Edit</a>";       echo "<br>";     } } ?> <? if($_GET["cmd"]=="edit" || $_POST["cmd"]=="edit") {    if (!isset($_POST["submit"]))    {       $id = $_GET["id"];       $sql = "SELECT * FROM news WHERE id=$id";       $result = mysql_query($sql);               $myrow = mysql_fetch_array($result);       ?>              <form action="edit.php" method="post">       <input type=hidden name="id" value="<?php echo $myrow["id"] ?>">          Subject:<INPUT TYPE="subject" NAME="suject" VALUE="<?php echo $myrow["subject"] ?>" SIZE=30><br>       Content:<TEXTAREA NAME="content" ROWS=10 COLS=30><? echo $myrow["content"] ?></TEXTAREA><br>       Author:<INPUT TYPE="author" NAME="author" VALUE="<?php echo $myrow["author"] ?>" SIZE=30><br>             Date:<INPUT TYPE="date" NAME="date" VALUE="<?php echo $myrow["date"] ?>" SIZE=30><br>          <input type="hidden" name="cmd" value="edit">          <input type="submit" name="submit" value="submit">          </form>    <? } ?> <?    if ($_POST["$submit"])    {       $subject = $_POST["subject"];         $content = $_POST["content"];         $author = $_POST["author"];             $date = $_POST["date"];              $sql = "UPDATE news SET subject='$subject',content='$content',author='$author', date='$date' WHERE id=$id";       //replace news with your table name above       $result = mysql_query($sql);       echo "Thank you! Information updated.";     } } ?> [/code]
  7. Thanks much man!!! Appreciate it.
  8. I was wondering, when you are granted access. Is there any way to put a link in there so someone can click to continue? or if anyone can make it redirect to a different page when access granted. Thanks Heres the code: [code] <?php if($username == "name" && $password == "pass"){ echo "Access Granted"; }else{ echo "Access Denied"; } ?> </body> [/code]
  9. Hey Blurring, that worked out, Thanks alot. It was right in front of my eyes!!! Thanks alot man!
  10. I want to know how can I sort my members in a certain table from a-z, I have it sorted as z-a, i want to switch it up but have no clue on doing so. Heres my displaying page: [code]<?php //PHP Adminpanel v1.0 // include('config.php'); $connection = mysql_connect( "$host","$user","$pass" ) or die(mysql_error()); $rs = mysql_select_db( "$db" ); $sql=" select * from roster order by alias $sort "; $rs = mysql_query($sql) or die(mysql_error()); echo '<table width="100%"> <tr> <td bgcolor="1E1A13"><font face="verdana" size=2 color="FFFFFF"><b><center>Alias</b></td> <td bgcolor="1E1A13"><font face="verdana" size=2 color="FFFFFF"><b><center>ClanRank:</b></td> <td bgcolor="1E1A13"><font face="verdana" size=2 color="FFFFFF"><b><center>Division:</b></td> <td bgcolor="1E1A13"><font face="verdana" size=2 color="FFFFFF"><b><center>Status:</b></td> </tr>'; while ( $row = mysql_fetch_array( $rs) ) { echo ' <tr> <td bgcolor="99958E"><font face="verdana" size=1 color="FFFFFF">'.$row["alias"].'</td> <td bgcolor="99958E"><font face="verdana" size=1 color="FFFFFF">'.$row["clanrank"].'</td> <td bgcolor="99958E"><font face="verdana" size=1 color="FFFFFF">'.$row["division"].'</td> <td bgcolor="99958E"><font face="verdana" size=1 color="FFFFFF">'.$row["status"].'</td> </tr> '; } ?> [/code] and the config: [code] <?php //PHP Work// // Set mysql server info here// $host ="localhost"; //This is the mysql host// $user ="user"; //This is the Mysql Username// $pass ="password"; //This is the Mysql Password// $db ="db"; //This is the Name of the Database you have the information stored in// $sort ="desc"; //to sort the oldest to news shows enter asc to sort from newest to oldest enter desc // ?> [/code]
  11. Nevermind, I fixed the problem :)!!!
  12. Hello, im having this problem with my mysql not connecting to my DB: Warning: mysql_connect(): Access denied for user: 'MYDB@localhost' (Using password: YES) in /home/gtqsqua/public_html/roster/members.php on line 9 Access denied for user: MYDB@localhost' (Using password: YES) And heres the members.php [code]<?php //PHP NEWS v0.1 BY HaZaRd// include('config.php'); $connection = mysql_connect( "$host","$user","$pass" ) or die(mysql_error()); $rs = mysql_select_db( "$db" ); $sql=" select * from news order by date $sort "; $rs = mysql_query($sql) or die(mysql_error()); echo ' '; while ( $row = mysql_fetch_array( $rs) ) { echo ' <font face="verdana" size=1> <b>Subject:</b> '.$row["subject"].' &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <b>Author:</b><i> '.$row["author"].' </i> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <b>Date:</b> '.$row["date"].'<br><br> '.$row["content"].'<br> <hr color="#000000"> '; } ?> [/code] Please Help me on this, I cant figure out what the problem is.
×
×
  • 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.