Jump to content

unidox

Members
  • Posts

    557
  • Joined

  • Last visited

    Never

Everything posted by unidox

  1. Use session_start(); on the top of each page that you need the session to be read. Set the session using $_SESSION['name'] = "Bob";
  2. Then after the 1st script is executed why dont you redirect the user and use get.
  3. Try this: mysql_query("UPDATE `mytable` SET `name` = 'John', `ip` = '68.10.721.209' WHERE `uname` = 'test' && `ip` = '68.10.721.209'") or die(mysql_error());
  4. unidox

    File

    I have a form to upload movie file, like wmv, mp4, ect.. But I use windows player to show it. I want to move over to a flash player(like for a cotw, much like youtube.). Anyone know a tutorial or program that can help. Thanks
  5. unidox

    license

    I defined it earlier.
  6. unidox

    license

    I have this script to check if the license if valid: $url = "http://www.site.com/license.php?key=" . SITE_LIC . "&ref=" . $_SERVER["HTTP_REFERER"] . ""; $lic = @fopen($url, "r"); $lic = @fread($lic, 10); if ($lic == "0") { header("Location: http://www.site.com/index.php?p=lic_invalid"); exit(); } I know I have the correct lic key and refferer. Just it still keeps forwarding to the lic_invalid page.
  7. No... It works...
  8. Try this: <html> <head> <title>Untitled Document</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body> <table width="767" border="0"> <tr> <td height="73" colspan="2"> </td> </tr> <tr> <td width="119" height="201"> </td> <td width="638" align="left" valign="top"> <?php $con=mysql_connect("localhost","root",""); if (!$con) { die('Problem encountered'); } mysql_select_db("write", $con); $result = mysql_query("SELECT * FROM article"); echo "<table border=''>"; while($row = mysql_fetch_array($result)) { echo "<tr>"; echo "<td>Title</td>"; echo "<td>" . $row['title'] . "</td>"; echo "</tr>"; echo "<tr>"; echo "<td>Author</td>"; echo "<td>" . $row['author'] . "</td>"; echo "</tr>"; echo "<tr>"; echo "<td>" . $row['article'] . "</td>"; echo "</tr>"; } echo "</table>";mysql_close($con); ?> </td> </tr> </table> </body> </html>
  9. I am trying to create a log script, but its not working how I want it. I want it to add to the file, not overwrite. Here is my code: $file = "logs/log.txt";$size = filesize($file);$open = fopen($file, "w+b");$read = fread($open, $size);$write = $_GET['write'] . "\n";$content = $read;$content .= $write;fwrite($open, $content);fclose($open); but it keeps destroyin the content already in the file and overwriting it. Whats wrong
  10. Yes, I did hide last ip . Ok, I will add a sort button. Thanks
  11. I have a header redirect in an include on my page. I am getting: Warning: Cannot modify header information - headers already sent I know the header has to be at the top of the page, thats the problem. I am just wondering is there an alternative to redirect. I need to be able to redirect from the include, due to errors.
  12. Just added the news page. Test?
  13. Just add a blank index.html page in each dir.
  14. Block off the dir access. Like: http://67.235.113.161/about/ and others.
  15. I am trying to replace any html tags with [ or ]. I keep getting this error: Warning: ereg_replace() [function.ereg-replace]: REG_EBRACK in function message($string) { global $db_connect; $string = ereg_replace("\'\";|`,", "", $string); $string = ereg_replace("[(<", "[", $string); $string = ereg_replace(")>]", "]", $string); return $string; } Whats wrong
  16. Nope, it says syntax error, unexpected "
  17. I am trying to find all \ in a string, and remove it. I have this code: $string = str_replace("\", "", $string); but the \ nulls the trailing " how do I do this?
  18. I have a news section, and I was wondering how I could shorten the message so the user has to click read more. Like: Hi, This is news numb...
  19. unidox

    Error?

    I did, the lines above it are just comments that I removed.
  20. unidox

    Error?

    I need some help, I keep getting this error popping up. Here is my login.php: if (($_COOKIE['user']) && ($_COOKIE['pass'])) { $user = $_COOKIE['user']; $pass = $_COOKIE['pass']; $admin = LEVEL_ADMIN; $ip = $_SERVER["REMOTE_ADDR"]; $date = "" . date('l dS \of F Y h:i:s A') . " EST"; //MySQL Query $q = mysql_query("SELECT * FROM `pcp_users` WHERE password = '$pass' AND username = '$user'"); $r = mysql_fetch_array($q); $group = $r['group']; $q2 = mysql_query("SELECT * FROM `pcp_groups` WHERE `name` = '$group'"); $r2 = mysql_fetch_array($q2); $lvl_array = $r2['pages']; $lvl_array = split(":", $lvl_array); if ((mysql_num_rows($q) == 1) && (in_array("admin", $lvl_array))) { mysql_query("UPDATE `pcp_users` SET ip = '$ip', date = '$date' WHERE password = '$pass' AND username = '$user'"); $_SESSION['admin'] = 1; $_SESSION['user'] = $r['username']; header("Location: index.php"); } else { setcookie("user", "", time()-60*60*24*100, "/"); setcookie("pass", "", time()-60*60*24*100, "/"); header("Location: login.php"); } That checks a users cookie to make sure they are logged in. But I keep getting this error: Catchable fatal error: Object of class stdClass could not be converted to string in /home/purecp/public_html/beta/admin/process.php on line 23 This is index.php: include ('../incs/conf.inc.php'); include("process.php"); session_start(); if ($_SESSION['admin'] != '1') { header("Location: login.php"); } else { $user = $_SESSION['user']; $q = mysql_query("SELECT * FROM `pcp_users` WHERE username = '$user'") or die(mysql_error()); $r = mysql_fetch_array($q); $usergroup = $r['group']; $viewer = getenv('HTTP_USER_AGENT'); $browser = 'An Unidentified Browser.'; if (preg_match("/MSIE/i", "$viewer")) { $browser = 'Internet Explorer'; } if (preg_match("/Netscape/i", "$viewer")) { $browser = 'Netscape'; } if (preg_match("/Opera/i", "$viewer")) { $browser = 'Opera'; } if (preg_match("/Firefox/i", "$viewer")) { $browser = 'Mozilla Firefox'; } $platform = 'An Unidentified Platform.'; if (preg_match("/Windows/i", "$viewer")) { $platform = 'Windows'; } if (preg_match("/Linux/i", "$viewer")) { $platform = 'Linux'; } and the 1st few lines of process.php: session_start(); if ($_SESSION['admin'] != '1') { header("Location: login.php"); } else { if (!isset($path)) { exit(); } $q = mysql_query("SELECT * FROM `pcp_users` WHERE username = '$user'") or die (mysql_error()); // Line 22 <------ $r = mysql_fetch_array($q); $lvl = $r['level']; // Find the users level. $date = date("F jS, g:i a"); Whats wrong?
×
×
  • 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.