Jump to content

coalgames

Members
  • Posts

    23
  • Joined

  • Last visited

    Never

Everything posted by coalgames

  1. I have been thinking about this for quite a while. You first edit the php parser in that you add another function the connects with the main c++ code to return a string or something to edit the behavior of the c++ code. For example, one could make another function that operates like a header file (Move: someitem x,y). Then embed the php cli into the c++ application and call it using c++.
  2. Pulling from a database would require a lot of overhead processing the queries. You might want to make a automated script that pulls from the database and caches it into a script every 5 minutes or so. You would not want to use a database if you arent using a persistent connection.
  3. Oh ok thanks for the correction. Yeah, substr is way easier. substr((strlen($file))-1,-0); But I think pathinfo is the easiest.
  4. Tiny int would probably be faster until you have more than 10 items. But actually, on a second thought, tinyint would be good because you could index it faster.
  5. I dont get why you dont want to use substr() function. You could use regular expressions to get extension of the file. But, if you dont want to use substr() here is a way to do it $filename = 'something.wav'; $fl = strlen($filename); // File length $fileextension = $filename[$fl] . $filename[($fl-1)] . $filename[($fl-2)]; if ( $fileextension == 'wav' ) { echo 'Valid file extension'; } The downside to this is that the person could just change the extension of the file with a malicious exe inside.
  6. Also, another tip is dont use (rand() + rand() + rand()). Instead, you could concatenate it into (rand() . rand() . rand()). Adding results into a number such as 1.215972. Concatenating will turn it into 0.37496290.293623890.239672 which is more random. mysql_query("INSERT INTO chart_of_accs (hash_key, acc_hash, type, code, name, description, tax, show_exp_claims, sys_locked) VALUES ('$demo_hash', '" . md5(rand() . rand() . rand()) . "', 'r_r', '200', 'Sales', 'Income', 'gst_n', '1', '0')"); This should probably work because you are exiting text mode and using the function.
  7. I see what you mean. You are making a portal where users enter in an embed code that goes into your database then a list of videos appear on your website. You could probably use fopen() to grab the thumbnail from the youtube site.
  8. The last three errors will automatically go away once the first 5 are solved. Dont worry about the last 3 ones. < = < > = >
  9. Also, you might want to check this website: [invalid] Markup Validation of http://thesidetracked.com/ - W3C Markup Validator You might want to fix your 90 errors and 55 warnings.
  10. coalgames

    Form Help

    What gnawz is saying on using the n tag, is when you echo, use "\n" to create a new line. When printing out each row, use the \n character in double quotes: foreach ( $track_names_array as $value ) { echo $value . "\n"; } This way will have a result of : sometrack another track Beetles Track The text area will have line breaks. I hope this is what you are looking for.
  11. If you have multiple tables for different types of products, you would need to do a set of queries multiple times (once for each type of product). That may be good if you use a good cacheing system but might be slow when your website accumulates a lot of traffic. If you do all the products in one table, the number of queries will be lower therefore reducing overhead. The problem with one table is that it will become very big. The best solution in my opinion is to have different search pages. One for refrigerators, another for cameras and another for x product. If you are using mysql and will always use mysql, you should use enum('a','b','c') each representing a product. If you want your script to be portable (work on other sql applications that dont have enum), you could use CHAR(1).
  12. I feel that the built in one is not portable enough to distribute a script. Some PHP configurations have disabled the session_set_save_handler() function. Most popular and professional PHP scripts such as Wordpress and Phpbb dont use the built in sessions. Although the built in php sessions functions work fine, it would not be good on massively distributed scripts.
  13. I just finished reading the Zend one and I think that the zend one is a lot better. That one was last revised in 2003
  14. Im guessing you got this theme from online. If you want to be able to center it, you have to rewrite the whole thing.
  15. Iframes are now a bit outdated but can still work. You could use something like this (I dont guarantee it works): <a href="somepage.htm" onclick="window.parent.window.change(somepage.htm);">Click here to go to somepage</a> Also, if you are using an iframe to change a parent, then the iframe will disappear. Here is an example I found off the web showing how to use the parent page to change the iframe: Parent window's content: <b>iframe starts here</b><br><br> <iframe src='iframe1.html'></iframe> <br><br> <b>iframe ends here</b> <script type="text/javascript"> function change_parent_url(url) { document.location=url; } </script> Iframe's content: IFRAME content<br><br> <a href="javascript:parent.change_parent_url('http://yahoo.com');"> Click here to change parent URL </a>
  16. Just be patient and everything will be fixed. Google wants to help their users by providing quality content like yours. All you have to do is to just redirect the old pages and change the linking scheme.
  17. PR is a number given to your website determined by the incoming links to your website. The more links you have, the higher the number is. It is out of 10 and if your PR is higher, the websites you link to are affected. Think of it as a pail of water. Everytime you link to someone, you pour a little out to them (You actually dont lose PR). Then, people that link to you pour some water into your pail (with a damper of 85%). If you want to read more, go to wikipedia: Wikipedia's article on PageRank.
  18. Representatives of Google have released information. You should always aim for the first one but if you absolutely cant (changing old pages to new pages), just keep it as so. If you are making a new page, try to use the first one. This is the order they would prefer is: 1. www.domain.com/it-is-the-url.html 2. www.domain.com/it_is_the_url.html 3. www.domain.com/itistheurl.html
  19. This is a pretty creative idea. You could just say username: [ some form is here ] (Either your username or email).
  20. Put a sessionID in a cookie on the client. Put an ipagent hash on the server database. Ex: md5( $_SERVER['REMOTE_ADDR'] . $_SERVER['http_user_agent'] ); On each page, check if the user has a cookie that is valid (32 chars with a-z and 0-9). Then if it is valid, check against the database. If there is a match, then the person can log in. If there is no match, then the person is not logged in. This requires the use of cookies though. Good luck.
  21. I understand what you are asking for. You will probably need a javascript code to send info to the server that you are still online. Once the server detects that the user is not sending a message to the server that they are still online, delete the user. Now on deleting the cookie: Use javascript to delete the cookie on leaving the document. I have seen many scripts that say: "Are you sure you want to leave this page". You can do something similar but seamless with javascript deleting the cookie. There are some problems with this though: Some people dont have javascript enabled. Some people might end the process so cookie wont be deleted. (Not important) If you are using javascript to manipulate the cookie, you would not be able to use php's httponly part of the cookie making your application prone to xss But, this is achieveable on the server side. If the server does not get a message that the client is still online, then they will delete the row on the database. I hope this helps.
  22. There is also another guide but is a little outdated. http://www.dagbladet.no/development/phpcodingstandard/. Good luck
×
×
  • 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.