Jump to content

sayedsohail

Members
  • Posts

    468
  • Joined

  • Last visited

    Never

Everything posted by sayedsohail

  1. Hi, How do i create pdf document, any help highly appreciated.  I saw few third party tools ie., fpdf.org etc.  How do i perform using fewer steps. Here is my script echo" <Input type='text' value=$'lname'> <Input type='text' value=$'fname'> <Input type='text' value=$'id'> <Input type='text' value=$'address'>"; <input type='button' value ='Create PDF' onclick='CreatePDF()'>
  2. Example 8-2: Simple PHP script that uses a session http://www.oreilly.com/catalog/webdbapps/chapter/ch08.html#97915 http://www.tizag.com/phpT/phpsessions.php or try google php sessions
  3. I would try something like this ?> // untag php than plain html <input type='submit' name='confirm' value='Confirm' onclick='return check();'> <input type='reset' name='reset'> <?php // tag php Infact you can use this in your form, it won't do any harm.
  4. Sorry for this silly opinion, can you try echo "$s"; echo "$id"; to see if it has got any value at first.
  5. Thanks for the help, here is the scenario My first table select statement select lname, fname,member_id, id from table1; and onclick I wish to pass $member_id, $id through a javascript function i.e., onclick=checkvalues("Myform", $id,$member_id) so my next query will have a choice to select data from either of this two values ie., id or member_id,  however, i don't want to display member_id in my first output, that is why i thought of storing member_id in a separate array and referring it in my onlick statement. My logic is bit strange and i apologize for that.  Can you advise?  Thanks
  6. Hi I just wish to know how could i select a particular field in an array i.e, only one field from my sql statement below and refer those values in javascript. ie., select lname, fname, company, from table1 lname should be in an array. Please help.
  7. million thanks for your help.  you made my day. thanks.
  8. Hi, I am having a small problem somewhere in my script, as the output of my php produce an excel sheet but all the columns is having a < d> tag.  I don't know here i went wrong.  Please help. Here is my script: [code]<?php $recNum = $_GET['rec_No']; $select = "SELECT * FROM clients where id=$recNum"; $export = mysql_query($select); $fields = mysql_num_fields($export); $header = "<table border=1><tr>"; for ($i = 0; $i < $fields; $i++) { $header .= "<td>".mysql_field_name($export, $i) . "<\td>"; } $header .= "</tr>"; while($row = mysql_fetch_row($export)) { $line = "<tr>"; foreach($row as $value) { if ((!isset($value)) OR ($value == "")) { $value = "<td>&nbsp;</td>"; } else { $value = str_replace('"', '""', $value); $value = "<td>" . $value . "<\td>"; } $line .= $value; } $data .= trim($line)."</tr>"; }[/code]
  9. I assume it has to do with the localhost settings,  what is your content directory.  Are you saving the file with proper extension i.e, xyz.php, xyz.html etc. sorry if i sound bit strange  try typing http://localhost/yourcontentdirectory/yourfilename.php if this doesn't work please post your file (script) and we can test and advise. regards,
  10. [quote author=dgiberson link=topic=124000.msg513287#msg513287 date=1169744732] $value = '<td>"' . $value . '"' . "<\td>"; should be $value = "<td>" . $value . "<\td>"; [/quote] Now the double quotes are gone but < d> appears in every column..  However, I tried using more simpler way code above pretty close but not success in either of this methods. Any suggestions.  
  11. instead I tried something simple to print specific fields but i got an error any suggestions. <?php header("Content-Disposition: attachment; filename=extraction.xls"); header("Pragma: no-cache"); header("Expires: 0"); header("Content-type: application/x-msdownload"); $recNum = $_GET['rec_No']; $query2 = "SELECT id, name, address_1, p_code, city, l_line, mobile FROM clients WHERE id='$recNum'"; $result2 = mysql_query($query2) or die('Error, query failed'); $test_rows = mysql_num_rows($result2); if ($test_rows <= 0) { print "<table><TR><TD><h4>Sorry there are ($test_rows) clients in the database.  Please add some clients.\n</h4></td></tr></table>"; } else {  //print the table print "<table border='1'> <tr align='center'> <td>Sl.No.</td> <td>Client Name</td> <td>Address</td> <td>Post Code</td> <td>Location</td> <td>Phone</td> <td>Mobile</td></tr>"; while(list($id, $name, $address_1, $p_code, $city, $l_line, $mobile) = mysql_fetch_array($result2)) { print "<tr> <td>$id</td> <td>$name</td> <td>$address_1</td> <td>$p_code</td> <td>$city</td> <td>$l_line</td> <td>$mobile</td></tr>"; } print '</table>'; require_once("footer.php"); mysql_close($conn); ?>
  12. thanks for your help, its prints fine but with double quote and <d> tags. any suggestions please. Field Name appears with <d> tag id< d> member_id< d> name< d> address_1< d> address_2< d> address_3< d> p_code< d> city< d> country< d> l_line< d> fax< d> web_domain< d> email< d> expiration< d> mobile< d> Data appears with double quotes and <d> tag "11"< d>" "1"< d>" "Technologies Ltd"< d>" "Tip Road"< d>" "Yorkshire"< d> "y3HY"< d> "0123445 5324"< d>" "0123445 5324"< d>" "0000-00-00"< d>
  13. Please can you just give an example, which line i need to modify in my code.  I got this code from tutorial.  please help. It seems i need to modify the whole thing after while loop and i am bit confused.  please help with a simple example please.  thanks.
  14. Hi, I am trying to save one single record in excel sheet and download, the problem is all the headings and columns are exported into just one column,  How do i force my loop to set headings such as (field name) on first row and data in second row.  Please help? [PHPNET]<?php $recNum = $_GET['rec_No']; $select = "SELECT * FROM clients where id=$recNum"; $export = mysql_query($select); $fields = mysql_num_fields($export); for ($i = 0; $i < $fields; $i++) { $header .= mysql_field_name($export, $i) . "\t"; } while($row = mysql_fetch_row($export)) { $line = ''; foreach($row as $value) { if ((!isset($value)) OR ($value == "")) { $value = "\t"; } else { $value = str_replace('"', '""', $value); $value = '"' . $value . '"' . "\t"; } $line .= $value; } $data .= trim($line)."\n"; } $data = str_replace("\r","",$data); if ($data == "") { $data = "\n(0) Records Found!\n"; } header("Content-Disposition: attachment; filename=extraction.xls"); header("Pragma: no-cache"); header("Expires: 0"); print "$header\n$data"; header("Content-type: application/x-msdownload"); require_once("footer.php"); mysql_close($conn); [/PHPNET]
  15. Yes u r right and as soon as the new page download, it disappears.  I am stuck, I just want to highlight the current page link.  that's all, is there any way i can assign value to this link <a id="xyz" href "#" </a> and than capture in javascript to change the size of the text and color.?
  16. Thanks for the help, I tried placing active before hover, still it doesn't work.
  17. Hi, I just wish to know, If i can use multiple databases with my application ie., creating separate database for each of my customers, so they can only see their database and minimize the loading and sql query times.
  18. Hi can anyone help please, active is not working  ???, I am calling header file in every page, thus I assume its overwritting the active:, I tried assigning class to my hyperlinks and calling them in my css sheet but still the same and tried every other advise i had non works.  Please help.  I just wanted to highlight the current active link as bold and beautifull, so the user knows the current active page. header.php [code]<div id="menu"> <a  href="<?php echo $config_basedir; ?>">Home</a> &bull; <a  href="<?php echo $config_basedir; ?>about.php">About</a>&bull; <a  href="<?php echo $config_basedir; ?>register.php">Register</a>&bull; <a  href="<?php echo $config_basedir; ?>faq.php">FAQ's</a>&bull; <a  href="<?php echo $config_basedir; ?>tech.php">Technical Details</a>&bull; <a  href="<?php echo $config_basedir; ?>contact.php">Contacts</a> </div> [/code] and my css stylesheet is something like this: [code]#menu { font-family: "trebuchet ms", verdana, sans-serif; text-decoration: none; font-size: 14px; font-weight: normal; position: absolute; height: 27px; top: 60px; left: 0px; width: 100%; padding: 0px; color: #000000; background-color: #eee; } a:link { text-decoration: none; color: #000; } a:visited  { text-decoration: none; border-bottom: 1px dotted #369; color: #000; } a:hover { text-decoration: underline; font-size: 125%; border-bottom: 1px solid #036; color: #000; } a:active {   text-decoration: underline; font-weight: bolder; border-bottom: 1px solid #036; color: blue;   }[/code] [b]EDITED BY WILDTEEN88: Please place code within code tags [nobbc]([code][/code])[/nobbc]
×
×
  • 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.