Jump to content

manny

Members
  • Posts

    52
  • Joined

  • Last visited

    Never

Everything posted by manny

  1. my pleasure
  2. cool, then use dirname twice. like this. $dir = dirname(dirname(__FILE__)) .'/test/';
  3. true true, i agree. i would recommend doing both :-) fixing a simple code, will help the person see the differences.
  4. do not use file_exists(), if $A will == '' and the directory exist, it will return true. instead use is_file(); example <?php // if you need to go back one folder use dirname(dirname(__FILE__)) // same like ../ $dir = dirname(__FILE__).'/test/'; // dirname(__FILE__) returns the absolute path for the file this is written in $a = 'BOB'; $b = $dir.$a; if(is_file($b)) { // do something... } else { // do nothing... } ?> is_file() will also make sure it is a file, and not a symbolic link or a folder, but an actual file
  5. i would reccomend utilizing the absolute paths, so that it works for almost any server config... Works like a charm for me. <?php $fh = fopen(dirname(dirname(__FILE__))."/inc/config.php", "a") or die("\r\nCan't open file."); $write = "\$config['database_host'] = {$mysqlh}; \$config['database_user'] = {$mysqlu}; \$config['datbase_pass'] = {$mysqlp}; \$config['datbase_name'] = {$dbn}; \$config['table_prefix'] = {$tp};"; fwrite($fh, $write); fclose($fh); ?>
  6. My pleasure. Feel free to contact me if you need any other help.
  7. manny

    spacess

    How many results does the mysql_fetch_array() returns?
  8. This should fix your parse error. <html> <body> <?php $hours="akj"; $hours_array = str_split($hours); foreach($hours_array as $value) { ?> <form> <input name="lname" type="text" value="<?php echo htmlspecialchars( $value); ?>" /> </form> <?php } ?> </body> </html>
  9. Here is an example how you can do that.. <input type="checkbox" name="checkbox[iD]" value="ID" /> <input type="checkbox" name="checkbox[135]" value="135" /> <?php $checkboxes = !empty($_POST['checkbox'])? $_POST['checkbox'] : array(); foreach ($checkboxes as $id => $value) { // code goes here... } ?> Let me know if this helps.
  10. this is how it can be done. <?php $stars = range(1,70); foreach ($stars as $star) { if($ibforums->member['star'] == $star) { $checked = ' checked'; } else { $checked = ''; } ?> <input type=radio id="s<?=$star?>" value="<?=$star?>" onclick="showPreview(<?=$star?>);" name="star"<?=$checked?> /> <label for="s<?=$star?>"> <img src="style_images/1/icons/<?=$star?>.png"> </label> <?php } ?> Hope this helps
×
×
  • 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.