Jump to content

Search the Community

Showing results for tags 'Warning'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • W3Schools
    • General
    • Suggestions
    • Critiques
  • HTML Forums
    • HTML/XHTML
    • CSS
  • Browser Scripting
    • JavaScript
    • VBScript
  • Server Scripting
    • Web Servers
    • Version Control
    • SQL
    • ASP
    • PHP
    • .NET
    • ColdFusion
    • Java/JSP/J2EE
    • CGI
  • XML Forums
    • XML
    • XSLT/XSL-FO
    • Schema
    • Web Services
  • Multimedia
    • Multimedia
    • FLASH

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Languages

Found 4 results

  1. Hi, I am having an issue with a warning that keeps popping up. I have edited the line it is saying but still getting the error. Warning: Cannot modify header information - headers already sent by (output started at /Pages/Forums/comments.php:227) in /Pages/Forums/comments.php on line 88 Here are the two lines that the warning is saying function setNote($conn) { if (isset($_POST['NoteSubmit'])) { $id = mysqli_real_escape_string($conn, $_POST['id']); $date = mysqli_real_escape_string($conn, $_POST['date']); $note = mysqli_real_escape_string($conn, $_POST['note']); $sql = "INSERT INTO note (id, date, note) VALUES ('$id', '$date', '$note')"; $result = mysqli_query($conn, $sql); header("Location: /Pages/Profile.php"); //This line has the error - LINE 88 } } And the other function getNote($conn) { $id = $_SESSION['id']; $sql = "SELECT * FROM note WHERE id='$id'"; $result = mysqli_query($conn, $sql); while ($row = $result->fetch_assoc()) { echo "<div class='comment-box'><p><b>"; echo "Note: </b><br>"; echo nl2br($row['note']); echo "</p></div> <form class='delete-form' method='POST' action='".deleteNote($conn)."'> <input type='hidden' name='nid' value='".$row['nid']."'> <button type='submit' name='deleteNote'>Delete</button> </form>"; //This line has the error - LINE 227 } } Now after I refresh the page, I see what i typed. Hope someone has and answer. Thanks!
  2. Hi all, what a great forum you've created. I keep reading and eventually I need your help. I'm running that site and the W3 Validator spits out some errors related to the brackets. As you see, I'm using a wordpress theme and I don't even see those brackets in my code. Now I'm wondering if you have any solutions to that which you can offer. Thanks and regards Chris
  3. Hai... iam new for C# ...im learning ..i created a table and showing it...now i want to update,edit and delete the records...i did it in my way...Problem is whenever i give save ,addnew or delete button it shows "Object reference not set to an instance of an object."this error at line 120 " cb.DataAdapter.Update(ds1.Tables["workers"]);"my program. using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Threading.Tasks;using System.Windows.Forms; namespace naag_database{ public partial class Form1 : Form { public Form1() { InitializeComponent(); } System.Data.SqlServerCe.SqlCeConnection con; System.Data.SqlServerCe.SqlCeDataAdapter da; DataSet ds1; int MaxRows = 0; int inc = 0; private void Form1_Load(object sender, EventArgs e) { con = new System.Data.SqlServerCe.SqlCeConnection(); con.ConnectionString = "DataSource=C:\\Users\\g.nagaraj\\Documents\\Databases\\naag.sdf"; con.Open(); System.Data.SqlServerCe.SqlCeDataAdapter da; string sql = "SELECT*from tbl_naag"; da = new System.Data.SqlServerCe.SqlCeDataAdapter(sql, con); ds1 = new DataSet(); MessageBox.Show("Connection Open"); da.Fill(ds1, "workers"); //GridItemCollection.Datasource = ds1; //GridItemCollection.Databind(); NavigateRecords(); MaxRows = ds1.Tables["Workers"].Rows.Count; con.Close(); } private void NavigateRecords() { DataRow dRow = ds1.Tables["Workers"].Rows[inc]; textBox1.Text = ds1.Tables["Workers"].Rows[inc].ItemArray.GetValue(4).ToString(); textBox2.Text = ds1.Tables["Workers"].Rows[inc].ItemArray.GetValue(3).ToString(); textBox3.Text = ds1.Tables["Workers"].Rows[inc].ItemArray.GetValue(2).ToString(); textBox4.Text = ds1.Tables["Workers"].Rows[inc].ItemArray.GetValue(1).ToString(); } private void btnNext_Click(object sender, EventArgs e) { if(inc !=MaxRows-1) { inc++; NavigateRecords(); } else { MessageBox.Show("No more Rows"); } } private void btnPrevious_Click(object sender, EventArgs e) { if (inc > 0) { inc--; NavigateRecords(); } else { MessageBox.Show("First Record"); } } private void btnLast_Click(object sender, EventArgs e) { if (inc != MaxRows - 1) { inc = MaxRows - 1; NavigateRecords(); } else { MessageBox.Show("Last record"); } } private void btnFirst_Click(object sender, EventArgs e) { if (inc != 0) { inc = 0; NavigateRecords(); } } private void btnNew_Click(object sender, EventArgs e) { textBox1.Clear(); textBox2.Clear(); textBox3.Clear(); textBox4.Clear(); btnNew.Enabled =false; btnSave.Enabled =true; } private void updateDB() { System.Data.SqlServerCe.SqlCeCommandBuilder cb; cb = new System.Data.SqlServerCe.SqlCeCommandBuilder(da); cb.DataAdapter.Update(ds1.Tables["workers"]); } private void btnSave_Click(object sender, EventArgs e) { DataRow dRow = ds1.Tables["Workers"].NewRow(); dRow[4] = textBox1.Text; dRow[3] = textBox2.Text; dRow[2] = textBox3.Text; dRow[1] = textBox4.Text; ds1.Tables["Workers"].Rows.Add(dRow); updateDB(); MaxRows = MaxRows + 1; inc = MaxRows - 1; btnNew.Enabled = true; btnSave.Enabled = false; } private void btnupdate_Click(object sender, EventArgs e) { DataRow dRow2 = ds1.Tables["workers"].Rows[inc]; dRow2[4] = textBox1.Text; dRow2[3] = textBox2.Text; dRow2[2] = textBox3.Text; dRow2[1] = textBox4.Text; updateDB(); MessageBox.Show("Data Updated"); } private void btndelete_Click(object sender, EventArgs e) { } private void label5_Click(object sender, EventArgs e) { } private void labelUpdate() { label4.Text = "Record " + (inc + 1) + " of " + MaxRows; } } }
  4. <form name="form" action="enter.php" method="post"> First Name: <input type="text" name="first" /><br /> Last Name: <input type="text" name="last" /><br /> <input type="checkbox" name="c1" value="1" onclick="showSubmit()" /> <input type="checkbox" name="c1" value="1" onclick="showSubmit()" /> <input type="checkbox" name="c3" value="1" onclick="showSubmit()" /> <!-- SUBMIT BUTTON HERE --> </form> If I only check the 1st and the 3rd checkbox and press the submit button, but in my enter.php, I made it check print out each of the inputs like so: <?php echo $_POST["first"];echo $_POST["last"];echo $_POST["c1"]; echo $_POST["c2"]; echo $_POST["c3"];?> I will get a warning/error claiming that the c2 is undefined. Is there a built in function that checks if something is undefined ? That way I can use a if and else statement: if is it undefined, it will print something, and if it is checked (defined), make it print something else.
×
×
  • Create New...