Ad:
 
  • PHP Discussion Thread
  • Unsolved
  • Views: 1900
  • PHP RSS
Similar Threads
Feb 23rd, 2010
0

Undefined Index Error

Expand Post »
Hi Guys ,
I m developing one website for my LAN and working on Linux.
I m getting Following Errors after loading or refreshing my page::

[Tue Feb 23 16:58:51 2010] [error] [client 192.168.2.147] PHP Notice: Undefined index: parent_url in /var/www/html/pastebin/layout.php on line 320, referer: http://pastebin.geodesic.net/2
[Tue Feb 23 16:58:51 2010] [error] [client 192.168.2.147] PHP Notice: Undefined index: parent_poster in /var/www/html/pastebin/layout.php on line 320, referer: http://pastebin.geodesic.net/2
[Tue Feb 23 16:58:51 2010] [error] [client 192.168.2.147] PHP Notice: Undefined index: parent_diffurl in /var/www/html/pastebin/layout.php on line 322, referer: http://pastebin.geodesic.net/2
[Tue Feb 23 16:58:51 2010] [error] [client 192.168.2.147] PHP Notice: Undefined index: token in /var/www/html/pastebin/layout.php on line 327, referer: http://pastebin.geodesic.net/2
[Tue Feb 23 16:58:51 2010] [error] [client 192.168.2.147] PHP Notice: Undefined index: posttitle in /var/www/html/pastebin/layout.php on line 312, referer: http://pastebin.geodesic.net/2
[Tue Feb 23 16:58:51 2010] [error] [client 192.168.2.147] PHP Notice: Undefined index: posttitle in /var/www/html/pastebin/layout.php on line 312, referer: http://pastebin.geodesic.net/2




And My code is::





