Jump to content

asherinho

Members
  • Posts

    49
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

asherinho's Achievements

Member

Member (2/5)

0

Reputation

  1. Hi guys! Can any one help me with the link where I can find usefull tutorial on how to design joomla template
  2. I have a form with multiple select fields and text fields.Each select field is associated with a text field,the options of select fields carries the product name,id and unit saling price while the text fields takes the corresponding quantity.Here is my form <form id="form1" name="form1" method="post" action="sale.php"> <select name="product_name1"> <option value="">Select...</option> <option value="1" unit="3000">Cocacola</option> <option value="2" unit="4000">Pepsi</option> </select> <select name="product_name2"> <option value="">Select...</option> <option value="1" unit="3000">Cocacola</option> <option value="2" unit="4000">Pepsi</option> </select> <input type="text" name="quantity1" size="20"> <input type="text" name="quantity2" size="20"> <input type="text" name="total_price" /> <input type="button" value="Calculate" onclick="cal()" /> <input type="submit" value="submit"> </form> I want to calculate the total price by multiplying the unit sale price and quantity of each product then suming all of them,by using a javascript function call(),but it doesn't work.Below is the function <script language="javascript"> function cal(){ var count= 3; var i=1; var total=0; while(i<=count){ var num1=document.form1.product_name+i+.options.selectedIndex; var pick1=document.form1.product_name+i+.selectedIndex; var total2=document.form1.product_name+i+.options(pick1).unit*document.form1.quantity_sold+i+.value; i=i+1; total=total+total2; } document.form1.total_price.value=total; </script> What is wrong with the code above?
  3. Hi guys! I know this is impossible but I went through few readings and I noticed that there are ways to deal with it.So please if any one knows where I can find the best tutorial for this topic,I'll be glady caz I havn't found one yet.
  4. I tried it taht way. <? $file_dir = $_SERVER['DOCUMENT_ROOT'] . '/../uploads/'; if($_FILES['fileupload']['size'] <= 81200){ foreach($_FILES as $file_name => $file_array) { print "path: ".$file_array['tmp_name']."<br>\n"; print "name: ".$file_array['name']."<br>\n"; print "type: ".$file_array['type']."<br>\n"; print "size: ".$file_array['size']."<br>\n"; if (is_uploaded_file($file_array['tmp_name'])) { move_uploaded_file($file_array['tmp_name'], "$file_dir".$file_array['name']) or die ("Couldn't copy"); print "file was uploaded!<br><br>"; } } }else{ print "large size!<br><br>";} ?> It doesn't work yet.I am getting the following warnings Warning: move_uploaded_file(/home/mtibwa/public_html/../uploads/ASHRY.gif) [function.move-uploaded-file]: failed to open stream: Permission denied in /home/mtibwa/public_html/upload.php on line 12 Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move '/tmp/phpSoClj8' to '/home/mtibwa/public_html/../uploads/ASHRY.gif' in /home/mtibwa/public_html/upload.php on line 12
  5. FMaBiSmAd are you suggesting I should use "uploads/" as a path to where the file is uploaded? I tried it but still it doesn't work.Below is the code for the page which uploads the file <? $file_dir = "uploads/"; if($_FILES['fileupload']['size'] <= 81200){ foreach($_FILES as $file_name => $file_array) { print "path: ".$file_array['tmp_name']."<br>\n"; print "name: ".$file_array['name']."<br>\n"; print "type: ".$file_array['type']."<br>\n"; print "size: ".$file_array['size']."<br>\n"; if (is_uploaded_file($file_array['tmp_name'])) { move_uploaded_file($file_array['tmp_name'], "$file_dir".$file_array['name']) or die ("Couldn't copy"); print "file was uploaded!<br><br>"; } } }else{ print "large size!<br><br>";} ?>
  6. Whats up guys? I am having a problem with the path to put the folder for uploaded files in the control panel.Below is the view of the directory tree,you can see the position of the uploads folder.Is that the correct place to put that folder? I have been getting this warnig Warning: move_uploaded_file() [function.move-uploaded-file]: open_basedir restriction in effect. File(/uploads/ASHRY.gif) is not within the allowed path(s): (/home/mtibwa:/usr/lib/php:/usr/local/lib/php:/tmp) in /home/mtibwa/public_html/upload.php on line 12 [/img] [attachment deleted by admin]
  7. Hi guys,I need to count the number of registered members and guest visiting my website.can anyone help me with the links where I can get tutorials on this.
  8. Hi guys.I am having a problem with session_start() in my page,I kept the function on top in my page but I get the following warnings cannot send session cookie-headers already sent by (output started at c:progrm files\xampp\htdocs\mtibwa\index.php) cannot send session cache limiter-headers already sent by (output started at c:progrm files\xampp\htdocs\mtibwa\index.php) What should I to solve this problem guys?
  9. hi! can anyone help,I want the excel sheet to open in maximized mode instead of restore mode.I have a php page which query the database and writes the results to the excel sheet but on opening the excel sheet,it opens in restore mode.Below are codes for the page which does the query and writing to excel,but it refers some classes.Any idea? <?php require("connection.php"); $db=mysql_connect("$host","$user","$password"); mysql_select_db("$dbname",$db); $result=mysql_query("SELECT * FROM file_info WHERE actn_officer != 'registerer' ORDER BY file_no"); $num_rows=mysql_num_rows($result); set_time_limit(10); require_once "class.writeexcel_workbook.inc.php"; require_once "class.writeexcel_worksheet.inc.php"; $fname = tempnam("/tmp", "result.xls"); $workbook = &new writeexcel_workbook($fname); $worksheet = &$workbook->addworksheet(); $border2 =& $workbook->addformat(); $worksheet->set_column(0, 0, 34); $worksheet->set_column(1, 1, 34); $worksheet->set_column(2, 2, 34); $worksheet->set_column(3, 3, 34); $worksheet->set_column(4, 4, 34); $worksheet->set_column(5, 5, 34); $worksheet->set_column(6, 6, 34); $worksheet->set_column(7, 7, 12); $worksheet->set_column(8, 8, 28); $worksheet->set_column(9, 9, 26); $worksheet->set_column(10, 10, 36); $worksheet->set_column(11, 11, 36); $border2->set_bold(); $border2->set_align('center'); $border2->set_size(10); $today=getdate(time()); $worksheet->write(0, 0, $today["year"]/$today["mon"]/$today["mday"]); $worksheet->write(1, 0, "FILE NUMBER",$border2); $worksheet->write(1, 1, "FILE NAME",$border2); $worksheet->write(1, 2, "ACTION",$border2); $worksheet->write(1, 3, "POSTAL ADDRESS",$border2); $worksheet->write(1, 4, "PHONE NUMBER",$border2); $worksheet->write(1, 5, "FAX NUMBER",$border2); $worksheet->write(1, 6, "EMAIL",$border2); $worksheet->write(1, 7, "DATE",$border2); $worksheet->write(1, 8, "TIME",$border2); $worksheet->write(1, 9, "OFFICER",$border2); $worksheet->write(1, 10, "PREV OFFICER",$border2); $worksheet->write(1, 11, "DEPARTMENT",$border2); $i=2; while( $record=mysql_fetch_assoc($result)){ $worksheet->set_column($i, $i, 13); $worksheet->write($i, 0, $record["file_no"]); $worksheet->write($i, 1, $record["file_name"]); $worksheet->write($i, 2, $record["action"]); $worksheet->write($i, 3, $record["postal_adres"]); $worksheet->write($i, 4, $record["phone"]); $worksheet->write($i, 5, $record["fax"]); $worksheet->write($i, 6, $record["email"]); $worksheet->write($i, 7, $record["date_taken"]); $worksheet->write($i, 8, $record["time"]); $worksheet->write($i, 9, $record["actn_officer"]); $worksheet->write($i, 10, $record["prev_officer"]); $worksheet->write($i, 11, $record["department"]); $i++; } $workbook->close(); header("Content-Type: application/x-msexcel; name=\"example-repeat.xls\""); header("Content-Disposition: inline; filename=\"example-repeat.xls\""); $fh=fopen($fname, "rb"); fpassthru($fh); unlink($fname); ?>
  10. hi guys! I am wondering if php can do this.I want to prevent user from modifying or erase the values displayed on a text field, can this be done with php? or its a javascript issue?
  11. I didn't get u exactly templeDMDKrazd.can u take a look at my code so that I can have a clear idia <HTML> <HEAD><TITLE>confirm form</TITLE></HEAD> <BODY> <? require("connection.php"); $db=mysql_connect("$host","$user","$password"); mysql_select_db("$dbname",$db); $result1=mysql_query("SELECT DISTINCT file_no FROM file_info"); $result2=mysql_query("SELECT DISTINCT file_name FROM file_info"); $result3=mysql_query("SELECT DISTINCT actn_officer FROM file_info"); $result4=mysql_query("SELECT DISTINCT prev_officer FROM file_info"); $result5=mysql_query("SELECT DISTINCT department FROM file_info"); if(!$db){ echo "<B style='font-size:16px;color:red;font-weight:bold'>Sorry the form can not be desplayed.No connection to the database,please contact the sysetm administrator</B>"; exit; } elseif(!result1 || !result2 || !result3 || !result4){ echo "<B style='font-size:16px;color:red;font-weight:bold'>There is system error,please click the link to reload the form </B>"; exit; } ?> <TABLE width="80%" border="0" cellpadding="0" cellspacing="0" border="1"> <TR><TD align="right" class="form">FILE NUMBER </TD> <TD align="left" class="form"> <? echo "<SELECT name='fno'>"; while($record1=mysql_fetch_assoc($result1)){ echo "<OPTION>".$record1["file_no"]."</OPTION>"; } echo "</SELECT>"; ?> </TD> </TR> <TR><TD align="right" class="form">FILE NAME </TD> <TD align="left" class="form"> <input typ="text" name="filename" size=30> </TD> </TR> </TABLE> </BODY> </HTML>
  12. hi guys! I have a form which has two fields,a select list field and a text field.The select field has a list of file numbers from the database and the text field takes the related file name.I want when user select a file number the corresponding file name should appear on the text field.in the database the file number and name are the fields of the same table.can php solve this?
  13. hi! I need to print the results obtained from quering the database,is there any way where i can send the results to exel so that user can print them?
  14. I didnt get u unkwntech,what do u mean?
  15. Hi.I am using phpMyadmin 2.9.1.1,I have a login system which I am using sessions.But I get the following warning [b]Warning[/b]: Unknown: Your script possibly relies on a session side-effect which existed until PHP 4.2.3. Please be advised that the session extension does not consider global variables as a source of data, unless register_globals is enabled. You can disable this functionality and this warning by setting session.bug_compat_42 or session.bug_compat_warn to off, respectively. in Unknown on line 0 Please help me.
×
×
  • 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.