Jump to content

coalgames

Members
  • Posts

    23
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

coalgames's Achievements

Newbie

Newbie (1/5)

0

Reputation

  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>
×
×
  • 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.