Jump to content

joshi_v

Members
  • Posts

    168
  • Joined

  • Last visited

    Never

Everything posted by joshi_v

  1. Helllo, Wants to say a word with you. when you are using global variables in a php page, they will be available in the same. They won't be accessible in the next page you post the variables. if you want them in the next page, then you can use the sessions. regarding second problem. when you used href link it is going to starting page. If you want to go back to the previous page, check what are the variables that are required to be in that page(It mught be redirecting the page due to lack of some varibales). if you use href with appending the required variables..you could be solve this issue another option is php include option. Try these options and let me know if you have any issues with it. Best of luck Joshi.
  2. $i_query = mysql_query("SELECT * FROM MTES_direct_hours WHERE tech_id = '$_SESSION[userid]' && week_ending_date = '$_SESSION[week_ending_date]' && directontimesheet = '0'"); while ($i_row = mysql_fetch_array($i_query)) { echo ' <tr> <td style="color: RED;">', $i_row[gold_id], '</td> <td style="color: RED;">', $i_row[project], '</td> <td style="color: RED;">Direct</td> <td style="color: RED;">', $i_row[MTES_direct_task], '</td> <td style="color: RED;">', $i_row[week_ending_date_day], '</td> '; $z_query = mysql_query("SELECT SUM(MTES_direct_sub_task_hrs) AS direct_hours_total FROM MTES_direct_hours WHERE week_ending_date = '$i_row[week_ending_date]' && week_ending_date_day = '$i_row[week_ending_date_day]'"); while ($z_row = mysql_fetch_array($z_query)) { echo ' <td style="color: RED;">', $z_row[direct_hours_total], '</td> </tr> '; } $k_query = mysql_query("SELECT MTES_direct_sub_task, MTES_direct_sub_task_hrs FROM MTES_direct_hours WHERE direct_hours_id = '$i_row[direct_hours_id]'"); while ($k_row = mysql_fetch_array($k_query)) { echo ' <tr> <td style="color: RED;"> </td> <td style="color: RED;"> </td> <td style="color: RED;"> </td> <td style="color: RED;">', $k_row[MTES_direct_sub_task], '</td> <td style="color: RED;"> </td> <td style="color: RED;">', $k_row[MTES_direct_sub_task_hrs], '</td> </tr> '; } } } Can u provide the result of this.. pls try it asap..time to leave
  3. GA4101 P1002 Direct Expansion - Installation & Integration Monday 12 Which field in the code is displaying this? $i_row[project] ?
  4. why are u repeating everything in the first while loop? i didn't get why?
  5. Me too working on windows XP and unlink is working perfectly for me. this is my piece of code. <?php $filepath = "/tmp/test.txt"; if (! unlink ($filepath)) { echo ("Couldn't delete file"); } else { echo ("Removed $filepath"); } ?> In your case, check whether your $mainpath contains the correct path and file name. Otherwise post u r code here.
  6. SELECT *, SUM(title)AS sum FROM suggest group by title This is what i have at this moment.
  7. For password and confirm password checking u can use password===confirmpassword. For email checking you have to use some regular expression with the characters that u are expecting in email. Regards, Joshi
  8. If you could use GROUP BY with query u can get what u want.
  9. I think this will work for u foreach($MyArray as $value){ if(ereg($IllegalChars , $value) { //code } else { //Code } }
  10. Hi Everyone, I have XML file. It have some date to display the Graph. In that file i need to provide the date value. I would like to give the current date instead of hard coded date. I tried someways that i found in net , but no use of it. Can anyone help how to do this. This is my XML file. <?xml version="1.0" ?> <!-- created: Fri May 4 10:18:56 2007 --> <graph animation="1" bgColor="FFFFFF" canvasBgColor="FFFFFF" canvasbordercolor="CCCCCC" canvasborderthickness="1" canvasbgalpha="100" hovercapbgColor="FFFFFF" basefontcolor="000000" outcnvbasefontsize="10" areabordercolor="ffffff" hoverCapBorderColor="CCCCCC" PYAxisMinValue="0" numdivlines="4" divLineColor="FFFFFF" decimalPrecision="0" shownames="1" showAlternateHGridColor="1" alternateHGridColor="CCCCCC" showAlternateVGridColor="1" alternateVGridColor="CCCCCC" alternateVGridAlpha="80" showSecondaryLimits="1" showDivLineSecondaryValue="1" PYAxisName="" SYAxisName="" SYAxisMaxValue="420000" PYAxisMaxValue="420000" numVdivlines="10" formatNumberScale="1" showLegend="0" com_bankwatch_caption="Potential Attacks By Category" com_bankwatch_subcaption ="05-07 - 06-07" com_bankwatch_changepct="-55.4%"> <categories> <category name="May"/> <category name="Jun"/> <category name="Jul"/> <category name="Aug"/> <category name="Sep"/> <category name="Oct"/> <category name="Nov"/> <category name="Dec"/> <category name="Jan"/> <category name="Feb"/> <category name="Mar"/> <category name="Apr"/> </categories> <dataset color="000080" areaBorderColor="000080" seriesName="other-activity" showValues="0"> <set value="3598"/> <set value="2626"/> <set value="2174"/> <set value="7109"/> <set value="1154"/> <set value="3150"/> <set value="3391"/> <set value="7208"/> <set value="14767"/> <set value="2312"/> <set value="11950"/> <set value="9084"/> </dataset> </graph> In the above code, i want to replace "com_bankwatch_subcaption ="05-07 - 06-07" " with the current date. from PHP i can't pass any variable to this. I would appriciate any suggestions that would help to get it work. Thanks Joshi. In this forum why we don't have any section for "XML" ???
  11. Thanks u guys for u r response. as ToonMariner suggested i did it using JS and its working fine. Once again thanks for all the guys who responded to this post.
  12. Hi all, I have a class for menu tabs in my index page This is working good but the tab name is not coming in center of the div. if i increase the top padding it is working but it is showing gaps between tabs in IE. can anyone help me how to do this? .menu { color : #FFFFFF !important; margin: 1px 0px 0px 0px; padding-top: 0px; padding-bottom:0px; padding-left: 22px; height: 23px; float:top; } Thanks in advance
  13. Hi guys, I have a menu with image, on mouse over event , image will be changes. Related css code for this is written in a separate css file and calling in HTML file. all this is doing well in Firefox, but in IE 6.0 it is giving trouble. it is not working for mouse over. i came to knew that it IE 6.0 doesn't support css hover. i heared there is a fix to it by inclusing csshover.htc file to the body. But couldn't work it with too. So please anyone could suggest me a way to get it work even with IE 6.0. Thanks Joshi
  14. Well! then in href pass id of that photo..in the second page get the description for that photo from db using the id that is passed to the second file. display the descriptiong along with image. am i correct?
  15. select comm.comments from comments as comm LEFT JOIN photos as ph where ph.photo_id= comm.photo_id. Is this what ur trying to get?
  16. what do u want to display in second page?
  17. I guess u can use OnKeyPress . write a function to check the character codes and call it on OnkeyPress event. i think it works for u. All the best.
  18. filmtype(?) i didn't find in that table too!!! ??? If you think it is in separate table , add it too in the query with another join. Regards, Joshi.
  19. hi! If (($quantitylarge="0")) ( Do you think is this right? because it should be ==(am i wrong??)) $total == $totalsmall; (here one assignment operator will do) Regards, joshi.
  20. First check whether this is the way you want!
  21. I think this will work in all broswers. Please try this again.. <?php session_start(); ob_start(); include_once("FileUpload.php"); include_once("Functions.php"); $dir = "D:/xampp/htdocs/test/data/"; $dir = "/home/museikne/www/misc/"; $active = false; $error = ""; $text = "List:<br>"; $subject = stripslashes($_POST['SUBJECT']); $header = isset($_POST['FROM']) ? stripslashes($_POST['FROM']) : "JobHiRings<postmaster@jobhirings.com>"; $url = isset($_POST['URL']) ? stripslashes($_POST['URL']) : ""; // Clear All if(isset($_POST['CANCEL'])){ unset($_SESSION['LIST']); unset($_SESSION['URL']); } // Clear URL Content if(isset($_POST['CLEARURL']))unset($_SESSION['URL']); if(isset($_POST['AMEND'])){ $_SESSION['URL'] = stripslashes($_POST['URLPREVIEW']); } // Get URL Content if(isset($_POST['GETURL'])){ if(trim($_POST['URL']) == ""){ $error = "Please fill in the url"; }else{ $file = fopen($_POST['URL'], "r") or exit("Invalid URL!"); //Output a line of the file until the end is reached while(!feof($file)) { $body .= fgets($file); //mail($email,"To $email", "Hi there!", "From: ncy@museik.net"); } fclose($file); //$body = str_replace("%name%", "chuyang", $body); $_SESSION['URL'] = $body; } } // Import name list if(isset($_POST['IMPORT'])){ $validFile = array("txt"); // valid file formats $file = $_FILES['FILE']; if($file['name'] != ''){ unset($_SESSION['LIST']); $fu = new FileUpload($file, $dir); $fu->CheckFileFormat($validFile); $fu->UploadFile(); $file = fopen($dir."list.txt", "r") or exit("Unable to open file!"); //Output a line of the file until the end is reached while(!feof($file)) { $email = fgets($file); $email = explode(",",$email); $_SESSION['LIST'][] = $email; //mail($email,"To $email", "Hi there!", "From: ncy@museik.net"); } fclose($file); }else{ unset($_SESSION['LIST']); $error = "Please locate the file"; } //header("Location:$PHP_SELF"); } if(isset($_SESSION['LIST'])){ $i = 1; foreach($_SESSION['LIST'] as $key=>$val){ $name = $val[0]; $email = $val[1]; $text.= "$i ."."$name - $email<br>"; $i++; } print $text; } if(isset($_POST['SEND'])){ if(trim($_POST['SUBJECT'] == ""))$error = "Please fill in a subject title"; if($error == ""){ require_once("includes/Mail.php"); $mail = new Mail(); $mail->SetHeader($header); if(isset($_SESSION['LIST'])){ $original_msg = $_SESSION['URL']; foreach($_SESSION['LIST'] as $key=>$val){ $new_msg = str_replace("%name%", $val[0], $original_msg); $mail->SendHTML($val[1],$subject,$new_msg); } session_destroy(); header("Location:$PHP_SELF"); } } } if($active){ $file = fopen("html.txt", "r") or exit("Unable to open file!"); //Output a line of the file until the end is reached while(!feof($file)) { $email .= fgets($file); //mail($email,"To $email", "Hi there!", "From: ncy@museik.net"); } fclose($file); $email = str_replace("\"", "\\\"", $email); print $email; print "END"; } //$bodytag = str_replace("'", "\'", $body); echo $error; ?> <html> <head> <script language="JavaScript"> function event_action(spl_value) { if(spl_value=="peremail") { test.style.visibility="visible"; test2.style.visibility='hidden'; } else if(spl_value=="notall") { test2.style.visibility="visible"; test.style.visibility='hidden'; } else { test.style.visibility='hidden'; test2.style.visibility='hidden'; } } </script> </head> <body> <form action="<?=$PHP_SELF;?>" method="post" enctype="multipart/form-data" name="form1"> <table border="0" cellspacing="0" cellpadding="3"> <tr> <td nowrap>Subject:</td> <td><input name="SUBJECT" type="text" id="SUBJECT" value="<?php print $subject;?>"></td> </tr> <tr> <td>From:</td> <td><input name="FROM" type="text" id="FROM" value="<?php print $header;?>"></td> </tr> <tr> <td>File:</td> <td><span class="text7"> <select name="to" class="textfield1" onChange="event_action(this.value);" > <option selected="selected" value="all">Entire list</option> <option value="notall">Specialization</option> <option value="peremail">Individual Email</option> </select> <!--<input name="select" type="submit" id="select" value="select" />//--> </span></td> </tr> <tr><td colspan="2"> <div id="test" style="visibility:hidden;" > Email : <input type="text" name="email" value=""> </div> <div id="test2" style="visibility:hidden;"> Specialization in : <input type="text" name="spl" value=""> </div></td> </tr> <tr> <td> </td> <td><?php if(isset($_SESSION['to']) == "notall"){?> <select name="specialization"> <option value="" selected="selected">-- select specialization here --</option> <? $uSql = "SELECT specialization FROM specialization"; $uResult = mysql_query($uSql, $connection); if(!$uResult){ echo 'no data found'; }else{ while($uRow = mysql_fetch_array($uResult)){ ?> <option value="<?= $uRow[specialization]?>"><?= $uRow[specialization]?></option> <? } } ?></select> <?php }?> <?php if(isset($_SESSION['to']) == "peremail"){?> <input name="peremail" type="text" class="textfield" maxlength="100" size="40" /> <?php }?> </td> </tr> <tr> <td>URL:</td> <td><input name="URL" type="text" id="URL" value="<?php print $url;?>"></td> </tr> <tr> <td> </td> <td> <?php if(isset($_SESSION['URL'])){?> <textarea name="URLPREVIEW" cols="80" rows="10" id="URLPREVIEW"><?php print $_SESSION['URL']?></textarea> <br> <input name="CLEARURL" type="submit" id="CLEARURL" value="Clear"> <input name="AMEND" type="submit" id="AMEND" value="Amend"> <?php }?> <input name="GETURL" type="submit" id="GETURL" value="Get URL"> </td> </tr> <tr> <td> </td> <td><input name="SEND" type="submit" id="SEND" value="Send"> <input name="CANCEL" type="submit" id="CANCEL" value="Cancel"></td> </tr> </table> </form> </body> </html> <?php ob_end_flush();?> Let me know the result of it. Regards, joshi.
  22. Hi, Try by adding die part to the query..it will show where and what is the error. $query = mysql_query($sql) or die ($sql.':'.mysql_error()); Regards, Joshi
  23. Sorry! here is the mistake.. else { $row=mysql_fetch_array($res); echo '<form action="bugger.php" method="post"><select name="race">'; # this is the vlaue after posting we are using to retrieve values from DB. for($i=0;$i<mysql_num_rows($res);$i++) { echo"<option value = $row[race_name] >$row[race_name]</option>"; # Here you missed value part in options Wink } // endof for echo'</select><input type="submit" name="submit" value="submit" /> <input type="hidden" name="submitted" value="TRUE" /></form>'; } Replace this code with this else { echo '<form action="bugger.php" method="post"><select name="race">'; # this is the vlaue after posting we are using to retrieve values from DB. while ($row=mysql_fetch_array($res)); { echo"<option value = $row[race_name] >$row[race_name]</option>"; # Here you missed value part in options Wink } // endof for echo'</select><input type="submit" name="submit" value="submit" /> <input type="hidden" name="submitted" value="TRUE" /></form>'; } Let me know if still you are getting errors with this..
×
×
  • 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.