Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > Beginning PHP
|
Beginning PHP Beginning-level PHP discussions. More advanced coders should post to the Pro PHP forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning PHP section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 24th, 2011, 03:02 AM
Registered User
 
Join Date: Aug 2011
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Undefined index in PHP

Hi ,

I am new to this forum and i am not quite sure if I post in the correct corner, my apology for this.

I really need your expertise about my little problem.
I am using CodeIgniter framework in my project. What i am doing is passing all variable value to another page by the use of jquery.
(sorry for my term, i am still new to programming)
When i try to click the submit button, it goes me to the page but it says:
"A PHP Error was encountered
Severity: Notice

Message: Undefined index: project_name

Filename: controllers/insert_classes.php

Line Number: 7
"


this is my sample code in request_view.php(this is under view)
<script type="text/javascript">
$(document).ready(function(){
$('#submit_button').click(function(){
$.post('<?php echo base_url(); ?>index.php/insert_classes/request/',
{
project_name: $("#project_name").val()
project_key: $("#project_key").val()
},function(){
alert("ning sulod bai!");
window.location='<?php echo base_url(); ?>index.php/insert_classes/request';
});
});

});
</script>

and to get the value, i just simply code this one in my insert_classes.php(this is a controller)

function request(){
ECHO $_POST["project_name"];
}

It may be very simple for you, but not for me...

I hope someone can help me out of this....

Thanks in advance...





Similar Threads
Thread Thread Starter Forum Replies Last Post
undefined index and variable p3allen2000 Pro PHP 1 November 1st, 2007 04:49 PM
Undefined index junemo Pro PHP 8 October 31st, 2007 05:45 PM
Ch9 charlist.php undefined index grambell23 BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 2 July 7th, 2006 08:39 PM
Undefined Index Error rit01 Beginning PHP 0 March 1st, 2006 10:03 AM
Undefined index ashinotani Beginning PHP 2 August 17th, 2004 03:31 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.