Jump to content

jchemie

Members
  • Posts

    35
  • Joined

  • Last visited

    Never

Everything posted by jchemie

  1. Well, If you are serializing, and want this to move across different sessions, you may also consider it storing in a mysql database! you can do a lot with this... just a tip of iceberg .
  2. Okay, I have had a similar experience when I began doing OO Programming. Well let me help you clear your Object Oreinted basics first. I have written an article on object oriented programming on my blog. The url of the post is http://loveofphp.com/programming/object-oriented-programming.html. Hope this is an enjoyable ride for you. Thanks Jyot Vakharia
  3. The only change seems to be here <?php for ($i=1; $i <= $_REQUEST['times']; $i++) {my code here}
  4. Hey you need to graph? If its for non commercial use, i would seriouly recommend using the jpgraph lib. Check it out at http://www.aditus.nu/jpgraph/ Thanks Jyot
  5. Hey, Here is your code <? echo '<table border="0" bgcolor="#ffffff" class="MainBody1" width="50%" align="center">'; $result = mysql_query("SELECT * FROM workhours WHERE jobid='".$jobid."' AND stepid='".$idr."'"); while($row = mysql_fetch_array($result)) { $css_class = ($css_class=='row_style_1') ? 'row_style_2' : 'row_style_1'; echo "<tr class='$css_class'>"; echo '<td width="80" class="underline">'. $row['date'] .'</td>'; echo '<td width="120" class="underline">'. $row['name'] .'</td>'; echo '<td width="80" class="underline">'. $row['hours'] .'</td>'; echo '<td class="underline">'. $row['notes'] .'</td>'; echo '</tr>'; } echo '</table><br>'; ?> AND HERE is the CSS CODE FOR IT <style type='text/css'> .row_stlye_1 { background-color: #eaeaea; } .row_stlye_2 { background-color: #ffffff; } </style> That should be it. Thanks Jyot
  6. hi, Other than that, one more thing you need to do is call your connect function. dont forget to do that. you might end up struggling to get a connection
  7. Hi what are the approximate charges (per hour basis) for a good / experienced PHP / MySQL programmer Thanks Jyot
  8. Hi what are the approximate charges (per hour basis) for a good / experienced PHP / MySQL programmer Thanks Jyot
  9. So make it order by admin_id and it will be in the ascending order....
  10. the format for cron is in general path/to/php/interpreter -q /path/to/page eg. /usr/bin/php -q /home/organicc/public_html/reports/report.php
  11. str_replace("\n","<br />", str_replace("\r","<br /",str_replace("\n\r", "<br /",$string))); Remember the changing of order is going to change functionallity. in anycase you shouldnt use \n\r outside. Thanks Jyot
  12. Well the prev one was a beauty. One more logic i find good is as under error_reporting(0); while(count($nos) < 10000) { $no = rand(1, 10000); if(!(in_array($no,$nos, true))) { $nos[] = $no; } }
  13. Well one of the best ways to do it is check the file extensions on the server side. So that it allows only the extensions you require. Thanks Jyot
  14. Well in this case you may use header("location:$new_site_addr"); ??
  15. again, if you want it CSS compliant... i.e. not use border... declare a class for it... like <img class='boderless' src='...' /> and in the style define .borderless { border: none;}
  16. Hi Tarun... Here is a piece of code i had used earlier in one of my scripts function get_dir($path,$max_depth='',$l=0,$total=''){ global $conn; global $desireddir, $host, $mod; if(!is_dir($path))return; $path=substr($path,-1)!="/"?$path."/":$path; if(!$l){ $total=0; } if($max_depth==='' || ($max_depth>$l && is_int($max_depth))) $test_depth=true; else $test_depth=false; $pre=""; $c=$l; while($c--)$pre.=" "; $dir=opendir($path); while($f=readdir($dir)){ if($f=="."||$f=="..")continue; $file=$path.$f; $size=""; if(is_dir($file)) { $newdir = $desireddir . str_replace("upload", "", $file); ftp_mkdir($conn, $newdir); if(strpos(ftp_pwd($conn), "wp-content") || strpos($newdir, "wp-content")) { ftp_site($conn, 'CHMOD '.$mod.' '. $newdir); } } if((is_file($file)||!is_dir($file)) && (substr($file, strlen($file)-3) == "php"){ // DO WHAT YOU WANT TO WITH THE FILE.... } else $f.="/"; while(strlen($size)<16) $size=" ".$size; if(is_dir($file) && $test_depth) $total=get_dir($file,$max_depth,$l+1,$total); } if(!$l) return $total; }
  17. well since the link was down for you i have copied the code here... FROM THE SITE takes a multidimensional array and puts all the elements into HTML hidden input types so data can be carried through to another page <?php function array_to_hidden($array, $carry = "data") { /* feed it a multidimensional array and it goes right down putting every * non-blank element of every sub-array into a HIDDEN field of an HTML * FORM. The second argument should be the name of the variable * you've passed */ while(list($name, $value) = each($array)) { if (is_array($value)): array_to_hidden($value, "${carry}[$name]"); /* uncomment the "elseif" if you don't want fields with blank values to be * passed along. (don't forget to comment out the else of course!) */ //elseif (!ereg("^[ nt]*$", $value)): else: echo "n<INPUT TYPE="hidden" NAME="${carry}[$name]" ", "VALUE="$value">"; endif; } } ?>
  18. Well, If you are able to extract text out of the pdf file, you can simply explode the text using the newline character... and include lines upto third semicolon you recieve(that is the obvious seperator i see to locate the new field).
  19. Hi, Make sure you have the host address and the port written correctly. If it still aint working... my only guess comes that the connection config aint correct. You could also check if there is an error in the username and password, else if the user is assigned the rights to access the database. Thanks Jyot Vakharia
  20. Well, The best way to use the mysql class and the cart class is extend the cart class to have the database functionallity something like class database { .. .. .. } class cart extends database { // the cart functionallity. } This would let you use the database and cart as a single class as well as the code seperation will still be there. Hope this helps. Jyot
  21. Well you should write a code that is something like this... <select name='select_name'> <?php foreach($option_values as $option_value) { echo "<option>".$option_value."</option>"; } ?> </select> This will give you all the options in a drop down menu. Thanks Jyot
  22. Well there are a lot of CMSs available on the internet for free. But it may not have all the functionallity you would like. I would suggest you to go through php language and once you are proficient with php and mysql building such a system would be a piece of cake. Thanks Jyot
  23. Well, I would recommend you read about autoloading of classes from php.net comments in classes and objects section there are a lot of good scripts to help you do the same. You could also just make up the config class that holds up the config data and use it.
  24. Hello Friends, I was interested in using the word com object in the php file. I tried the standard code... i.e // starting word $word = new COM("Word.Application" ) or die("Unable to instantiate Word"); $word->Documents->Open("test.doc"); $word->Quit(); but it gives the following error Please Help Thanks Jyot Vakharia
  25. [code]session_start(); if ( (!isset($_POST['id'])) || (!isset($_POST['password'])) ) { $problem = true; REDIRECT TO Login.php } [/code] Here what you can do is [code]session_start(); if ( ($_POST['id']) || ($_POST['password'])) { $problem = true; header("Location: login.php"); } [/code] This should solve your problem. Thanks Jyot Vakharia info@sitesmith.net.in
×
×
  • 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.