PHP Syntax (Toggle Plain Text)
  1. <?php
  2. //global $HTTP_GET_VARS;
  3. //echo $HTTP_GET_VARS['posttitle'];
  4. //$v1=$_GET['posttitle'];
  5. /**
  6.  * $Project: Pastebin $
  7.  * $Id: layout.php,v 1.1 2006/04/27 16:22:39 paul Exp $
  8.  *
  9.  * Pastebin Collaboration Tool
  10.  * http://pastebin.com/
  11.  *
  12.  * This file copyright (C) 2006 Paul Dixon (paul@elphin.com)
  13.  *
  14.  * This program is free software; you can redistribute it and/or
  15.  * modify it under the terms of the Affero General Public License
  16.  * Version 1 or any later version.
  17.  *
  18.  * This program is distributed in the hope that it will be useful,
  19.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  20.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  21.  * Affero General Public License for more details.
  22.  *
  23.  * You should have received a copy of the Affero General Public License
  24.  * along with this program; if not, write to the Free Software
  25.  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  26.  */
  27.  
  28. echo "<?xml version=\"1.0\" encoding=\"".$charset_code[$charset]['http']."\"?>\n";
  29.  
  30.  
  31. ?>
  32. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd">
  33. <!--
  34. pastebin.com Copyright 2006 Paul Dixon - email suggestions to lordelph at gmail.com
  35. -->
  36. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  37. <head>
  38. <title><?php echo $page['title'] ?></title>
  39. <meta name="ROBOTS" content="NOARCHIVE"/>
  40. <link rel="stylesheet" type="text/css" media="screen" href="/pastebin.css?ver=4" />
  41.  
  42. <?php if (isset($page['post']['codecss']))
  43. {
  44. echo '<style type="text/css">';
  45. echo $page['post']['codecss'];
  46. echo '</style>';
  47. }
  48. ?>
  49. <script type="text/javascript" src="/pastebin.js?ver=3"></script>
  50. </head>
  51.  
  52.  
  53. <body onload="initPastebin()">
  54. <div style="display:none;">
  55. <h1 style="display: none;">pastebin - collaborative debugging</h1>
  56. <p style="display: none;">pastebin is a collaborative debugging tool allowing you to share
  57. and modify code snippets while chatting on IRC, IM or a message board.</p>
  58. <p style="display: none;">This site is developed to XHTML and CSS2 W3C standards.
  59. If you see this paragraph, your browser does not support those standards and you
  60. need to upgrade. Visit <a href="http://www.webstandards.org/upgrade/" target="_blank">WaSP</a>
  61. for a variety of options.</p>
  62. </div>
  63.  
  64. <div id="titlebar"><?php
  65. echo $page['title'];
  66. if ($subdomain=='')
  67. {
  68. echo " <a href=\"{$CONF['this_script']}?help=1\">View Help</a>";
  69. }
  70. else
  71. {
  72. echo " <a href=\"{$CONF['this_script']}?help=1\">What's a private pastebin?</a>";
  73. }
  74. ?>
  75. </div>
  76.  
  77.  
  78.  
  79. <div id="menu">
  80.  
  81. <?php echo '<h1>'.t('Recent Posts').'</h1>'?>
  82.  
  83. <ul>
  84. <?php
  85. foreach($page['recent'] as $idx=>$entry)
  86. {
  87. if ($entry['pid']==$pid)
  88. $cls=" class=\"highlight\"";
  89. else
  90. $cls="";
  91.  
  92. echo "<li{$cls}><a href=\"{$entry['url']}\">";
  93. echo $entry['poster'];
  94. echo "</a><br/>{$entry['agefmt']}</li>\n";
  95. }
  96.  
  97. echo "<li><a rel=\"nofollow\" href=\"{$CONF['this_script']}\">".t('Make new post').'</a></li>';
  98. ?>
  99. </ul>
  100. <h1>At last!</h1>
  101. <p>You should find pastebin <b>much</b>
  102. faster! Enjoy...</p>
  103.  
  104. <!--
  105. <h1>Translations?</h1>
  106.  
  107. <p>Anyone interested in
  108. a <a href="http://blog.dixo.net/2006/05/10/translate-pastebin/">translated
  109. version of pastebin?</a>. If you'd like to volunteer as a translator or
  110. just want to give some feedback on the idea, please
  111. <a href="http://blog.dixo.net/2006/05/10/translate-pastebin/">leave a comment</a>
  112. </p>
  113. -->
  114.  
  115. <?php
  116. if ($subdomain=='')
  117. {
  118. echo '<h1>'.t('Free subdomains').'</h1><p>';
  119.  
  120. echo t('Want your own xyz.pastebin.com sub-domain for your community? '.
  121. 'Just type the address into your browser address bar.');
  122.  
  123. echo " <a href=\"{$CONF['this_script']}?help=1\">".t('See help for details').
  124. '</a></p>';
  125. }
  126.  
  127. echo '<h1>'.t('About').'</h1><p>';
  128.  
  129. echo t('Pastebin is a tool for collaborative debugging or editing,');
  130. echo " <a href=\"{$CONF['this_script']}?help=1\">".t('See help for details').
  131. '</a>. ';
  132.  
  133. echo t('For latest news see my <a title="View pastebin related posts on my blog" href="http://blog.dixo.net/category/pastebin/">blog</a>.');
  134.  
  135. echo '</p>';
  136.  
  137.  
  138. echo '<p>'.t('Please send feedback below...').'</p>';
  139.  
  140. if (isset($page['thankyou']))
  141. {
  142. echo "<p style=\"color:red;\">{$page['thankyou']}</p>";
  143. }
  144. else
  145. {
  146. ?>
  147. <a name="feedback"></a>
  148. <form method="post" action="<?php echo $CONF['this_script'].'#feedback' ?>">
  149. <textarea name="msg" rows="5" style="width:90%;margin-left:5%;font-size:8pt;font-family:Arial;"></textarea>
  150. <input type="hidden" name="feedback" value="1"/>
  151. <input style="width:90%;margin-left:5%" type="submit" value="<?php echo t('send feedback') ?>"/>
  152. </form><br/>
  153. <?php } ?>
  154.  
  155. <!--
  156.  
  157. <form method="get" action="http://www.php.net/search.php">
  158. <h1>PHP Manual</h1>
  159. <input type="text" size="9" name="pattern"/>
  160. <input type="hidden" name="show" value="quickref"/>
  161. <input type="submit" value="go"/>
  162. </form>
  163.  
  164. <form method="get" action="http://www.mysql.com/search/?">
  165. <h1>MySQL Manual</h1>
  166. <input type="hidden" name="base" value="http://dev.mysql.com"/>
  167. <input type="hidden" name="lang" value="en"/>
  168. <input type="hidden" name="doc" value="1"/>
  169. <input type="hidden" name="m" value="o"/>
  170. <input type="text" size="9" name="q"/>
  171. <input type="submit" value="go"/>
  172. </form>
  173. -->
  174.  
  175. <?php
  176.  
  177. echo '<h1>'.t('Credits').'</h1><p>';
  178.  
  179. echo t('Software developed by ');
  180. echo '<a title="My blog, mainly about software development" href="http://blog.dixo.net">Paul Dixon</a></p>';
  181.  
  182. ?>
  183.  
  184. <!--
  185. <p>
  186. <a href="http://validator.w3.org/check/referer"><img
  187. src="http://www.w3.org/Icons/valid-xhtml10"
  188. alt="Valid XHTML 1.0!" height="31" width="88" border="0"/></a>
  189. </p>
  190. -->
  191.  
  192. </div>
  193.  
  194.  
  195. <div id="content">
  196.  
  197. <?php
  198. /*
  199.  * Google AdWords block is below - if you re-use this script, be sure
  200.  * to configure your own AdWords client id!
  201.  */
  202. if (strlen($CONF['google_ad_client']))
  203. {
  204. ?>
  205. <script type="text/javascript"><!--
  206. google_ad_client = "<?php echo $CONF['google_ad_client'] ?>";
  207. google_ad_width = 728;
  208. google_ad_height = 90;
  209. google_ad_format = "728x90_as";
  210. google_ad_type = "text_image";
  211. google_ad_channel ="";
  212. google_color_border = "D9D0C3";
  213. google_color_bg = "D9D0C3";
  214. google_color_link = "474C7F";
  215. google_color_url = "888888";
  216. google_color_text = "000000";
  217. //--></script>
  218. <script type="text/javascript"
  219. src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
  220. </script>
  221. <br/>
  222. <br/>
  223. <?php
  224. }
  225.  
  226. ///////////////////////////////////////////////////////////////////////////////
  227. // show processing errors
  228. //
  229. if(isset($_POST['errors']))
  230. if (count($pastebin->errors))
  231. {
  232. echo '<h1>'.t('Errors').'</h1><ul>';
  233. foreach($pastebin->errors as $err)
  234. {
  235. echo "<li>$err</li>";
  236. }
  237. echo "</ul>";
  238. echo "<hr />";
  239. }
  240.  
  241. if (!empty($page['delete_message']))
  242. {
  243. echo "<h1>{$page['delete_message']}</h1><br/>";
  244. }
  245.  
  246. if (isset($_REQUEST["diff"]))
  247. {
  248.  
  249. $newpid=$pastebin->cleanPostId($_REQUEST['diff']);
  250.  
  251. $newpost=$pastebin->getPost($newpid);
  252. if (count($newpost))
  253. {
  254. $oldpost=$pastebin->getPost($newpost['parent_pid']);
  255. if (count($oldpost))
  256. {
  257. $page['pid']=$newpid;
  258. $page['current_format']=$newpost['format'];
  259. $page['editcode']=$newpost['code'];
  260. $page['posttitle']='';
  261.  
  262. //echo "<div style=\"text-align:center;border:1px red solid;padding:5px;margin-bottom:5px;\">Diff feature is in BETA! If you have feedback, send it to lordelph at gmail.com</div>";
  263.  
  264. echo "<h1>";
  265. printf(t('Difference between<br/>modified post %s by %s on %s and<br/>'.
  266. 'original post %s by %s on %s'),
  267. "<a href=\"".$pastebin->getPostUrl($newpost['pid'])."\">{$newpost['pid']}</a>",
  268. $newpost['poster'],
  269. $newpost['postdate'],
  270. '<a href="'.$pastebin->getPostUrl($oldpost['pid'])."\">{$oldpost['pid']}</a>",
  271. $oldpost['poster'],
  272. $oldpost['postdate']);
  273.  
  274. echo "<br/>";
  275.  
  276. echo t('Show');
  277. echo " <a title=\"".t('Don\'t show inserted or changed lines')."\" style=\"padding:1px 4px 3px 4px;\" id=\"oldlink\" href=\"javascript:showold()\">".t('old version')."</a> | ";
  278. echo "<a title=\"".t('Don\'t show lines removed from old version')."\" style=\"padding:1px 4px 3px 4px;\" id=\"newlink\" href=\"javascript:shownew()\">".t('new version')."</a> | ";
  279. echo "<a title=\"".t('Show both insertions and deletions')."\" style=\"background:#880000;padding:1px 4px 3px 4px;\" id=\"bothlink\" href=\"javascript:showboth()\">".t('both versions')."</a> ";
  280. echo "</h1>";
  281.  
  282. $newpost['code']=preg_replace('/^'.$CONF['highlight_prefix'].'/m', '', $newpost['code']);
  283. $oldpost['code']=preg_replace('/^'.$CONF['highlight_prefix'].'/m', '', $oldpost['code']);
  284.  
  285. $a1=explode("\n", $newpost['code']);
  286. $a2=explode("\n", $oldpost['code']);
  287.  
  288. $diff=new Diff($a2,$a1, 1);
  289.  
  290. echo "<table cellpadding=\"0\" cellspacing=\"0\" class=\"diff\">";
  291. echo "<tr><td></td><td></td><td>&nbsp;&nbsp;&nbsp;&nbsp;</td><td></td></tr>";
  292. echo $diff->output;
  293. echo "</table>";
  294. }
  295.  
  296. }
  297.  
  298.  
  299. }
  300.  
  301. ///////////////////////////////////////////////////////////////////////////////
  302. // show a post
  303. //
  304.  
  305. if (isset($_GET['help']))
  306. // if(isset($_GET['posttitle']))
  307. $page['posttitle']="";
  308.  
  309. // $posttitle=false;
  310. if(!isset($_REQUEST['posttitle']))
  311.  
  312. if ((strlen($page['post']['posttitle'])))
  313. {
  314. echo "<h1>{$page['post']['posttitle']}";
  315. if (strlen($page['post']['parent_pid']))
  316. {
  317.  
  318. echo ' (';
  319. printf(t("modification of post by %s"),
  320. "<a href=\"{$page['post']['parent_url']}\" title=\"".t('view original post')."\">{$page['post']['parent_poster']}</a>");
  321.  
  322. echo " <a href=\"{$page['post']['parent_diffurl']}\" title=\"".t('compare differences')."\">".t('view diff')."</a>)";
  323. }
  324.  
  325. echo "<br/>";
  326.  
  327. if (strlen($page['post']['token']) && ($page['token']==$page['post']['token']))
  328. {
  329. echo "<a href=\"{$page['post']['deleteurl']}\" title=\"".t('delete post')."\">".t('delete post')."</a> | ";
  330. }
  331.  
  332. $followups=count($page['post']['followups']);
  333. if ($followups)
  334. {
  335. echo t('View followups from ');
  336. $sep="";
  337. foreach($page['post']['followups'] as $idx=>$followup)
  338. {
  339. echo $sep."<a title=\"posted {$followup['postfmt']}\" href=\"{$followup['followup_url']}\">{$followup['poster']}</a>";
  340. $sep=($idx<($followups-2))?", ":(' '.t('and').' ');
  341. }
  342.  
  343. echo " | ";
  344. }
  345.  
  346. if ($page['post']['parent_pid']>0)
  347. {
  348. echo "<a href=\"{$page['post']['parent_diffurl']}\" title=\"".t('compare differences')."\">".t('diff')."</a> | ";
  349. }
  350.  
  351. echo "<a href=\"{$page['post']['downloadurl']}\" title=\"".t('download file')."\">".t('download')."</a> | ";
  352.  
  353. echo "<span id=\"copytoclipboard\"></span>";
  354.  
  355. echo "<a href=\"/\" title=\"".t('make new post')."\">".t('new post')."</a>";
  356.  
  357. echo "</h1>";
  358. //$page['post']['posttitle']=null;
  359. }
  360. if (isset($page['post']['pid']))
  361. {
  362. echo "<div class=\"syntax\">".$page['post']['codefmt']."</div>";
  363. echo "<br /><b>".t('Submit a correction or amendment below')." (<a href=\"{$CONF['this_script']}\">".t('click here to make a fresh posting')."</a>)</b><br/>";
  364. echo t('After submitting an amendment, you\'ll be able to view the differences between the old and new posts easily').'.';
  365. //$page=null;
  366. }
  367.  
  368.  
  369.  
  370. if (isset($_GET['help']))
  371. {
  372. h1('What is pastebin?');
  373. p('pastebin is here to help you collaborate on debugging code snippets. '.
  374. 'If you\'re not familiar with the idea, most people use it like this:');
  375.  
  376. echo '<ul>';
  377.  
  378. li('<a href="/">submit</a> a code fragment to pastebin, getting a url like http://pastebin.com/1234');
  379. li('paste the url into an IRC or IM conversation');
  380. li('someone responds by reading and perhaps submitting a modification of your code');
  381. li('you then view the modification, maybe using the built in diff tool to help locate the changes');
  382.  
  383.  
  384. echo '</ul>';
  385.  
  386.  
  387. h1('How can I view the differences between two posts?');
  388.  
  389. p('When you view a post, you have the opportunity of editing the text - '.
  390. '<strong>this creates a new post</strong>, but when you view it, you\'ll be given a '.
  391. '\'diff\' link which allows you to compare the changes between the old and the new version');
  392. p('This is a powerful feature, great for seeing exactly what lines someone changed');
  393.  
  394.  
  395. h1('How can I delete a post?');
  396. p('If you clicked the "remember me" checkbox when posting, you will be able to delete '.
  397. 'post from the same computer you posted from - simply view the post and click the "delete post" link.');
  398. p('In other cases, contact us and we will delete it for you');
  399.  
  400. h1('What\'s a private pastebin and how do I get one?');
  401.  
  402. p('You get a private pastebin simply by thinking up a domain name no-one else is using, '.
  403. 'e.g. http://private.pastebin.com or http://this-is-my.pastebin.com. Posts made into a '.
  404. 'subdomain only show up on that domain, making it easy for you to collaborate without the '.
  405. '\'noise\' of the regular service at <a href="http://pastebin.com">http://pastebin.com</a>');
  406.  
  407. p('All you need to do is change the web address in your browser to access a private pastebin, '.
  408. 'or you can simply enter the domain you\'d like below.')
  409. ?>
  410.  
  411. <form method="get" action="<?php echo $CONF['this_script']?>">
  412. <input type="hidden" name="help" value="1"/>
  413. <p><?php echo t('Go to')?> http://<input type="text" name="goprivate" value="<?php echo stripslashes($_GET['goprivate']) ?>" size="10"/>.pastebin.com
  414. <input type="submit" name="go" value="<?php echo t('Go')?>"/></p>
  415. <?php if (isset($_GET['goprivate'])) { p('Please use only characters a-z,0-9, dash \'-\' and period \'.\'. Your name must start and end with a letter or number.'); } ?>
  416. </form>
  417. <?php
  418.  
  419. p('Please note that there is no password protection - subdomains are accessible to anyone '.
  420. 'who knows the domain name you\'ve chosen, but we do not publish a list of domains used.');
  421.  
  422. h1('Subdomains for your language...');
  423.  
  424. p('If a subdomain matches a language name, the required syntax highlighting is selected '.
  425. 'for you, so ruby.pastebin.com will preselect Ruby automatically. ');
  426.  
  427. echo '<p>';
  428.  
  429. $sep="";
  430. foreach($CONF['all_syntax'] as $langcode=>$langname)
  431. {
  432. if ($langcode=='text')
  433. $langname="Plain Text";
  434. echo "{$sep}<a title=\"{$langname} Pastebin\" href=\"http://{$langcode}.pastebin.com\">{$langname}</a>";
  435. $sep=", ";
  436. }
  437.  
  438. echo '</p>';
  439.  
  440.  
  441.  
  442.  
  443. h1('And this is all free?');
  444. p('It will always be free, our hosting and maintenance costs are paid for through advertising.');
  445.  
  446.  
  447. h1('Can I get the source?');
  448. p('The source code to this site is available under a GPL licence. '.
  449. 'You can <a title="Pastebin source code, 245Kb" href="pastebin.tar.gz">download it here</a>');
  450.  
  451. p('More news available on my <a title="View pastebin related posts on my blog" href="http://blog.dixo.net/category/pastebin/">blog</a>.');
  452.  
  453.  
  454. h1('I have some feedback, who do I contact?');
  455. printf('<p>'.t('Use the feedback box in the sidebar or email %s').'</p>',
  456. '<script type="text/javascript">eval(unescape(\'%64%6f%63%75%6d%65%6e%74%2e%77%72%69%74%65%28%27%3c%61%20%68%72%65%66%3d%22%6d%61%69%6c%74%6f%3a%70%61%75%6c%40%65%6c%70%68%69%6e%2e%63%6f%6d%22%20%3e%50%61%75%6c%20%44%69%78%6f%6e%3c%2f%61%3e%27%29%3b\'))</script>');
  457.  
  458. }
  459. else
  460. {
  461. ?>
  462. <form name="editor" method="post" action="<?php echo $CONF['this_script']?>">
  463. <input type="hidden" name="parent_pid" value="<?php if(isset($_POST['pid']))
  464. echo $page['post']['pid']
  465. ?>"/>
  466.  
  467. <br/>
  468. <?php
  469.  
  470. echo t('Syntax highlighting:').'<select name="format">';
  471.  
  472. //show the popular ones
  473. foreach ($CONF['all_syntax'] as $code=>$name)
  474. {
  475. if (in_array($code, $CONF['popular_syntax']))
  476. {
  477. $sel=($code==$page['current_format'])?"selected=\"selected\"":"";
  478. echo "<option $sel value=\"$code\">$name</option>";
  479. }
  480. }
  481.  
  482. echo "<option value=\"text\">----------------------------</option>";
  483.  
  484. //show all formats
  485. foreach ($CONF['all_syntax'] as $code=>$name)
  486. {
  487. $sel=($code==$page['current_format'])?"selected=\"selected\"":"";
  488. if (in_array($code, $CONF['popular_syntax']))
  489. $sel="";
  490. echo "<option $sel value=\"$code\">$name</option>";
  491.  
  492. }
  493. ?>
  494. </select><br/>
  495. <br/>
  496.  
  497. <?php printf(t('To highlight particular lines, prefix each line with %s'),$CONF['highlight_prefix']); ?>
  498. <br/>
  499. <textarea id="code" class="codeedit" name="code2" cols="80" rows="10" onkeydown="return catchTab(this,event)"><?php
  500. if(isset($_POST['editcode']))
  501. echo htmlentities($page['post']['editcode'], ENT_COMPAT,$CONF['htmlentity_encoding']) ?></textarea>
  502.  
  503. <div id="namebox">
  504.  
  505. <label for="poster"><?php echo t('Your Name')?></label><br/>
  506. <input type="text" maxlength="24" size="24" id="poster" name="poster" value="<?php echo $page['poster'] ?>" />
  507. <input type="submit" name="paste" value="<?php echo t('Send')?>"/>
  508. <br />
  509. <?php echo '<input type="checkbox" name="remember" value="1" '.$page['remember'].' />'.t('Remember me'); ?>
  510.  
  511. </div>
  512.  
  513.  
  514. <div id="expirybox">
  515.  
  516.  
  517. <div id="expiryradios">
  518. <label><?php echo t('How long should your post be retained?') ?></label><br/>
  519.  
  520. <input type="radio" id="expiry_day" name="expiry" value="d" <?php if ($page['expiry']=='d') echo 'checked="checked"'; ?> />
  521. <label id="expiry_day_label" for="expiry_day"><?php echo t('a day') ?></label>
  522.  
  523. <input type="radio" id="expiry_month" name="expiry" value="m" <?php if ($page['expiry']=='m') echo 'checked="checked"'; ?> />
  524. <label id="expiry_month_label" for="expiry_month"><?php echo t('a month') ?></label>
  525.  
  526. <input type="radio" id="expiry_forever" name="expiry" value="f" <?php if ($page['expiry']=='f') echo 'checked="checked"'; ?> />
  527. <label id="expiry_forever_label" for="expiry_forever"><?php echo t('forever') ?></label>
  528. </div>
  529.  
  530. <div id="expiryinfo"></div>
  531.  
  532. </div>
  533.  
  534. <div id="end"></div>
  535.  
  536. </form>
  537. <?php
  538. }
  539. ?>
  540.  
  541. </div>
  542. </body>
  543. </html>



