Jump to content
  • Advertisement

exorcist_bob

Member
  • Content count

    260
  • Joined

  • Last visited

Community Reputation

187 Neutral

About exorcist_bob

  • Rank
    Member
  1. Thank for the website! It works perfectly now! [smile] Need to start using Google more often.
  2. Hello, Community, How can I layout a header, footer, sidebar, and main content page without using tables, and since I'm using xhtml strict, no frames. I believe that this can be done in css. Thanks for any assistance[smile], exorcist_bob
  3. Hello, Community I just completed my first piece of code that wasn't original; the concept wasn't original. I wrote a md5 hashing algorithm in c++ using the specification. But that isn't what is important. Up until now, I haven't written any thing that I have needed to cite, so I'm asking what is the best way credit the sources. Thanks for any help[smile], exorcist_bob
  4. exorcist_bob

    overwriting windows drawing functions

    Thanks for the advise, however, I would like to know how I can draw my own window decorations. Is it as simple as creating a window without WS_VISIBLE and getting a device context?
  5. Hello community, Could you point me to some resources that will allow me to draw my own window. What I mean is that I could draw my own window border, title bar, client content, etc. I would like info regarding how to do this in win32, linux, and macos. Thanks for any assistance![smile], exorcist_bob
  6. It also works if you have php files with embedded php code inside html code. Thanks a million for your reply! It worked! exorcist_bob
  7. Well, I've figured it out. Somewhat. If I have php embedded in html, it has to have a .html extension on it on the server, but not on the developer console. It has to have a .php extension if it has only php. Could anyone explain why this is?
  8. Hello, Community! Well, it seems that I have been asking my fair share of questions, this will be the fifth one on this page[smile]. For some reason, my website doesn't want to run on my webserver. I keep getting this error: Parse error: parse error, unexpected T_STRING in C:\bdre\Index.php on line 1 On each php script that I'm trying to run. It works on my computer, with the same version of windows, php, apache, and mysql as the server! Thanks for any assistance, exorcist_bob
  9. Figured it out. Used addslashes.
  10. Hello, How can I insert text that has seemingly illegal characters like ', ", \ into a mysql database. It doesn't work when I try the following. $query = 'INSERT INTO articles(article, cdatetime) VALUES ('.$article.', NOW())'; Thanks for any assistance, exorcist_bob
  11. Hello, Is there a simple way to delete a cookie created by setcookie()? Thanks, exorcist_bob
  12. Hello, How can I create a global variable that won't be reinitialized every time I include a file that declares it with new? I want to use the following routine to store session data, which actually works, but I want the session variable to be accessible throughout all the modules that include it. <?php include 'config.php'; class Session { function CreateID() { $time = time(); $ip = $_SERVER["REMOTE_ADDR"]; $agent = $_SERVER["HTTP_USER_AGENT"]; $md5 = md5($time.$ip.$agent); setcookie("SClass", $md5); return($md5); } function GetID() { $md5 = $_COOKIE['SClass']; return($md5); } function Start() { $id = $this->GetID(); if (!$id) { $id = $this->CreateID(); } } function GetFile() { $file = $this->GetID(); $file .= ".ssn"; $file = $sessionroot.$file; return($file); } function SetData($data) { $file = $this->GetFile(); $fs = @fopen($file, w); if ($fs) { fwrite($fs, $data); fclose($fs);} if (!$fs) { return(FALSE); } } function GetData() { $file = $this->GetFile(); $fs = @fopen($file, 'r'); if ($fs) { $data = fread($fs, filesize($file)); fclose($fs); return $data; } if (!$fs) { return(FALSE); } } function SetKey($key, $value) { $data = $this->GetData(); $data = base64_decode($data); $array = unserialize($data); $array["$key"] = $value; $newdata = serialize($array); $newdata = base64_encode($newdata); $this->SetData($newdata); } function GetKey($key) { $data = $this->GetData(); $data = base64_decode($data); $array = unserialize($data); return($array[$key]); } }; ?> EDIT: I request this because I want to do away with the setcookie() call. Thank for any help, exorcist_bob
  13. Quote:Original post by markr Yes, all pages which want to read or write session data must call session_start(). I recommend that for convenience, you do this in all pages. You can write a function which sets whatever options are desired (using ini_set), then calls session_start. Call this function in some common header file, thus causing it to be executed everywhere. Common problems with sessions are: - If you're using query strings to transport the session ID, many bad things could happen. Just don't. Set session.use_only_cookies - If you're using cookies, ensure that all your pages are served from one and exactly one domain name - remember that www.example.com and example.com are different names! - If set, ensure that the cookie domain and path are correct (hint: It's generally easier not to specify them) - URL canonicalization is a very good idea - have *exactly* one URL for every page, and don't let people get it by any other URL (Either redirect or give them an error if they use the wrong one). Make sure that PHP is recording errors, even ones which happen during page startup - check that there are none. Does this error happen in development and production or just in production? Mark 1)I'm not. How can I set session.use_only_cookies? 2)Right now, I'm using http://localhost/. 3)What do you mean? 4)Does it matter that the page is inside an iframe? Every page is unique. How can I check/set that? Right now, only in production. Might have to do with the domain name being http://localhost/.
  14. Hello, Thanks for the speedy replies, but I still cannot seem to get it to work. Here is one of the modules which writes the session data: <?php session_start(); ?> <?xml version="1.0"?> <!doctype html public "-//w3c//dtd xhtml 1.0 frameset//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-frameset.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <link rel=stylesheet href="center.css" type="text/css"> </head> <script language="javascript"> function LoadURL(URL) { parent.sidebar.location = URL; }; function LoadCenter(URL) { parent.center.location = URL; }; </script> <body leftmargin=0 topmargin=0 background="../images/gradient.png"> <h1> Home </h1> <?php include 'config.php'; $con = mysql_connect($dbhost,$dbuser,$dbpass); if (!$con) { die('Error Could Not Connect: '.mysql_error().'<br>'); }; mysql_select_db($dbname) or die('!!!Error Cannot Select Database '.$dbname.'<br>'); $username = $_POST['username']; $password = $_POST['password']; $query = "SELECT * from userdb"; $result = mysql_query($query); if(!result) { die('Error in FROM query: ' . mysql_error().'<br>'); }; $num = mysql_numrows($result); $i=0; $worked = false; while ($i < $num) { $dbusername = mysql_result($result, $i, "username"); $dbpassword = mysql_result($result, $i, "password"); $dbisbuyer = mysql_result($result, $i, "isbuyer"); $dbisseller = mysql_result($result, $i, "isseller"); $dbisadmin = mysql_result($result, $i, "isadmin"); if(($dbusername == $username) && ($dbpassword == $password) && ($dbisbuyer == '1')) { if($dbisbuyer == '1') $_SESSION['buyer'] = true; if($dbisseller == '1') $_SESSION['seller'] = true; if($dbisadmin == '1') $_SESSION['admin'] = true; $_SESSION['username'] = $dbusername; $_SESSION['isloggedin'] = true; $worked = true; break; }; $i++; } if($worked == true) echo "<script language='javascript'>javascript:LoadCenter('../Valid Password.html')</script>"; else echo "<script language='javascript'>javascript:LoadCenter('../Invalid Password.html')</script>"; echo $_SESSION['username']; mysql_close($con); ?> </body> </html> And here is one of the modules that reads the data: <?php session_start(); ?> <?xml version="1.0"?> <!doctype html public "-//w3c//dtd xhtml 1.0 frameset//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-frameset.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <link rel=stylesheet href="../center.css" type="text/css"> </head> <script language="javascript"> function LoadURL(URL) { parent.sidebar.location = URL; }; </script> <body leftmargin=0 topmargin=0 background="../images/gradient.png"> <h1> Buyers </h1> <?php if(isset($_SESSION['isloggedin'])) echo 'You are logged in, '.$_SESSION['username']; else echo 'You are not logged in '.$_SESSION['username']; echo $_SESSION['isloggedin']; ?> <script language="javascript">javascript:LoadURL('../Buyer Sidebar.html')</script> </body> </html> The first three lines of each were what I did in response to the previous discussion. Thanks for any assistance[smile], exorcist_bob
  15. Are cookies on by default in internet explorer?
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!