Jump to content

SynGreis

New Members
  • Posts

    8
  • Joined

  • Last visited

SynGreis's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Solution if(!isset($_GET['step'])){$_GET['step'] = 'main';} not sure why it started working but it seems to be gone now. Please close this thread,
  2. the queries isnt an issue i just put a wrapper to make it conform. Im not redoing all my scripts to be PDO compatible. So im already set when php7 rolls out. I am essentially on my way OUT of PHP. I barely use it. And im not sure when the next time i will use it after this little project. Ill be doing minor updates but nothing major enough to cause me to relearn things. Too busy and im going away from web development. So. The request...All i need to know how is to deal with it when there is an empty string. IT will just not cooperate and i cant remember how i did it in the past.
  3. dude....this looks like a disaster just to do one query. And whats the alternative to $_REQUEST?
  4. uhm...yea ofcourse im open to new ways. Its just i havent done php for a few years to be honest.... how would you handle this?
  5. thats not the problem.....the problem is when there is nothing stored in step. http://localhost/chrisauto/invoice.php <=== on this link Notice: Undefined index: step in D:\xampp\htdocs\chrisauto\invoice.php on line 3 <=== getting this error. heres the code. <?PHP include('header.php'); switch($_REQUEST['step']){ default: echo '[<a href="invoice.php?step=new">Create a new invoice</a>]<br/><br/>'; $pullinvoice = mysql_query("SELECT iid, customer FROM invoice ORDER BY iid")or die('There is no invoices. Make one?'); echo '<table border="1" cellpadding="5" cellspacing="0"><tr><td>Invoice ID</td><td width="200">Customer</td><td>Options</td></tr>'; while($invoice = mysql_fetch_array($pullinvoice)){ echo '<tr><td>'.$invoice['iid'].'</td><td>'.$invoice['customer'].'</td><td>[<a href="invoice.php?step=edit&inv='.$invoice['iid'].'">Edit</a>] [<a href="invoice.php?step=delete&inv='.$invoice['iid'].'">Delete</a>]</tr>'; } echo '</table>'; break; case 'edit': $info = mysql_fetch_array(mysql_query("SELECT * FROM invoice WHERE iid=".$_REQUEST['inv']))or die('Invalid Invoice. Does not exist.'); echo '<form action="invoice.php?step=update&inv='.$info['iid'].'" method="post">'; echo '<table cellpadding="5" cellspacing="0">'; echo '<tr><td>Customer</td><td><input type="text" name="customer" value="'.$info['customer'].'"></td></tr>'; echo '<tr><td valign="top">Bill Address</td><td><textarea rows="5" name="baddress">'.$info['baddress'].'</textarea></td></tr>'; echo '<tr><td>Make</td><td><input type="text" name="make" value="'.$info['make'].'"></td></tr>'; echo '<tr><td>Model</td><td><input type="text" name="model" value="'.$info['model'].'"></td></tr>'; echo '<tr><td>Year</td><td><input type="text" name="year" value="'.$info['year'].'"></td></tr>'; echo '<tr><td>ODO Read</td><td><input type="text" name="odoread" value="'.$info['odoread'].'"></td></tr>'; echo '<tr><td>VIN</td><td><input type="text" name="vin" value="'.$info['vin'].'"></td></tr>'; echo '<tr><td colspan="2"><center><input type="submit" value="Update"></center></td></tr></table></form>'; break; case 'update': echo $_REQUEST['baddress']; mysql_query("UPDATE invoice SET customer='".$_REQUEST['customer']."', `baddress`='".$_REQUEST['baddress']."', make='".$_REQUEST['make']."', model='".$_REQUEST['model']."', year='".$_REQUEST['year']."', odoread='".$_REQUEST['odoread']."', vin='".$_REQUEST['vin']."' WHERE iid=".$_REQUEST['inv'])or die(mysql_error()); //Header("Location: invoice.php?step=edit"); break; } include('footer.php'); ?>
  6. yea same error. I dod one for step and for act in another script. still the same thing.
  7. i have tried that... if(!isset($act)){$act = '';}else{$act = $_GET['act'];} i used to just do import_request_variables("GP"); but now its just being a douche. How can i do this correctly?
  8. Notice: Undefined index: step in D:\xampp\htdocs\chrisauto\invoice.php on line 3 Cant remember how to fix this. i tried isset, empty, !, cant remember... <?PHP include('header.php'); switch($_REQUEST['step']){ default: echo '[<a href="invoice.php?step=new">Create a new invoice</a>]<br/><br/>'; $pullinvoice = mysql_query("SELECT iid, customer FROM invoice ORDER BY iid")or die('There is no invoices. Make one?'); echo '<table border="1" cellpadding="5" cellspacing="0"><tr><td>Invoice ID</td><td width="200">Customer</td><td>Options</td></tr>'; while($invoice = mysql_fetch_array($pullinvoice)){ echo '<tr><td>'.$invoice['iid'].'</td><td>'.$invoice['customer'].'</td><td>[<a href="invoice.php?step=edit&inv='.$invoice['iid'].'">Edit</a>] [<a href="invoice.php?step=delete&inv='.$invoice['iid'].'">Delete</a>]</tr>'; } echo '</table>'; break; case 'edit': $info = mysql_query("SELECT * FROM invoice WHERE iid=".$_REQUEST['inv'])or die('Invalid Invoice. Does not exist.'); while($inf = mysql_fetch_array($info)){ } break; } include('footer.php'); ?> Notice: Undefined index: step in D:\xampp\htdocs\chrisauto\invoice.php on line 3
×
×
  • 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.