Please help me.........
Any insight or suggestion will b appreciated.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
devangjani is offline Offline
5 posts
since Aug 2009
Feb 23rd, 2010
0

Re: Undefined Index Error

Hi. You can do any of these 3 things.
1. Initialize every variable before using.
PHP Syntax (Toggle Plain Text)
  1. $x = "";
  2. $y = 0;
  3. $z = array(); ....
2. Change your php.ini file and set error_reporting to the following.
Quote ...
error_reporting = E_ALL & ~E_NOTICE
This will show all the errors except notices.
3. Add this line in your script. This is a runtime setting to show all errors except notices.
PHP Syntax (Toggle Plain Text)
  1. <?php
  2. error_reporting(E_ALL & ~E_NOTICE);
  3. //your code here
  4. ?>
Moderator
Featured Poster
Reputation Points: 511
Solved Threads: 349
Purple hazed!
nav33n is offline Offline
3,878 posts
since Nov 2007
Feb 23rd, 2010
0

Re: Undefined Index Error

You're accessing array elements without actually populating them. I'm assuming there must be other included files that handle the population of these variables. You should have a look at that. Specifically where the $page variable is being populated
Reputation Points: 13
Solved Threads: 19
Junior Poster
jomanlk is offline Offline
103 posts
since Oct 2009
Feb 23rd, 2010
0

