Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => General

Undefined index:

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

Undefined index:

Postby Alidad » Wed Apr 24, 2013 3:06 pm

hi, I'm having trouble with code that are works great in online but on my local pc I'm getting errors said

Undefined index: step in C:\webserver\apache\htdocs\index.php on line 46

please see line 46 where it said

<?php
if (!$_GET['step'] && !$_POST['step']) {
?>

does anyone tell me how can i solve this please!

please see in the bold line...

<?php
$module_title = 'Jcow ';
$module_name = 'admin';
$writable_arr = array('./my/config.php');
require("./install/db_ctrl.php");
$default_lang = 'en';
require("./install/lang/$default_lang/install.php");
$dbtype = 'MySQL';
$homeurl = "http://".$_SERVER['HTTP_HOST'].preg_replace("/\/install\.php/i","",$_SERVER['REQUEST_URI']);
if (preg_match('/localhost/i',$homeurl) || preg_match("/^192\.168/i",$homeurl) || preg_match("/^10\.2\./i",$homeurl) || preg_match("/^127\.0\.0/i",$homeurl)) {
$testing = 1;
}
// header ----------------------------------------------------------------------------------------------------------------------

?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html
xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="install/default.css" rel="stylesheet" type="text/css" media="all" />
<title><?php echo' TK SNS '?></title>
</head>
<body>

<div id="logo">
<br>
<span style="font-size:20px;font-weight:bold">
TK Network Installation</span>
</div>
<div id="content">
<div id="main">
<?php
if (!$_GET['step'] && !$_POST['step']) {
?>


<table width="100%">
<tr><td colspan="2">
<i><?php echo $msg['about']; ?></i>
</td></tr>
<form action="install.php" method="post">
<tr><td colspan="2" class="row1">
Database
</td></tr>
<tr>
<td align="left" class="row2">
<?php echo $msg['dbhost']; ?></td><td class="row2"><input type="text" name="dbhost" value="localhost" /></td>
</tr>
<tr>
<td align="left" class="row2"><?php echo $msg['dbname']; ?></td><td class="row2"><input type="text" name="dbname" /><br />(The database should be existing)</td>
</tr>


please help thanks.

AM
Alidad
New php-forum User
New php-forum User
 
Posts: 4
Joined: Fri Feb 18, 2011 12:44 pm

Re: Undefined index:

Postby johnj » Wed Apr 24, 2013 7:45 pm

This issue has been discussed more than a hundred times on this forum.
Please read about the function called isset() in php.

Also, take a look at this blog
Http://phillipnb.wordpress.com/2010/11/ ... -and-_get/
johnj
php-forum Super User
php-forum Super User
 
Posts: 1805
Joined: Thu Mar 10, 2011 5:07 pm


Return to PHP coding => General

Who is online

Users browsing this forum: No registered users and 2 guests

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.

cron