Jump to content

aniket_dj

Members
  • Posts

    12
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

aniket_dj's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hi all, I have a db called "core_set" which has a bunch of tables in it. Basically I want to search for a table named "x" or "xx" or "xxx" inside db "core_set". I am scripting using PHP, but I guess this is purely a (My)SQL question. I was hoping for something like select *from db(core_set) where tables_in_core_set like '%x%'; right now 'show tables' returns me the names of tables, but I cant have select *from show tables as such. Any ideas of how I can get around this? Thanks!
  2. Hi, In trying to do a 'lot' of PHP, I forgot that this can be done much more elegantly thru HTML echo "<a href=".$file.">Click here to Download</a>"; The only drawback of this method is there needs to be an additional click. ~Aniket.
  3. Hi guys, I am running an Apache Server and using PHP to force download a zip file to the client. I have made sure that the zip file is present when running the following script $file = $_SESSION["download_file"]; // We'll be outputting a ZIP header('Content-type: application/zip'); // It will be called wert.zip header('Content-Disposition: attachment; filename="wert.zip"'); // The ZIP source is in $file [$file is portww.zip] readfile($file); The error I get for this is Warning: Cannot modify header information - headers already sent by (output started at /opt/lampp/htdocs/bye.php: in /opt/lampp/htdocs/bye.php on line 13 Warning: Cannot modify header information - headers already sent by (output started at /opt/lampp/htdocs/bye.php: in /opt/lampp/htdocs/bye.php on line 16 PK����_A7Á݃$®��=����dummy_55_bcell.inUT �®G—GUx�þÿþÿ”ÑNƒ0†ï}Š>›D½$¬š&–Q“éMÓÁq4B»@§áímçf ÙÖhÊÿöœÿ”(X`”,qH‚òŽçh“BQ j–PÑ”»\1Ø C!x$_€¢xµ0Ÿ'·“vø‡™‡f³1¼„RUÍe¼Èܘg'­>xÆe‰É�yví&|£1 Ö$AB~@ª!Ci£ÛBU iÎ᪶J³Z• s!·.)^/W8I^‡+LM¡þâlº³µNqÑh‘þWº¥»‚×%ï|¨÷RèNmµ (f]®†‹#ïì86_¢Ú×hÃk`µæÚZ„”ÄÑE¼’À”¼ŽÕßêz6¯àú?Ô¾rÁ”,Ž+LY¤F¯y2ý„îlu}ÝùhOt6þrÞCkËýÔ>‡Ñ–É€gÐo¹é¤ç–«xþb6'ØåŸuß]…þRèŠËZha¿ØþáguÀ0~VŒàçõÁp€¡V0Ŧ˜D#ŽožÛÒ#q[YKGÛ¡ºKsH?Oiï´+lBŒK-6*kŽ}M‡R:‰íøŒ¬§úªüÌ™×PK����5`A7ö|KºÍ���Õ����dummy_55_ebvirus.inUT �æG¯GUx�þÿþÿQÑ ‚0}÷+î„ô¾tÅHgä‚èeÌZ$ÈNþ>-Wâ^Îa÷žs¹çRa˜oÃȴΊʀC(a…`DžÕRa$7¥(%Ðx5wâ>ž÷¢ ŸMÁAKLOÈ7%œ„!†ùãïÖq‚ƒ¾aŸdžƒY-ÐöÙwµV’kea¨ª¼è¶½ƒÁªs!ïcžd¨ò¤«¢í·8Tפ۰9ªÌR}¼¾ßùŒÄôoJݾã<íÖô#Nz#ž”R(ê>hÎ[òN}C"(>ç)WÞ(âQe–[[˜‹,#lÈ»2§VèñX¡H}%&öûêA­aÓ ª{"tý goº/š£äèè=¯Ã%wÏ(^\ Ó½ £‰£Ø߸ÇÍÕŽ—)¢u°|á\œÿãW±v@gež˜é­,?÷`¥Ø°¥ßÚ¸œ,ÚÛPK����_A7Á݃$®��=��� ��������¤����dummy_55_bcell.inUT�®GUx��PK����5`A7ö|KºÍ���Õ��� ��������¤ò��dummy_55_ebvirus.inUT�æGUx��PK����_A7½©rÛN���—���� ��������¤��dummy_55_tissue.inUT�®GUx��PK����_A75·V½É���‚��� ��������¤˜��dummy_55_mesh.inUT�®GUx��PK������2��¤���� Could you tell me where am I going wrong. Do I need to reset anything so that the headers are sent fresh? Also do tell me whether there is another different [elegant] way of doing this? Thanks. ~Aniket.
  4. Hi guys, I thought this would be simple, but have been running into some trouble. I have a file on my server saved as a tar. I need that file to be sent to the user [client] when he/she clicks "DOWNLOAD FILE". Also I want to force the user with the save dialog box, so he/she can save the file in the directory he/she wants to save it in. Any pointers on how this can be done? I mean this happens all the time when you download something from any website. Is there any code snippet that can do this? Thanks. ~Aniket.
  5. Hi, This thing is freakin me out. I have PHP variables holding the data retrieved from MYSQL and I want to put into Javascript variables. I know PHP is on server side and there must be someway to transfer data to the client. I am attempting this naive code....which I feel is wrong Can you suggest me the approach for this?? <html> <body> <?php mysql_connect("localhost", "root", "********") or die(mysql_error()); mysql_select_db("test") or die(mysql_error()); //echo "Operation successful"; $query = "SELECT * FROM profile"; $result = mysql_query($query) or die(mysql_error()); echo "<script type='text/javascript'>\n"; //echo "document.write('Javascript running.....');\n"; echo "var i=0;"; //echo "document.write('var =' + i);"; echo "</script>"; while($row = mysql_fetch_array($result)) { echo "<script type='text/javascript'>\n"; echo "var arr = new Array();"; echo "arr[0]=$row[0];"; echo "document.write(arr[0]);\n"; //echo "document.write('New value of i is' + i);\n"; echo "</script>"; echo $row[0]." ".$row[1]."<br>"; } echo "<script type='text/javascript'>\n"; //echo "document.write('Final Value of i is ' + i);\n"; echo "</script>"; ?> </body> </html>
  6. So not writing <?php session_start(); ?> before even the <html> tag was the problem?? Thanks.
  7. I get this error when running a PHP file in mozilla Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /opt/lampp/htdocs/initialpage.php:6) in /opt/lampp/htdocs/initialpage.php on line 7 Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /opt/lampp/htdocs/initialpage.php:6) in /opt/lampp/htdocs/initialpage.php on line 7 //this is my session id 4effe596db6b5183402c61c3b81d1e19 The code for this is <html> <body> <br><br> <?php session_start(); mysql_connect("localhost", "root", "********") or die(mysql_error()); mysql_select_db("test") or die(mysql_error()); //start session for storing user specific variables echo session_id(); $command=$_POST['command']; //echo "<form action='' method='post' name='main_form'>"; echo "<table border=1 cellpadding=5>"; echo "<tr><td>Start a fresh Problem Set</td>"; if($command=='Update') echo "<td><input type='submit' name='command' value='New'DISABLED/>"; else echo "<td><input type='submit' name='command' value='New'/>"; echo "</tr>"; echo "<tr><form action='' method='post' name='update'>"; echo "<td>Update an existing Problem Set </td>"; if($command=='Update') echo "<td><input type='submit' name='command' value='Update' Disabled/>"; else echo "<td><input type='submit' name='command' value='Update'/>"; echo "</form>"; echo "</tr>"; echo "</table>"; //echo "</form>"; echo "<br><br>"; if($command=='Update') { $query = "show databases"; $result = mysql_query($query) or die(mysql_error()); echo "<form action='tissues2.php' method='get' name='show_databases'>"; echo "<table cellpadding=5>"; echo "<tr><td>"; echo "Select a problem set"; echo "</td><td>"; echo "<select name='dbname'>"; echo "<option value='other' selected='selected'> </option>"; while($row = mysql_fetch_array($result)) { $temp=$row['Database']; echo "<option value=$temp>$temp</option>"; echo "<br>"; } echo "</select>"; echo "</td><td>"; echo "<input type='submit'/>"; echo "</td></tr>"; echo "</table>"; echo "</form>"; } ?> </body> </html> Can you please tell me where i am going wrong???
  8. yeah.... got this sorted out.... Thanks a lot for helping me out. ~Aniket.
  9. Hi, I am new to this forum as i am new to PHP in general. So a general hello to all folks in here. Basically what I am doing is getting tuples from database (MySQL) and putting them in a table using PHP+HTML. After the whole table is displayed, I want the user to add another row to the database by having an add key. The add key, adds a new row (with a the same number of fields as the previous tuple). After hitting the submit button, the changes should be reflected back into the database. As far as I know (for a novice to web programming in general), I can have a single submit button which submits the form contents to the server. As this is an update webpage operation, rather than a submit op, how do I go about it? Thanks. ~Aniket.
×
×
  • 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.