Jump to content

blackcell

Members
  • Posts

    439
  • Joined

  • Last visited

Everything posted by blackcell

  1. I am taking C at college now but haven't got into much of anything besides arithmetic and changing output/input Also the graphical presentation of what I know how to do in C is unappealing. In other words I don't know much about manipulating the graphical side of C yet. Do you have any good resource recommendations on learning sockets in php? Everything I have seen is usually in linux and makes no sense as to what they are doing (to me)
  2. Try using variables for your table data first. It helps to organize. <?php $userName = $row[user_Name]; //ETC etc... ?> If your going to echo each table row, I would suggest making it look something like this: <?php echo "<tr>"; echo "<td>" . $userName . "</td>"; echo "<td>" . $userID . "</td>"; echo "<td>" . $StaffID. "</td>"; . . yada yada . . echo "</tr>"; ?> Are you receiving any errors or is the data not displaying? I don't know what your showError(); function does but I would suggest: mysql_select_db('itsupport', $conn) or die("Could not select database:<br>" . mysql_error()); Until you get the feel for things unless your showError() function is more detailed. Use the or die("blah blah" . mysql_error()) after everything.
  3. That is a big question. Are you anywhere on it or do you need help all the way from building the sql statement and executing?
  4. I'm not understanding sockets very well. Actually I just can't find a good example because I don't know what to look for. I see people doing stuff with sockets but not chat implementation or anything I can relate to.
  5. The send bar is in a seperate iframe. Here is what it looks like but I want the display frame to be on the top.
  6. Well, I am using php and ajax to create a chat script. I want the send bar to be at the bottom and the display to be up top. Now, if the chatlog becomes larger than the frame (it will eventually) I want the old to go to the top.
  7. //index.html <iframe src="top.php"> <---- Needs the table aligned to the bottom of the iframe or actually to the bottom of top.php (see below). //top.php <table align="left" width="100%" border="0"> <tr > <td ><div id="target"></div></td> //<--- I need this table to load at the bottom of the page. </tr> </table>
  8. Well actually I don't even want to record. I am looking for the best method of doing it. To expand more, I am creating a "plug-in" type script using an inline frame. The main target is a turn based php game. I need to make this to where it will only return chat history from current time entered to the time you left a certain location. So I want to have it to where chat history is kept for the user and when the user moves into a new region, they keep their history and start to receive chat from the region they are in. This is my first attempt at making a chat script by the way.
  9. I can't get a table to valign="bottom" correctly. It ignores the tag or something. Anybody know of any tricks?
  10. Is it a good idea to use a database for a chat script? To store the messages and so on? I don't know if there would be issues with multiple users trying to access the data at once. I wrote a simple chat script and it works great if two people use it. I just don't know how it will perform with hundreds even thousands chatting at once, accessing the same db table. I use xajax to display the chat log so it you can count on every user sending a query every 1000 ms or 1 second. Could this cause problems? Thanks in advance.
  11. Or you could: <?php //debug.inc.php $DEBUG = $_REQUEST['DEBUG']; if$($DEBUG == ""){ $DEBUG = 0; }else{ $DEBUG = 1; } ?> <?php //index.php include("debug.inc.php"); if($DEBUG)echo "[This is will display if index.php?DEBUG=1] <br>"; ?>
  12. Sorry for the "grab" terminology. <?php $StoredGrab = $_SESSION['SOMETHINGTOGRAB']; ?> These files are stored on the server, ok. Does that mean User2 can access the contents of $_SESSION['SOMETHING'] stored by USER99? Furthermore, can you have a multi-dimensional array when it comes to $_SESSION ? For example: $_SESSION['USERKEY']['CAT1']['DATA1'] $_SESSION['USERKEY']['CAT1']['DATA2']
  13. How hard is it for someone to grab your scripts $_SESSION and $_REQUEST variables? I wonder not in the interest of hacking but in the interest of preventative scripting. I want to start making my code more secure but I have no idea how to do anything malicious or mischievous with php so I don't know how to protect things.
  14. Yea sorry, I wasn't even thinking about the bordercolor lol!
  15. Thanks man, I forgot to mark this solved. Thanks for going out of your way to help though.
  16. Another suggestion to think about: <?php $borderColor = "#000000"; if($error)$borderColor = "#FF0000"; ?> <html> . . <td bordercolor="<?php echo $borderColor ?>"> Stuff </td> . . </html>
  17. It is fine to use quotes I just wanted to know what causes it not to work. I wanted to use constants so that there would be a standard index for every value. This will eventually be a more than one person project that deals heavily with loading a users values from a database into session variables. I wanted to make it so that everyone would know which values to use based on constants and they could reference a particular page to find that name. So its no biggy. I thought it looked cooler to (lame I know)
  18. I have an xajax(http://community.xajaxproject.org/) function that basically reads values from a database. I have a javascript function that uses setTimeout to restart the function every 1000 ms. The thing that is annoying is when your hovering the mouse on the page, the mouse cursor blinks to an hour glass and back. Everything works fine but it is annoying. I know it can be done to where this won't happen because of a W3C example at: http://www.w3schools.com/js/tryit.asp?f … ming_clock Anybody know what is happening or the science behind it?
  19. I think it may be near to or impossible, and it is all due to the security risk.
  20. Ok cool, now I am using this to store sessions variables now. I was using: <?php //Used to ensure uniqueness while moving through the site. $tier1 = 0; define("GSID",$tier1); define("USER",$tier1++); define("INFO1",$tier1++); define("INFO_SO_ON",$tier1++); //Then I the user will log on "code is not here" //session_start(); happens at the beginning of every page. //index.php $queriedUID = 1; //For example $_SESSION[GSID] = $queriedUID; //<----This DOES NOT work. $_SESSION['GSID'] = $queriedUID; //<----This WORKS //I am not passing any variables through the URL //main.php echo $_SESSION[GSID]; //<----This DOES NOT work. echo $_SESSION['GSID'];//<----This WORKS ?> Point being I am trying to define constants as number and increment those numbers. As I list it through the definition of the constant.This way I do not have to bother with organization but I know everything is unique, therefore I can call something in the $_SESSION array with something a little easier to remember in the Index. Some reason this isn't working but if I use just words in quotes the way it is done most of the time, it works. You might be saying why not just use the words? Well when I use defined constants it can be rolled into one file, and provide a reference point instead of digging through lines of code to see what I used for something.
  21. Found it i think. I guess you can't use defined constants for the $_SESSION array index. Instead of $_SESSION[GSID] I used $_SESSION['GSID'] and it worked fine.
  22. Now I got it to recognize something but it is returning Array. I check the $_SESSION[GSID] and echo it before I leave the login page and I get the correct integer. As I go to the validate code segement it returns Array. What gives?
  23. Wow, never knew I was doing so many things wrong. What is this though? Notice: Unknown: Skipping numeric key 1. in Unknown on line 0
×
×
  • 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.