Reply

Click to Expand / Collapse  Quote originally posted by nav33n ...
Hi. You can do any of these 3 things.
1. Initialize every variable before using.
PHP Syntax (Toggle Plain Text)
  1. $x = "";
  2. $y = 0;
  3. $z = array(); ....
2. Change your php.ini file and set error_reporting to the following.

This will show all the errors except notices.
3. Add this line in your script. This is a runtime setting to show all errors except notices.
PHP Syntax (Toggle Plain Text)
  1. <?php
  2. error_reporting(E_ALL & ~E_NOTICE);
  3. //your code here
  4. ?>

Thanks for ur suggestion bt i want to remove all notices and errors .
so plz if u have any other suggestions ..
Reputation Points: 10
Solved Threads: 0
Newbie Poster
devangjani is offline Offline
5 posts
since Aug 2009
Feb 24th, 2010
0

Re: Undefined Index Error

To disable all notices and errors, use,
PHP Syntax (Toggle Plain Text)
  1. error_reporting(~E_ALL);

If you disable errors, You will have a tough time trying to find out where exactly is the problem. Instead, use configuration directive, display_errors. Set this to "off" to hide any kind of error, and "on" to display errors.
Last edited by nav33n; Feb 24th, 2010 at 12:49 am.
Moderator
Featured Poster
Reputation Points: 511
Solved Threads: 349
Purple hazed!
nav33n is offline Offline
3,878 posts
since Nov 2007
This thread is more than three months old. Perhaps start a new thread instead?
Message:
Previous Thread in PHP Forum Timeline: Dynamic Title
Next Thread in PHP Forum Timeline: empty record added into database from text file





About Us | Contact Us | Advertise | Acceptable Use Policy
Build Custom RSS Feed


Follow us on Twitter


© 2010 DaniWeb® LLC