Jump to content

xsist10

Members
  • Posts

    114
  • Joined

  • Last visited

    Never

Everything posted by xsist10

  1. Asterisk VOIP: Linux Load Balancing Server: Linux File Sharing Server: Linux Network Administration: Linux Web Servers: Linux Development Machine: Linux I'm an Open PC
  2. Eclipse is pretty good too and comes with a number of plugins (like FTP, SVN and CVS support)
  3. Have you considered not? A number of companies now base their purchases on the ability to tinker with a product to integrate it into their own systems. Encoding the software and managing license will just end up giving you a headache and costing you more than you would by the additional sales you may have made off people who buy the product.
  4. Are you storing a datetime field or a timestamp field? If so you can select on that. SELECT [fields] FROM [table] WHERE [datetime_field] > NOW() - INTERVAL 24 HOUR ORDER BY [datetime_field]; If not then you're out of luck. You could potentially look at your bin logs but it would be much easier to just add a field.
  5. hyphens in a URL is completely acceptable. See http://www.w3.org/Addressing/URL/uri-spec.html for the full URI specification.
  6. You can layer another transparent div over your entire background which will prevent people getting image properties when hovering over the background. That or move to browsers that support CSS 3 exclusively.... (i.e.: burn IE and be done with it). <div id="bg"><img src="/site/background.png" width="100%" height="100%" alt=""></div> <div id="bg-layer"></div> <div id="content"><p></p></div> ... <style type="text/css"> /* pushes the page to the full capacity of the viewing area */ html {height:100%;} body {height:100%; margin:0; padding:0;} /* prepares the background image to full capacity of the viewing area */ #bg, #bg-layer {position:fixed; top:0; left:0; width:100%; height:100%;} #bg-layer {z-index: 1;} /* places the content ontop of the background image */ #content {position:relative; z-index:2;} </style>
  7. Brush up on the following studies as these will be things they will ask in an interview: Data Structures http://en.wikipedia.org/wiki/Data_structure Object Orientated Programming http://en.wikipedia.org/wiki/Object-oriented_programming Debugging Practices http://en.wikipedia.org/wiki/Debugging Software Development Processes http://en.wikipedia.org/wiki/Software_development_process Interviewed by a programmer: If you're interviewed by another programmer, your questions will be on technical related items. You'll probably be asked to do a couple of simple examples to show your knowledge of PHP. e.g.: Without using a for or foreach loop, write out all the letters of the alphabet (comma seperated). Interviewed my management: If you're interviewed by management of some form, your credentials and confidence will be a bigger feature. More reading: http://www.google.co.za/search?q=programmer+interview+questions
  8. The example on this page should help you. http://us.php.net/manual/en/function.ziparchive-getstream.php
  9. Firstly you are inserting a new record with just a grade and no stu_id. Also please escape all user input (use mysql_real_escape_string() if in doubt or cast to int if you know the value must be an integer). "INSERT INTO grade (grade, stu_id, cours_num) VALUES ('". mysql_real_escape_string($_POST[grade]) ."', '". mysql_real_escape_string($_POST[stu_id]) ."', '". mysql_real_escape_string($_POST[cours_num]) ."')"; You can also use MySQL's built in ON DUPLICATE option to save yourself some time. http://dev.mysql.com/doc/refman/5.0/en/insert-on-duplicate.html
  10. Change session_start(); $_SESSION["captchika"] = rand(100,999); $_SESSION["datika"] = getenv("REMOTE_ADDR"); if(isset($_POST['ptitle'])){ if(addslashes($_POST["captcha"]) != session_regenerate_id($_SESSION["captchika"], ENT_QUOTES)){die("You left some fields empty!");} elseif((!empty($_POST['ptitle'])) && (!empty($_POST['pcontent'])) && (!empty($_POST['pcategory']))){ if(mysql_query("INSERT INTO posts (ptitle,pcontent,pcategory,pdate) VALUES ('".addslashes($_POST['ptitle'])."','".addslashes($_POST['pcontent'])."','".addslashes($_POST['pcategory'])."','".$_SESSION["datika"]."')")){echo" Posted! ";} //header("Location: ".$site_path.""); }else{echo"You have entered the wrong number!";} } echo '<br /><form method="post"> Title:<br /> <input type="text" size="50" name="ptitle" /> <button type="submit">Post</button><br /><br /> Category:<br /> <select name="pcategory"> <option value="Chat">Chat</option> <option value="Help">Help</option> <option value="Tutorial">Tutorial</option> <option value="BuySell">BuySell</option> <option value="Request">Request</option> </select><br /><br /> Content:<br /> <textarea name="pcontent" cols="50" rows="7"></textarea><br /> Enter This Number: '.$_SESSION["captchika"].' <input type="text" name="captcha" /><br /> </form><br />'; to session_start(); if(isset($_POST['ptitle'])){ if(addslashes($_POST["captcha"]) != session_regenerate_id($_SESSION["captchika"], ENT_QUOTES)){die("You left some fields empty!");} elseif((!empty($_POST['ptitle'])) && (!empty($_POST['pcontent'])) && (!empty($_POST['pcategory']))){ if(mysql_query("INSERT INTO posts (ptitle,pcontent,pcategory,pdate) VALUES ('".addslashes($_POST['ptitle'])."','".addslashes($_POST['pcontent'])."','".addslashes($_POST['pcategory'])."','".$_SESSION["datika"]."')")){echo" Posted! ";} //header("Location: ".$site_path.""); }else{echo"You have entered the wrong number!";} } $_SESSION["captchika"] = rand(100,999); $_SESSION["datika"] = getenv("REMOTE_ADDR"); echo '<br /><form method="post"> Title:<br /> <input type="text" size="50" name="ptitle" /> <button type="submit">Post</button><br /><br /> Category:<br /> <select name="pcategory"> <option value="Chat">Chat</option> <option value="Help">Help</option> <option value="Tutorial">Tutorial</option> <option value="BuySell">BuySell</option> <option value="Request">Request</option> </select><br /><br /> Content:<br /> <textarea name="pcontent" cols="50" rows="7"></textarea><br /> Enter This Number: '.$_SESSION["captchika"].' <input type="text" name="captcha" /><br /> </form><br />';
  11. Then just change the GROUP to use the forum id on the forum table and use an IF_NULL to populate the topic fields [edit: and use a LEFT JOIN]. e.g.: SELECT [Fields ... ], IFNULL(t.subject, 'No topics found') FROM forumforums f LEFT JOIN forumtopics t ON (f.id = t.forumid) GROUP BY f.id ORDER BY t.replytime DESC
  12. Try this [from www.php.net/uniqid] $key = md5(uniqid(mt_rand(), true));
  13. Have you tried grouping on the ForumId. That might give you the result you want. Try this: SELECT [Fields] FROM forumforums f JOIN forumtopics t ON (f.id=t.forumid) GROUP BY t.forumid ORDER BY t.replytime DESC
  14. Would it be worthwhile to create an entire database for a blogger who writes maybe 1 blog entry a month? It will be a lot easier if you create 1 database and add a field to your table that maps to an author. i.e.: CREATE TABLE author ( id int(11) unsigned not null auto_increment, name varchar(60) not null default '', PRIMARY KEY (id) ); CREATE TABLE blog_entry ( id int(11) unsigned not null auto_increment, author_id int(11) unsigned not null default 0, title varchar(100) not null default '', content text, created datetime, PRIMARY KEY (id), INDEX author_id (author_id) ); # This will get the last 10 blog entries with their author names SELECT e.title, e.content, a.name FROM blog_entry e JOIN author a ON (e.author_id = a.id) ORDER BY e.datetime DESC LIMIT 10; # This will get the last 10 blog entries for a particular author (by name) SELECT e.title, e.content, a.name FROM blog_entry e JOIN author a ON (e.author_id = a.id) WHERE a.name = "[Authors Name]" ORDER BY e.datetime DESC LIMIT 10;
  15. You might find your CSS file was caching on the client side so it didn't reflect the changes you'd made on the server. Try refreshing your Firefox pages using Ctrl + F5. That should tell the browser to scrap any cached files and re-request them.
  16. I threw that together on my side in a test and it seems to work fine. The most common problem I have with css is order of style precedence. Try this: * Install "Web Developer" plugin for Firefox * Go to "Tools" -> "Web Developer" -> "CSS" -> "View Style Information" * Click on your Bike link This should give you a window showing the CSS styles being applied to the link and the order it is applied in. You might find you have a conflicting style that is over-riding your custom styling (e.g.: global styling). Post the result here if you still have problems.
  17. List what browsers you have tested this in please.
  18. Another option is to provide a lower quality mp3 as a preview of the higher quality one. That way the listener gets a feel for the music, but won't really get a crystal clear sound. Possible settings: High quality: 192 kbit/s Sample/preview quality: 96 kbit/s
  19. Sorry I had an out of place parenthesis. Corrected. function str_limit($str) { return (strlen($str) > 20 ? substr($str, 0, 20) .".." : $str); } $partname = str_limit($partname);
  20. You need to echo out $partname. The function just returns the shorted string. It doesn't echo it.
  21. xsist10

    Cron

    If you're going to run a PHP script from crontab please remember that your "command to be executed and arguments" should look like this [code]/usr/bin/php -f /full/path/to/phpfile.php[/code] And remember to use absolute paths in your scheduled code.
  22. Sounds like added complexity... A better solution is to have the last option in the drop down list be "Other" and then have a javascript event that un-hides the text input box if the person selects "Other" which allows them to add the agents name.
  23. Here's a slight rework that should work <?php $options = array(1 => "Afrikaans","Albanian","Arabic","Armenian","Bangla","Bosnian","Bulgarian","Burmese","Catalan","Cebuano","Chinese","Croatian","Czech","Danish","Dutch","English","Esperanto","Estonian","Finnish","French","Gaelic","German","Greek","Hebrew","Hindi","Hungarian","Icelandic","Indonesian","Italian","Japanese","Korean","Kurdish","Latin","Latvian","Lithuanian","Luxembourgish","Macedonian","Malay","Norwegian","Persian","Polish","Portuguese","Romanian","Romansh","Russian","Serbian","Sign Language","Slovak","Slovenian","Sorbian","Spanish","Swedish","Swiss German","Tagalog","Thai","Turkish","Ukrainian","Welsh"); $selections = ($_POST['languages'] ? $_POST['languages'] : array()); function checkList($options, $selections, $name) { echo "<div style='width:500px;height:200px;overflow:auto;margin-bottom:7px; padding:0'>"; foreach ($options as $key => $value){ echo "<input id='". $name . $key ."' name='". $name ."[]' type='checkbox' value='". $key ."' ". (in_array($key, $selections) ? "checked" : "") .">"; echo "<label for='". $name . $key ."'>$value</label><br />\n"; } echo "</div>"; } ?> <form method='post'> <?php checkList($options, $selections, 'languages'); ?> <input type='submit'> </form>
×
×
  • 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.