Jump to content

Jeevan25

Members
  • Posts

    11
  • Joined

  • Last visited

Jeevan25's Achievements

Newbie

Newbie (1/7)

0

Reputation

  1. Whenever display_footer() is called, the script is terminated because it contains a exit() command at the end. Therefore I don't have to manually do anything else. I tried removing the form vars, but still no luck. I still have no clue why. Two different tables, and nothing in common except the id.Ohh quick edit:Nevermind. Thanks for you help. Just posting that reminded me that in both functions display_footer terminates script so thanks.
  2. I have two functions. One is delete_part($part_id) which deletes a video clip with the passed id from mysql db. The other one is delete_report($part_id). This one deletes a report with the given id from the mysql db. Both $part_id are same. Here are the functions. function delete_part($part_id) { global $link, $page_name, $_GET; if ($part_id < 1) { display_header(); echo ("Error"); display_footer(); } display_header(); $sql = 'DELETE FROM parts WHERE part_id = ' . $part_id; $result = mysql_query($sql,$link); if ($result) { echo ("<br /><br /><b>Successfully deleted</b>"); } else echo ("Error: " . mysql_error()); display_footer();} function delete_report ($part_id) { global $link,$db,$_GET,$_POST,$page_name; display_header(); if ($part_id < 1) { echo ("Invalid report!"); display_footer(); } $sql = "DELETE FROM report WHERE report_part = " . $part_id; $result = mysql_query($sql,$link); if (!result) { echo ("Error with deleting report: " . mysql_error()); display_footer(); } else $result; echo ("Report successfully deleted."); display_footer();} Both work fine when called separately. But when I call them at the same time, the first function to be called work but the second one doesn't work. I tried placing both in different orders but only first one works. Anyone know why?
  3. this is a javascript code: <script language="JavaScript" type="text/javascript">var i,y,x="ab";y='';for(i=0;i<x.length;i+=2){y=y + unescape('%'+x.substr(i,2));}document.write(y);</script> i believe that would output «.now when i browse the source code via a browser, i don't see the string but rather the hexadecimal code. i want to see the actual converted string that is stored in variable y. how do i do this? i dont know anything about javascript. pls help and thanks. ps: a challange from friend and wouldn't tell me the answer.
×
×
  • Create New...