Search Results

Search found 37 results on 2 pages for 'sologhost'.

Page 1/2 | 1 2  | Next Page >

  • Looking for a good Web Server that is cheap

    - by SoLoGHoST
    I am a Project Manager, and former Lead Developer for a software portal system that requires a forum software to run. I am in need of a server that is cheap, reliable, and supports the latest PHP (5.2+), MySQL, unlimited e-mails (preferably), a cPanel, multiple sub-domains (atleast 3+). Currently I am paying $34.95 USD/month (approx. $420 USD/year). This is too high for me to pay to keep the site running. I just recently became Project Manager and in charge of Finances and I'm extremely concerned for the future of Dream Portal. With those prices I'm not sure I'll be able to keep it running for too long. Can someone please tell me of a good server that meets all of the requirements that I listed above that is cheaper on a yearly basis? Note: Currently on a Dedicated Server with limited disk space at 15000 MB (15 GB), monthly bandwidth = 500000 MB, 50 emails limit, 20 sub-domains limit, 30 FTP accts., and 25 SQL Databases.

    Read the article

  • Looking for Team Development type Software like SVN

    - by SoLoGHoST
    I am in need of a software that is PHP-Based, or similar that can be installed on my server that doesn't offer SVN Perks. It should be somewhat similar to an SVN, however, since the server doesn't support SVN, we'll need another means of doing sort of the same thing. We have a team of Developers and need to accomplish progress in the same way that an SVN does, but without that type of server support. Is there any software that could be installed via webhosting that would be somewhat, if not exactly, similar to an SVN? Please help, Thanks :)

    Read the article

  • Hide directory contents from showing when accessing the URL directly

    - by SoLoGHoST
    On my site, if you browse to http://example.com/images/ the contents of the entire directory are shown like so: How can I make it so that this doesn't show up when people browse directly to http://example.com/images/? Can I create an .htaccess file in that directory? Or is there a better way? I really don't want people being able to do this for the entire site (i.e. every directory on that site). What can I do to prevent this? I figure it's either something that has to be done in Apache or using an global .htaccess file and placing it in the public_html folder perhaps? EDIT I diverted this using an index.php file, but I still feel that security is an issue here, how can I fix this permanently?

    Read the article

  • Sorting a Multidimensional array...

    - by sologhost
    I need to sort an array that can look like this: $array[4][0] = array('id' => 1, 'value' => 2); $array[3][2] = array('id' => 0, 'value' => 3); $array[4][1] = array('id' => 1, 'value' => 0); $array[1][3] = array('id' => 2, 'value' => 1); $array[1][1] = array('id' => 3, 'value' => 0); $array[3][0] = array('id' => 2, 'value' => 1); $array[3][1] = array('id' => 1, 'value' => 0); $array[1][2] = array('id' => 3, 'value' => 2); $array[1][0] = array('id' => 2, 'value' => 1); $array[2][1] = array('id' => 0, 'value' => 2); $array[2][4] = array('id' => 3, 'value' => 1); But needs to be sorted and returned as this: $array[1][0] = array('id' => 2, 'value' => 1); $array[1][1] = array('id' => 3, 'value' => 0); $array[1][2] = array('id' => 3, 'value' => 2); $array[1][3] = array('id' => 2, 'value' => 1); $array[2][1] = array('id' => 0, 'value' => 2); $array[2][4] = array('id' => 3, 'value' => 1); $array[3][0] = array('id' => 2, 'value' => 1); $array[3][1] = array('id' => 1, 'value' => 0); $array[3][2] = array('id' => 0, 'value' => 3); $array[4][0] = array('id' => 1, 'value' => 2); $array[4][1] = array('id' => 1, 'value' => 0); Can anyone help me? It needs to sort both indexes of the array from lowest to highest index value. Sounds simple enough, but I'm having the hardest time trying to figure this out, while still keeping the values intact. Please help someone...

    Read the article

  • nextSibling issue, again... sorry...

    - by SoLoGHoST
    Ok, I am using insertRow to insert a TR element into a table, but for some reason it doesn't count that inserted TR element as a sibling of the others when I do nextSibling on it. For example, consider the following table. <table id="myTable"> <tr id="row_0"> <td colspan="3">Row 1</td> </tr> <tr id="tr_0_0"> <td>Option 1</td> <td>Option2</td> <td>Option 3</td> </tr> <tr id="tr_0_1"> <td>Option 1</td> <td>Option 2</td> <td>Option 3</td> </tr> </table> So after I do this: var lTable = document.getElementById("myTable"); var trEle = lTable.insertRow(-1); trEle.id = "tr_0_2"; var cell1 = trEle.insertCell(0); cell1.innerHTML = "Option 1"; var cell2 = trEle.insertCell(1); cell2.innerHTML = "Option 2"; var cell3 = trEle.insertCell(-1); cell3.innerHTML = "Option 3"; Then I use this approach to get all of the siblings, but it NEVER gives me the last sibling in here, but ONLY if it's been added via insertRow, because it gets all nextSiblings just fine, but once I add a sibling via insertRow it never gives me that last Sibling, argggg.... var tempTr = document.getElementById("row_0"); var totalSibs = 0; while(tempTr.nextSibling != null) { var tempId = tempTr.id; // If no id, not an element, or not a tr_0 id. if (!tempId || tempTr.nodeType != 1 || tempId.indexOf("tr_0") != 0) { tempTr = tempTr.nextSibling; continue; } // This NEVER ALERTS the last id of the row that was inserted using insertRow, arggg. alert(tempId); totalSibs++; tempTr = tempTr.nextSibling; } So, totalSibs should return 3 because after I inserted the row, there should be 3 Siblings, but instead returns 2 and never counts the 3rd Sibling.... arggg. Can someone please help me here?? Thank a lot, you guys/gals are Awesome!

    Read the article

  • Alternative to array_shift function

    - by SoLoGHoST
    Ok, I need keys to be preserved within this array and I just want to shift the 1st element from this array. Actually I know that the first key of this array will always be 1 when I do this: // Sort it by 1st group and 1st layout. ksort($disabled_sections); foreach($disabled_sections as &$grouplayout) ksort($grouplayout); Basically I'd rather not have to ksort it in order to grab this array where the key = 1. And, honestly, I'm not a big fan of array_shift, it just takes to long IMO. Is there another way. Perhaps a way to extract the entire array where $disabled_sections[1] is found without having to do a foreach and sorting it, and array_shift. I just wanna add $disabled[1] to a different array and remove it from this array altogether. While keeping both arrays keys structured the way they are. Technically, it would even be fine to do this: $array = array(); $array = $disabled_sections[1]; But it needs to remove it from $disabled_sections. Can I use something like this approach... $array = array(); $array = $disabled_sections[1]; $disabled_sections -= $disabled_sections[1]; Is something like the above even possible?? Thanks.

    Read the article

  • preg_replace, exact opposite of a preg_match

    - by SoLoGHoST
    I need to do a preg_replace for the exact opposite of this preg_match regular expression: preg_match('#^(\w+/){0,2}\w+\.\w+$#', $string); So I need to replace all strings that are not valid with an empty string - '' So it needs to remove the first / and last / if found, and all non-valid characters, that is the only valid characters are A-Z, a-z, 0-9, _, ., and / (if it's not the first or last characters of the string). How can I accomplish this with the preg_replace? Thanks :)

    Read the article

  • ZipArchive php Class - Does it support all servers?

    - by SoLoGHoST
    Ok, just wondering on the versions of PHP that this class is built into. And if they are built into all platforms (OS's). I'm wanting an approach to search through a zip file and place files using file_put_contents in different filepaths within the webroot. In any case, I'm familiar with how to do this with the ZipArchive class, but I'm wondering if using this class would be a good solution and support MOST, if not ALL servers?? I mean, I'd rather not use a method that requires the Server to have it installed. I'm looking for a solution to this that will support at least MOST servers without having to install the class... Thanks :) Also, I'd like to support opening tar.gz and/or .tgz files if possible, but I don't think the ZipArchive class supports this, but perhaps a different built-in php class does??

    Read the article

  • Need to add an array into another array at a specified key value

    - by sologhost
    Ok, I have an array like so, but it's not guaranteed to be laid out in this order all of the time... $array = array( 'sadness' => array( 'info' => 'some info', 'info2' => 'more info', 'value' => 'value', ), 'happiness' => array( 'info' => 'some info', 'info2' => 'more info', 'value' => 'the value', ), 'peace' => array( 'info' => 'some info', 'info2' => 'more info', 'value' => 'the value', ) ); Ok, and I'd like to throw in this array right after the happiness key is defined. I can't use the key of "peace" since it must go directly after happiness, and peace might not come after happiness as this array changes. So here's what I need to add after happiness... $another_array['love'] = array( 'info' => 'some info', 'info2' => 'more info', 'value' => 'the value of love' ); So the final output after it gets inputted directly after happiness should look like this: $array = array( 'sadness' => array( 'info' => 'some info', 'info2' => 'more info', 'value' => 'value', ), 'happiness' => array( 'info' => 'some info', 'info2' => 'more info', 'value' => 'the value', ), 'love' => array( 'info' => 'some info', 'info2' => 'more info', 'value' => 'the value of love', ), 'peace' => array( 'info' => 'some info', 'info2' => 'more info', 'value' => 'the value', ) ); Can someone please give me a hand with this. Using array_shift, array_pop, or array_merge doesn't help me at all, since these go at the beginning and at the end of the array. I need to place it directly after a KEY position within $array. Thanks :)

    Read the article

  • Thoughts on a Shoutbox anyone?

    - by sologhost
    I'm wanting to create a shoutbox, though I'm wondering if there is another way to go about this rather than using setInterval to query the database for new shouts every number of seconds. Honestly, I don't like having to go about it this way. Seems a bit redundant and repetitive and just plain old wrong. Not to mention the blinking of the shouts as it grabs the data. So I'm wondering on how the professionals do this? I mean, I've seen shoutboxes that work surperb and doesn't seem to be using any setInterval or setTimeout javascript functions to do this. Can anyone suggest any ideas or an approach to this that doesn't use setInterval or setTimeout?? Thanks :)

    Read the article

  • Array Problem, need to sort via Keys

    - by sologhost
    Ok, not really sure how to do this. I have values that are being outputted from a SQL query like so: $row[0] = array('lid' => 1, 'llayout' => 1, 'lposition' => 1, 'mid' => 1, 'mlayout' => 1, 'mposition' => 0); $row[1] = array('lid' => 2, 'llayout' => 1, 'lposition' => 0, 'mid' => 2, 'mlayout' => 1, 'mposition' => 0); $row[2] = array('lid' => 2, 'llayout' => 1, 'lposition' => 0, 'mid' => 3, 'mlayout' => 1, 'mposition' => 1); $row[3] = array('lid' => 3, 'llayout' => 1, 'lposition' => 1, 'mid' => 4, 'mlayout' => 1, 'mposition' => 1); $row[4] = array('lid' => 4, 'llayout' => 1, 'lposition' => 2, 'mid' => 5, 'mlayout' => 1, 'mposition' => 0); etc. etc. Ok, so the best thing I can think of for this is to give lid and mid array keys and have it equal the mposition into an array within the while loop of query like so... $old[$row['lid']][$row['mid']] = $mposition; Now if I do this, I need to compare this array's keys with another array that I'll need to build based on a $_POST array[]. $new = array(); foreach($_POST as $id => $data) { // $id = column, but we still need to get each rows position... $id = str_replace('col_', '', $id); // now get the inner array... foreach($data as $pos => $idpos) $new[$id][$idpos] = $pos; } Ok, so now I have 2 arrays of info, 1 from the database, and another from the $_POST positions, I hope I got the array keys correct. Now I need to figure out which one's changed, comparing from the old to the new. And also, need to update the database with all of the new positions where new lid = the old lid, and the new mid = the old mid from each array. I'm sure I'll have to use array_key or array_key_intersect somehow, but not sure exactly how...??? Also, I don't think an UPDATE would be useful in a foreach loop, perhaps there's a way to do a CASE statement in the UPDATE query? Also, Am I going about this the right way? OR should I do it another way instead of using a muli-dimensional array for this.

    Read the article

  • Calculate # of Rowspans and Colspans based on keys in a Multi-Array

    - by sologhost
    Ok, I have these 2 types of layouts, basically, it can be any layout really. I have decided to use tables for this, since using div tags cause undesirable results in some possible layout types. Here are 2 pics that describe the returned results of row and column: This would return the $layout array like so: $layout[0][0] $layout[0][1] $layout[1][1] In this layout type: $layout[1][0] is NOT SET, or doesn't exist. Row 1, Column 0 doesn't exist in here. So how can we use this to help us determine the rowspans...? Ok, this layout type would now return the following: $layout[0][0] $layout[0][1] $layout[1][0] $layout[2][0] $layout[2][1] $layout[3][1] Again, there are some that are NOT SET in here: $layout[1][1] $layout[3][0] Ok, I have an array called $layout that does a foreach on the row and column, but it doesn't grab the rows and columns that are NOT SET. So I created a for loop (with the correct counts of how many rows there are and how many columns there are). Here's what I got so far: // $not_set = array(); for($x = 0; $x < $cols; $x++) { $f = 0; for($p = 0; $p < $rows; $p++) { // $f = count($layout[$p]); if(!isset($layout[$p][$x])) { $f++; // It could be a rowspan or a Colspan... // We need to figure out which 1 it is! /* $not_set[] = array( 'row' => $p, 'column' => $x, ); */ } // if ($rows - count($layout[$p])) } } Ok, the $layout array has 2 keys. The first 1 is [ row ] and the 2nd key is [ column ]. Now looping through them all and determining whether it's NOT SET, tells me that either a rowspan or a colspan needs to be put into something somewhere. I'm completely lost here. Basically, I would like to have an array returned here, something like this: $spans['row'][ row # ][ column # ] = Number of rowspans for that <td> element. $spans['column'][ row # ][ column # ] = Number of colspans for that <td> element. It's either going to need a colspan or a rowspan, it will definitely never need both for the same element. Am I going about this whole thing the wrong way? Any help at all would be greatly appreciated!! I've been driving myself crazy with this for days! Pllleaase...

    Read the article

  • Multi-Array of XML Requests

    - by sologhost
    OMG, I am in need of a way to set up arrays of XML Requests based on the idShout - 1. So it would be something like this... var req = new Array(); req[idShout - 1] = ALL XML Data... Here's what I got so far but it's not working at all :( var idShout; var req = new Array(); function htmlRequest(url, params, HttpMethod) { req[req.push] = ajax_function(); for (i=0;i<req.length;i++) { if (req[i]) { if (HttpMethod == "GET") { req[i].onreadystatechange = function() { if (req[i].readyState != 4) return; if (req[i].responseText !== null && req[i].status == 200) { document.getElementById("shoutbox_area" + idShout).innerHTML = req[i].responseText; } } } req[i].open(HttpMethod,url,true); if (HttpMethod == "POST") req[i].setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); if (params == "") req[i].send(null); else req[i].send(params); return req[i]; } else return null; } } function ajax_function() { var ajax_request = null; try { // Opera 8.0+, Firefox, Safari ajax_request = new XMLHttpRequest(); } catch (e) { // IE Browsers try { ajax_request = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { ajax_request = new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) { //No browser support, rare case return null; } } } return ajax_request; } function send() { var send_data = "shoutmessage=" + document.getElementById("shout_message" + idShout).value; var url = smf_prepareScriptUrl(smf_scripturl) + "action=dreamaction;sa=shoutbox;xml;send_shout="+ idShout; htmlRequest(url, send_data, "POST"); document.getElementById("shout_message" + idShout).value = ""; document.getElementById("shout_message" + idShout).focus(); return true; } function startShouts(refreshRate, shoutCount) { clearInterval(Timer[shoutCount-1]); idShout = shoutCount; show_shouts(); Timer[shoutCount - 1] = setInterval("show_shouts()", refreshRate); return; } function show_shouts() { var url = smf_prepareScriptUrl(smf_scripturl) + "action=dreamaction;sa=shoutbox;xml;get_shouts=" + idShout; htmlRequest(url, "", "GET"); } Any help at all on this would be greatly appreciated... Basically, I'm setting the Timer Arrays in a different function before this, and I call startShouts which is supposed to show all of the information, but startShouts gets called more than once, which is why I have idShout set to equal shoutCount. So it will go something like this: shoutCount = 1, shoutCount = 2, shoutCount = 3, everytime it is being called. So I set the req[idShout - 1] array and it should return the result right?? Well, I get no errors in Firefox in the error console with this code above, but it doesn't work... Any ideas anyone?? As it needs to output into more than 1 area... argg. Thanks for any help you can offer here :) Thanks guys :)

    Read the article

  • nextSibling issues...

    - by SoLoGHoST
    Ok, this has been killing me all night, I mean I've been working on this code for atleast 8 hours now. What is the problem with this, argggg. I am trying to update all <span id="column_[some number]"> to increment it by one after the next id="row_" tr element, but for some god knows what reason, it gives me issues. It's updating the same <span> tag 2x, and this changes it from the desired value to 1 more than it should be... argggg. Here's my code someone please help me here... // Reorder all columns, if any, in the other rows after this 1. if (aRowId != 0 && lId.indexOf("tr_" + aRowId) == 0 && rowComplete != aRowId) { var tempTr = lTable.childNodes[i].childNodes[p]; while(tempTr.nodeType == 1 && tempTr.nextSibling != null) { var tempId = tempTr.getAttribute("id"); if (!tempId) continue; if (tempId.indexOf("row_") == 0) { // All done this row, set it to completed! rowComplete = aRowId; break; } if (tempTr.hasChildNodes) { var doneChilds = false; // grab the id where tdcolumn_{aRowId}.indexOf = 0. for (fcTd = 0; fcTd<tempTr.childNodes.length; fcTd++) { if (tempTr.childNodes[fcTd].nodeName == '#text') continue; var tempfcId = tempTr.childNodes[fcTd].getAttribute("id"); if (!tempfcId) continue; if (tempfcId.indexOf("tdcolumn_" + aRowId) != 0) continue; // looping through the children in the <td> element here. if (tempTr.childNodes[fcTd].hasChildNodes) { for (x = tempTr.childNodes[fcTd].childNodes.length-1; x>0; x--) { if (tempTr.childNodes[fcTd].childNodes[x].nodeName == '#text') continue; var tempSpanId = tempTr.childNodes[fcTd].childNodes[x].getAttribute("id"); if (!tempSpanId) continue; if (tempSpanId.indexOf("column_") != 0) continue; // alert(tempSpanId); alert(tempTr.childNodes[fcTd].childNodes[x].nodeName); var tSpanId = new Array(); tSpanId = tempSpanId.split("_"); if (currColumnId == 0) { currColumnId = parseInt(tSpanId[1]); var incCol = currColumnId; } incCol++; // alert("currColumnId = " + currColumnId + "\n\ntSpanId[1] = " + tSpanId[1] + "\n\nincCol = " + incCol); // Set the new Id's and Text, after which we can exit the for loop. tempTr.childNodes[fcTd].childNodes[x].setAttribute("id", "column_" + incCol); tempTr.childNodes[fcTd].childNodes[x].setAttribute("class", "dp_edit_column"); tempTr.childNodes[fcTd].childNodes[x].innerHTML = oColumnText + " " + incCol; // tempTr.childNodes[fcTd].setAttribute("id", "tdcolumn_" + aRowId + "_" + (parseInt(tSpanId[1])+1) + "_" + tSpanId[3]); doneChilds = true; break; } } else continue; if (doneChilds = true) continue; } } else continue; tempTr = tempTr.nextSibling; } } Please help me, thanks.

    Read the article

  • Problem inserting parameters into a function

    - by SoLoGHoST
    Ok, I am trying to place parameters into a function that is called like so: $parameters['function']($parameters['params']); Here is the function and the parameters that I need to be placed into this: $parameters['function'] = 'test_error'; $parameters['params'] = array(0 => $txt['sometext'], 1 => 'critical', 2 => true); The test_error function takes 3 parameters: The error to output The type of error noted within a string value ('general', 'critical', etc. etc.). Whether it should be echoed or not. Here is the output I get: Here is a test error.ArraycriticalArray1 I know this function works perfect, but it only gives me the 1st parameter returned from it. What am I doing wrong here with the $parameters['params']??

    Read the article

  • Removing $_SESSION['layout']['action'] globally from all users!

    - by sologhost
    Ok, I am storing a session variable like so to load up users layouts faster if it's set instead of calling the database. But since the layout can be changed via the Administrator, I'd like to be able to globally remove all sessions where $_SESSION['layout']['action'] is set for all users. $_SESSION['layout']['action'] = array(a ton of indexes and mulit-dimensional arrays); Now, I know it's being stored into my database sessions table, there's a column for session_id, last_update, and data. So, question I have is how to remove that session array key ['action'] from all users. Using $_SESSION = array(); session_destroy(); Does not work. Basically, session_start() is being loaded on every page load, so I just want to remove all ['action'] keys from ['layout']. Is this possible to do? Thanks

    Read the article

  • Problem with multiple select removing more than 1 option

    - by SoLoGHoST
    Ok, there seems to be a problem with the JS Code for Opera browsers, as it only removes the last option tag that is selected within a multiple select tag, can someone please help me. Here is the HTML for this: <select id="actions_list" name="layouts" multiple style="height: 128px; width: 300px;"> <option value="forum">forum</option> <option value="collapse">collapse</option> <option value="[topic]">[topic]</option> <option value="[board]">[board]</option> </select> Ofcourse it's within a form tag, but there's a ton more code involved with this form, but here is the relevant info for this. Here is the JS that should handle this, but only removes the last selected option in Opera, not sure about other browsers, but it really needs to remove all selected options, not just the last selected option... argg var action_list = document.getElementById("actions_list"); var i = action_list.options.length; while(i--) { if (action_list.options[i].selected) { action_list.remove(i); } } What is wrong with this? I can't figure it out one bit :( Thanks :)

    Read the article

  • preg_match problem.

    - by SoLoGHoST
    How do I add the character - within the preg_match? preg_match('#^(\w+/){0,2}\w+\.\w+$#', $string) But it must be before the . within string. I've tried just about everything I know here. I know that the - needs to be escaped. So I tried to escape it in various places, but it's not working :( Thanks :)

    Read the article

  • preg_match for <?php, <?, and/or ?>

    - by SoLoGHoST
    Hello guys, I'm not very familiar with regEx's and I'm trying to find a preg_match regex for searching for any of the following strings within a file and if found it will halt it. I already have the fopen and fgets setup I just need to use a regex inside of a preg_match for the following php tags: <?php <? ?> Thanks for your help with this :)

    Read the article

  • Change values in first key from 0 to count(array) - 1

    - by sologhost
    Ok, I have an array like so: $myArray[32]['value'] = 'value1'; $myArray[32]['type'] = 'type1'; $myArray[33]['value'] = 'value2'; $myArray[33]['type'] = 'type2'; $myArray[35]['value'] = 'value3'; $myArray[42]['value'] = 'value4'; $myArray[42]['type'] = 'type4'; Ok, looking for a quick way to change all numbers in the first key 32, 33, 35, and 42 into 0, 1, 2, and 3 instead. But I need to preserve the 2nd key and all of the values. The array is already ordered correctly, since I ordered it using a ksort, but now I need to reset the array from 0 - count($myArray) - 1 and keep the 2nd key intact and its value as well. Can someone please help me?

    Read the article

  • ZipArchive php Class - Is it built-in to PHP?

    - by SoLoGHoST
    Ok, just wondering on the versions of PHP that this class is built into. And if they are built into all platforms (OS's). I'm wanting an approach to search through a zip file and place files using file_put_contents in different filepaths within the webroot. In any case, I'm familiar with how to do this with the ZipArchive class, but I'm wondering if using this class would be a good solution and support MOST, if not ALL servers?? I mean, I'd rather not use a method that requires the Server to have it installed. I'm looking for a solution to this that will support at least MOST servers without having to install the class... Thanks :) Also, I'd like to support opening tar.gz and/or .tgz files if possible, but I don't think the ZipArchive class supports this, but perhaps a different built-in php class does??

    Read the article

  • Converting numbers to their language, how?

    - by SoLoGHoST
    Ok, I'm using mathematical equations to output numbers, though, I need this to be compatible for all languages. Currently, all language strings are within a php array called $txt, and each key of the array gets called for that language. I'm outputting the following: Column 1, Column 2, Column 3, and so on, as well as Row 1, Row 2, Row 3, and so on. The calculations are done via php and javascript, so I'm wondering on the best approach for how to support all languages for the numbers only. I don't do the translations, someone else does, but I need to be able to point it to, either the php variable $txt of where the language is defined, or, since the calculations are done via javascript also, I need to somehow store this in there. I'm thinking of storing something like this: // This part goes in the php language file. $txt['0'] = '0'; $txt['1'] = '1'; $txt['2'] = '2'; $txt['2'] = '3'; $txt['4'] = '4'; $txt['5'] = '5'; $txt['6'] = '6'; $txt['7'] = '7'; $txt['8'] = '8'; $txt['9'] = '9'; // This part goes in the php file that needs to call the numbers. echo '<script> var numtxts = new Array(); numtxts[0] = \'', $txt['0'], '\'; numtxts[1] = \'', $txt['1'], '\'; numtxts[2] = \'', $txt['2'], '\'; numtxts[3] = \'', $txt['3'], '\'; numtxts[4] = \'', $txt['4'], '\'; numtxts[5] = \'', $txt['5'], '\'; numtxts[6] = \'', $txt['6'], '\'; numtxts[7] = \'', $txt['7'], '\'; numtxts[8] = \'', $txt['8'], '\'; numtxts[9] = \'', $txt['9'], '\'; </script>'; And than in the javascript function it could grab the correct string for each number like so: // Example Number String below. var numString = "10"; var transNum = ""; for(x=0;x<numString.length;x++) { var numChar = numString.charAt(x); transNum += numtxts[parseInt(numChar)]; } return transNum; The problem with this bit of code is that it groups the numbers, not sure if all languages do that, like the english language does...? Perhaps there's a better approach for this? Can anyone help please? Thanks :)

    Read the article

  • ZipArchive php Class, would this be the best approach??

    - by SoLoGHoST
    Ok, just wondering on the versions of PHP that this class is built into. And if they are built into all platforms (OS's). I'm wanting an approach to search through a zip file and place files using file_put_contents in different filepaths within the webroot. In any case, I'm familiar with how to do this with the ZipArchive class, but I'm wondering if using this class would be a good solution and support MOST, if not ALL servers?? I mean, I'd rather not use a method that requires the Server to have it installed. I'm looking for a solution to this that will support at least MOST servers without having to install the class... Thanks :) Also, I'd like to support opening tar.gz and/or .tgz files if possible, but I don't think the ZipArchive class supports this, but perhaps a different built-in php class does??

    Read the article

  • Looking for Team Development type Software like SVN

    - by SoLoGHoST
    I am in need of a software that is PHP-Based, or similar that can be installed on my server that doesn't offer SVN Perks. It should be somewhat similar to an SVN, however, since the server doesn't support SVN, we'll need another means of doing sort of the same thing. We have a team of Developers and need to accomplish progress in the same way that an SVN does, but without that type of server support. Is there any software that could be installed via webhosting that would be somewhat, if not exactly, similar to an SVN? Please help, Thanks :) P.S. - This is related to development AFAIK, but not exactly code-related.

    Read the article

  • Creating an element and insertBefore is not working...

    - by sologhost
    Ok, I've been banging my head up against the wall on this and I have no clue why it isn't creating the element. Maybe something very small that I overlooked here. Basically, there is this Javascript code that is in a PHP document being outputted, like somewhere in the middle of when the page gets loaded, NOW, unfortunately it can't go into the header. Though I'm not sure that that is the problem anyways, but perhaps it is... hmmmmm. // Setting the variables needed to be set. echo ' <script type="text/javascript" src="' . $settings['default_theme_url'] . '/scripts/dpShoutbox.js"></script>'; echo ' <script type="text/javascript"> var refreshRate = ', $params['refresh_rate'], '; createEventListener(window); window.addEventListener("load", loadShouts, false); function loadShouts() { var alldivs = document.getElementsByTagName(\'div\'); var shoutCount = 0; var divName = "undefined"; for (var i = 0; i<alldivs.length; i++) { var is_counted = 0; divName = alldivs[i].getAttribute(\'name\'); if (divName.indexOf(\'dp_Reserved_Shoutbox\') < 0 && divName.indexOf(\'dp_Reserved_Counted\') < 0) continue; else if(divName == "undefined") continue; else { if (divName.indexOf(\'dp_Reserved_Counted\') == 0) { is_counted = 0; shoutCount++; continue; } else { shoutCount++; is_counted = 1; } } // Empty out the name attr. alldivs[i].name = \'dp_Reserved_Counted\'; var shoutId = \'shoutbox_area\' + shoutCount; // Build the div to be inserted. var shoutHolder = document.createElement(\'div\'); shoutHolder.setAttribute(\'id\', [shoutId]); shoutHolder.setAttribute(\'class\', \'dp_control_flow\'); shoutHolder.style.cssText = \'padding-right: 6px;\'; alldivs[i].parentNode.insertBefore(shoutHolder, alldivs[i]); if (is_counted == 1) { startShouts(refreshRate, shoutId); break; } } } </script>'; Also, I'm sure the other functions that I'm linking to within these functions work just fine. The problem here is that within this function, the div never gets created at all and I can't understand why? Furthermore Firefox, FireBug is telling me that the variable divName is undefined, even though I have attempted to take care of this within the function, though not sure why. Anyways, I need the created div element to be inserted just before the following HTML: echo ' <div name="dp_Reserved_Shoutbox" style="padding-bottom: 9px;"></div>'; I'm using name here instead of id because I don't want duplicate id values which is why I'm changing the name value and incrementing, since this function may be called more than 1 time. For example if there are 3 shoutboxes on the same page (Don't ask why...lol), I need to skip the other names that I already changed to "dp_Reserved_Counted", which I believe I am doing correctly. In any case, if I could I would place this into the header and have it called just once, but this isn't possible as these are loaded and no way of telling which one's they are, so it's directly hard-coded into the actual output on the page of where the shoutbox is within the HTML. Basically, not sure if that is the problem or not, but there must be some sort of work-around, unless the problem is within my code above... arrg Please help me. Thanks :)

    Read the article

1 2  | Next Page >