Jump to content

taquitosensei

Members
  • Posts

    676
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by taquitosensei

  1. try this $val_exp=explode(":\/", $client); $val=$val_exp[1]; should give you everything after the D:/ it will also accommodate other drive letters to without any changes.
  2. I would set is_finalized to boolean in your database and then re-arrange your if statements a little. That way you can do this $line = 1; while ($row = mysql_fetch_assoc($result)) { if ($row["is_finalized"]) { $color_code=""; if($line%2==1) { $color_code="bgcolor='".$this->color_line."'"; } echo " <tr ".$color_code. ">\n"; echo " <tr>\n"; echo " <td>" . $row["submission_id"] . "</td>\n"; echo " <td>" . $row["col_1"] . "</td>\n"; echo " <td>" . $row["col_2"] . "</td>\n"; echo " <td>" . $row["col_3"] . "</td>\n"; echo " <td>" . $row["col_4"] . "</td>\n"; echo " <td>" . $row["col_5"] . "</td>\n"; echo " <td>" . $row["col_7"] . "</td>\n"; echo " </tr>\n"; $line++; } }
  3. save as a csv then use load data infile http://dev.mysql.com/doc/refman/5.1/en/load-data.html
  4. thousands of entries is nothin' I had a table with over 4 million entries with not much of a performance hit. I knew but nobody using my app did.
  5. $array=array( array("whatever"=>"whatever"), array("somethingelse"=>"somethingelse") ); you can keep nesting like that almost infinitely. another way $array=array(); $array['subarray']['key1']="hmmm"; $array['subarray']['key2']="whatever";
  6. I don't see an obvious problem. Try this $query_checkboxlist = "SELECT ID, TYPE, VALUE FROM table1 WHERE TYPE='typeofbox'"; $result_checkboxlist = mysql_query($query_checkboxlist); $query = "SELECT ID, CHECKBOXES FROM table2 WHERE ID=4"; $result = mysql_query($query); echo "<ul>\n"; while($row_checkboxlist = mysql_fetch_array($result_checkboxlist)){ while($row = mysql_fetch_assoc($result)) { $markedboxes = explode(",",$row['CHECKBOXES']); foreach($markedboxes as $key=>$value) { echo '<li><input type="checkbox" name="involvement[]" value="'.$row['ID'].'" '; $checked=""; if($row["ID"] == $value) { $checked="checked='yes'"; } echo $checked."/>".$row['VALUE']."</li>\n"; } } } echo "</ul>\n";
  7. It sounds like apache is not setup to parse php. create testphp.html <?php phpinfo(); ?> see if it will parse that if so then check your httpd configuration for this line AddModule mod_php5.c make sure it's not commented out.
  8. Here's how I'd do this echo $websitelink; // to make sure it's right see if it has the trailing / or not if($row['filetype']=='mp3') {$fileiconpath = $websitelink.'images/icons/music.png';} else {$fileiconpath = 'images/icons/page.png';} //================================================== echo $fileiconpath; // just to make sure it looks right echo "</td><td>"; echo "<center><img src='".$fileiconpath."'></center>"; echo "</td></tr>";
  9. It will work and is good practice but the actual problem is with the reference to an array being returned from your function.
  10. do print_r($rows); just before the foreach to make sure that it's an array and that the data looks the way it should.
  11. include supports variables. You just set the variable before you include the file $variable="BLAH"; include("echovariable.php"); echovariable.php echo $variable;
  12. in php 4.4+ if you're returning an array from a function you have to assign it to a variable before referencing it. Sorry I didn't notice the error the first time around.
  13. no...more like $filename="listmycar.php"; if(file_exists($filename)) { $mypath=realpath($filename); }
  14. use css and divs for layout then use separate files and include them for header, lefthand menu, footer, etc..
  15. if it's 5.2.4 this might apply Some users will notice that PHP applications malfunction when they upgrade to PHP 5.2.4 (included in Ubuntu 8.04 LTS) because realpath returns true for files that don't exist. This is due to the inclusion of the Hardened-PHP Project's Suhosin Patch in many distributions by default. This patch replaces PHPs realpath function with the BSD implementation, which ignores the last path component. The workaround is to use the file_exists function to verify that the file exists before using realpath to get its real path string.
  16. turn on error reporting ini_set("display_errors","1"); ERROR_REPORTING(E_ALL); blank page usually means an error that isn't being displayed.
  17. You could pass an array but you're still doing about the same amount of work. This isn't even close to tedious when you get into the more advanced stuff. If you don't want to do this, then I'd suggest getting another hobby.
  18. How are you assembling the string? You could replace hyphens in the individual parts with another character pipe |? Then assemble your string. Then split it and replace the | with -. $string1="Blink - 182"; $string2="What\'s my age"; $string1=str_replace("-", "|", $string1); etc.. etc.. $string=$string1." - ".$string2; $string_split=split(" - ",$string); foreach($string_split as $string) { $string_with_hyphen=str_replace("|", " - ", $string); echo $string_with_hyphen; }
  19. it sounds like you're using javascript which would be clientside, that's why it's using the time off your computer. I found this. http://articles.techrepublic.com.com/5100-10878_11-6016329.html sounds like what you're after.
  20. either a php library for reading excel, or if that's not an option, replace the linebreaks if it's going to be display in html you can replace with <br> $string=nl2br($string);
  21. I would adjust your table layout to make things easier in the Future instead of Device_Code, Chan1_Reference, Chan2, Chan3, etc Do Device_Code, Channel, Reference Then you can do a single query $sql="select Device_Code, Channel, Reference from devices where Reference='CW1002/W'"; I just saw the previous posters comment about normalizing, this is what he was talking about.
  22. Here's what the manual has to say It sounds like you need to verify that you have SSL support then configure it to use a personal certificate in PEM format if you don't have one in PEM format you need to convert it. HTTPS Secure HTTP requires SSL libraries to be installed and used when curl is built. If that is done, curl is capable of retrieving and posting documents using the HTTPS protocol. Example: curl https://www.secure-site.com Curl is also capable of using your personal certificates to get/post files from sites that require valid certificates. The only drawback is that the certificate needs to be in PEM-format. PEM is a standard and open format to store certificates with, but it is not used by the most commonly used browsers (Netscape and MSIE both use the so called PKCS#12 format). If you want curl to use the certificates you use with your (favourite) browser, you may need to download/compile a converter that can convert your browser's formatted certificates to PEM formatted ones. This kind of converter is included in recent versions of OpenSSL, and for older versions Dr Stephen N. Henson has written a patch for SSLeay that adds this functionality. You can get his patch (that requires an SSLeay installation) from his site at: http://www.drh-consultancy.demon.co.uk/ Example on how to automatically retrieve a document using a certificate with a personal password: curl -E /path/to/cert.pem:password https://secure.site.com/ If you neglect to specify the password on the command line, you will be prompted for the correct password before any data can be received. Many older SSL-servers have problems with SSLv3 or TLS, that newer versions of OpenSSL etc is using, therefore it is sometimes useful to specify what SSL-version curl should use. Use -3, -2 or -1 to specify that exact SSL version to use (for SSLv3, SSLv2 or TLSv1 respectively): curl -2 https://secure.site.com/ Otherwise, curl will first attempt to use v3 and then v2. To use OpenSSL to convert your favourite browser's certificate into a PEM formatted one that curl can use, do something like this (assuming netscape, but IE is likely to work similarly): You start with hitting the 'security' menu button in netscape. Select 'certificates->yours' and then pick a certificate in the list Press the 'export' button enter your PIN code for the certs select a proper place to save it Run the 'openssl' application to convert the certificate. If you cd to the openssl installation, you can do it like: #. /apps/openssl pkcs12 -in [file you saved] -clcerts -out [PEMfile]
×
×
  • 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.