Jump to content

the_oliver

Members
  • Posts

    364
  • Joined

  • Last visited

    Never

Everything posted by the_oliver

  1. Hi, Im wondering if it is possible to have a php script that will open a file, and then if a 'phrase' exists with in it, deletes the phrase, leaving the rest of the file in tact. eg: file: "hello sdgHello Bye" Stuff to search for and remove: "sdg". (Sorry for my primitive description!) Could this be done? Would str_replace() be the right thing to use? Many thanks, - Oliver
  2. Hi, I have a function that i want to be called the first time on onblur from a text field, and form then on by onKeyUp. The code i have is: onKeyUp='if (theirUsedVall == 0) { onblur=checkTheirfields(); } else { onKeyUp=checkTheirfields(); }' And im setting "var theirUsedVall = 0" at the top of an included .js file. The problem is that it always calls the function on onKeyUp. Can any one show me where im going wong please? Many Thanks.
  3. It seems to be placing the contents of the included file, about the rest of the output... I have a template file and my snipit of php above should search through it and replace '[[body]]' with the contents of the included file. If the file does not contain a ';' its fine! If it does, the the included file appars at the top of the template, before the <HTML> tag.
  4. The majority of it is HTML.... I tried using include, but for some resion any pages with a ';' in them just print '1' instead of my content.
  5. Hi, I have a script that when called will pull in content from another page using the following: $page_content = str_replace("[[body]]",file_get_contents("pages/".$view.".".$stype),$page_content); echo $page_content; However if i have php code in the included file, its not exicuted. Can any one tell me why that would be please? Thanks!
  6. When createing the table you can create an id field setting it to use the sequence automaticatly for its next id. (no need to do this through your table every time you insert)... ALTER TABLE test ALTER id SET DEFAULT nextval('inc_test'); Then you will never need to touch it again. Alternativly you can tern on oid's in your config, and it will be done for you. The only problem with oid's is that they will not be the same if you dump and restore, or duplicat the database.
  7. Hi, Appolojies if this is not done through Javascript... I have a drop-down menu, and if a particular option is chosen i need another to apper. For any other options the second drop down box should remain hidden. Could any one suggest how i would best go about this or perhaps point me in the direction of a tutorial? Thanks!
  8. Hi, Is it posisble to have a trigger, when an update is made, set of a php or python scrip? (Script is used to open sockets and update other database) Many Thanks
  9. It sounds like apache is not correctly loading the php extention. When you restart the appache proces, is it deffinatly loading the config from the correct httpd.conf file?
  10. Hello, Im trying to build a function that will show me all the items that are in an array (called $source) but not in another (called $host), and then put the results into a third array (called $diffs). At the moment however it is showing that none of the items in the first array are in the second, when in reality the arrays are identical at present. My code is: function compare_data_sets($table,$uvalue) { global $host_pg_connection; global $source_pg_connection; $host_query = "SELECT ".$uvalue." FROM ".$table; $host_result = pg_query($host_pg_connection, $host_query); $host = pg_fetch_array($host_result); $source_query = "SELECT ".$uvalue." FROM ".$table; $source_result = pg_query($source_pg_connection, $host_query); $diffs = array(); while($data = pg_fetch_array($source_result)) { if( in_array($data[$uvalue], $host) ) { } else { $diffs[] = $data[$uvalue]; } } print_r($diffs); } Any suggestions where im going wrong? Many Thanks.
  11. Hello, I need to set up a server with two different network nics, each on a different vlan. The resion is that one is an internal network, where most of the traffic will come from. The other is an external network, used for remote management and updates. The important thing is that the box cannot route traffic from one vLan to another - but still be accessed from each vlan. Can any one point me in the right direction as to dealing with the routing table for this please? Many Thanks.
  12. Hello, Im trying to get to grips with css at the moment, but im haveing a little trouble getting a table to do what i want it to! Im trying to create a table which takes up the whole of the browser window. It should also have a 2px blue border down the right and left side, and leave no space at the top or bottom... However i get a table which fills most of the way accross, but leaves and edge, (not blue!), and does not touch the top or bottom of the page! My Code is: <style type="text/css"> <!-- body { background-color: #E6E6E6; } .main_table { background-color: #FFFFFF; border-left: 10px; border-right: 10px; border-right-color:#1A4390; border-left-colour:#1A4390; width: 100%; height: 100%; top: 0px; } --> </style></head> <body> <table class="main_table"> <tr> <td> </td> </tr> </table> Can any one point me in the right direction? Many Thanks!
  13. Hello, I have a script which people can send data to by posting from a form. This can be done from any other server. Im trying to find a way of determining the IP address of the server the form has been posted from. Can anyone suggest a good way to go about this? (I need my scrip to determine it, not have them post it as part of the form data.) Many Thanks!
  14. hello, Im trying to make to possible to connect to a mysql database from hosts other then the localhost. (actually for database replication). The problem im having is when i try to open the myslq.sock file im getting the error message (in nano) "No such device or address: mysql.sock" and vi just tells me i dont have permission to view the file. Im logged in as root, and the permissions on the file read: srwxrwxrwx 1 mysql mysql 0 Dec 8 11:45 mysql.sock Can anyone shed some light on this please? Any help would be greatly appreciated! Thanks.
  15. Hello, Im trying to build a menu using css. I would like to be able to do this by placing each menu item into a <div> tag. Eg: <div class="topMenuItem"> Hope </div> <div class="topMenuItem"> Groups </div> And the css im using for that at the moment is: div.topMenuItem{ width: auto; height: 22px; background-color: #1A5184; border-left-color: #002E64; border-left-width: medium; border-right-color: #002E64; border-right-width: medium; position: absolute; top: 51px; font-size: 13px; color: #FFFFFF; font-weight: 500; font-family: Arial; text-align: center; } This sort of works, but all of the buttons pile up on top of each other. How can i get round this? (i dont want the have to specify a left: value for each button as the number of buttons can change!) Any advice to offer? Im also wondering how i can get the text to appear in the middle (vertically) of the 22px box? Thanks!
  16. Ah yes, should have thought to post that. It looks like: file1.php file2.php file3.php etc... Thanks
  17. Hello, Im trying to find a list of all the files on a folder, and place them into an array. I have been attempting, to little avail, to do this with system(). When run, it will print to screen all of the files, but when i try to break it into and array using the following code i only get the last file in the list. Can anyone help me solve this please? <?php $arr = explode(" ", system('ls')); echo "<br><br><br>".$arr['0']."<br>".$arr['1']."<br>".$arr['2']; ?> - Thanks!
  18. Hello, Im looking to feed a string to a function which will take every word in that string, make the first letter of each word capital, and the rest lowercase. EG if fead SOME TEST it would return Some Test if fead some test it would return Some Test. However im not sure how to go about this. Can anyone offer some help please? Many Thanks
  19. Hello, I found a snippit of code, and im not sure what it does/how it works!: $code = explode("£$@", $comp_code); echo $code[0] . $i_titl . $code[1]; Where $comp_code is something like <some code>£$@</some code>. and $i_titl is a string of text. Can anyone explain a little please? Thanks
  20. It is possible, but sound unlikly. Try putting: header("Content-Type: text/html; charset=utf-8"); at the very top of the document, to see wheather its an incoding thing.
  21. Try running <?php phpinfo(); ?> and look to see wheater postgres support is installed/turned on.
  22. I think its your code. Your not giveing it the mySQL connetion details. You need someting like: $oConn = mysql_connect("dbserver","username","password"); Then change mysql_query($query) or die('Error, insert query failed'); to mysql_query($query,$oConn) or die('Error, insert query failed');; Hope that helps.
  23. Can you show us your code? It looks to me like it might be due to strange charictos in the password? It could be that they are pasting into the field, from a strange char type. Its all gues work with out the code!
  24. I have had very simmilar experiences with Vista! I woul agree with thorpe's statment that it shouldnt take you anything like that long to get use to Gentoo or Ubuntu. Personaly im a fan of CentOS, but thats just a preffrence thing. For development i actualy use a Mac. Its not windows, but has sligltly less compatability isues when it come to some apps. (not sure if thats an option for you) The partition argument that php_tom puts forwords is a good one. As the majority of web users and on a windows PC it is always good to be able to test on a windows enviroment. One of the realy nice this about linux is that if you google a problem your having you will find loads of realy good coments and tutorials, from real people, not just badly writen microsoft manuals! You sound like you like to customise your mashine, so linux sounds like the way forwords! On the other hand, there are a load of realy helpful, out of the box apps that need no configuration. I often find that prople are woried about compatability between OS's for things like swapping files, or networking with windows mashines. In reality this is rairly a problem any more. . . . So not many cons realy!
×
×
  • 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.