Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6922531
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T10:25:06+00:00 2026-05-27T10:25:06+00:00

This is really bugging me and I can’t figure it out. I have a

  • 0

This is really bugging me and I can’t figure it out. I have a form with a few options being sent by POST:

<form method="POST" action="scripts/submit.php"><strong>
    To User: <input type="text" name="ID" size="21" /><br />
    Short Description: <input type="text" name="Item" size="21" /><br />
    Link: <input type="text" name="Link" size="21" /><br />
    Points: <select name="Points">
    <option value="1" selected="selected">1</option>
    <option value="0">0</option><option value="-1">-1</option>
    </select> (1 = Positive, 0 = Neutral, -1 = Negative)<br />
    Text: <br /><textarea name="Text" rows="5" cols="50"/></textarea></strong><br />
    <input type="submit" value="Send" />
</form>

And here is the portion of submit.php that is giving me trouble:

<?php
include('functions.php');
Connect();

if(!isset($_SESSION)) 
{ 
session_start(); 
} 
$id_from = $_SESSION['SESS_MEMBER_ID'];
$id_to = Sanitize($_POST['ID']);
$item = Sanitize($_POST['Item']);
$link = Sanitize($_POST['Link']);
$points= Sanitize($_POST['points']);
$text = Sanitize($_POST['Text']);

Does anyone see an issue here? I am getting undefined index’s from all of the variables except the session one.

Thanks in advance.

edit: If i just have this:

<?php
include('functions.php');
Connect();
if(!isset($_SESSION)) 
{ 
session_start(); 
} 

$id_from = $_SESSION['SESS_MEMBER_ID'];
$id_to = Sanitize($_POST['ID']);
$item = Sanitize($_POST['Item']);
$link = Sanitize($_POST['Link']);
$points = Sanitize($_POST['points']);
$text = Sanitize($_POST['Text']);

?>

The variables populate just fine. If I add:

 $id_query=mysql_query("SELECT ID FROM tbl_users WHERE Username = '$id_to'");

 $count=mysql_num_rows($id_query);

 $id_row=mysql_fetch_array($id_query);
 $id_to=$id_row['ID'];

 if ($points> 1 || $points< -1) {
     echo "Nice try";
     exit();
 } else {

 if(!($id_to == $id_from))
 {
 if($count==1)
 {
 mysql_query("INSERT INTO tbl_data (Item, Link, Points, Text, ID_To, ID_From) VALUES ('$item', '$link', '$points', '$text', '$id_to','$id_from')");
 header('Location:?id=submit');
 }
 else
 {
 echo "Nice try1";
 }
 }
 else
 {
 echo "Nice try2";
 }
 }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T10:25:06+00:00Added an answer on May 27, 2026 at 10:25 am

    I just took your code over at my dev server at tried to test run it. Since I don’t know what your Sanitize() do, I can’t be sure what is going on inside this function.

    If you try to remove the Sanitize(), I’m pretty sure it would work and you will have to look inside this to find the bug.

    I’m guessing you might be missing something like ($var, str) for sanitize a string. Can you please tell a little more about this function ?

    edit: some minor spelling errors.

    Edit: Did some more test and made the error happen and the two codes shows it. The 1st works, while the 2nd gives me a empty var_dump.

    This one gives me a full var_dump();

    <?
    function Sanitize($String) { 
    $output = mysql_real_escape_string(stripslashes($String));
    return $output;
    }
    if(!isset($_SESSION)) 
    { 
    session_start(); 
    } 
    ?>
    <form method="post" action=""><strong>
    To User: <input type="text" name="ID" size="21" /><br />
    Short Description: <input type="text" name="Item" size="21" /><br />
    Link: <input type="text" name="Link" size="21" /><br />
    Points: <select name="Points"><option value="1" selected="selected">1</option><option value="0">0</option><option value="-1">-1</option></select> (1 = Positive, 0 = Neutral, -1 = Negative)<br />
    Text: <br /><textarea name="Text" rows="5" cols="50"/></textarea></strong><br />
    <input type="submit" value="Send" />
    </form>
    
    <?
    
    $id_from = $_SESSION['SESS_MEMBER_ID'];
    $id_to = Sanitize($_POST['ID']);
    $item = Sanitize($_POST['Item']);
    $link = Sanitize($_POST['Link']);
    $points= Sanitize($_POST['points']);
    $text = Sanitize($_POST['Text']);
    
    
    var_dump($_POST);
    
    echo $text;
    
    ?>
    

    This one gives me an empty var_dump

    <?
    if(!isset($_SESSION)) 
    { 
    session_start(); 
    } 
    ?>
    <form method="post" action=""><strong>
    To User: <input type="text" name="ID" size="21" /><br />
    Short Description: <input type="text" name="Item" size="21" /><br />
    Link: <input type="text" name="Link" size="21" /><br />
    Points: <select name="Points"><option value="1" selected="selected">1</option><option value="0">0</option><option value="-1">-1</option></select> (1 = Positive, 0 = Neutral, -1 = Negative)<br />
    Text: <br /><textarea name="Text" rows="5" cols="50"/></textarea></strong><br />
    <input type="submit" value="Send" />
    </form>
    
    <?
    
    $id_from = $_SESSION['SESS_MEMBER_ID'];
    $id_to = Sanitize($_POST['ID']);
    $item = Sanitize($_POST['Item']);
    $link = Sanitize($_POST['Link']);
    $points= Sanitize($_POST['points']);
    $text = Sanitize($_POST['Text']);
    
    
    var_dump($_POST);
    
    echo $text;
    
    ?>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This really shouldn't be hard, I just can't figure out how to do it.
Ok I have this problem that I've never had before, it's really bugging me.
This is really bugging me, so I hope someone can help me a bit
Eclipse is really bugging me with this. I have an Android project that is
This really should be easy, but I just can't work it out myself, the
I should be sleeping but this is really bugging me. I can't get a
I have this really random problem with is bugging me. It works at the
I have a project that I am working on and I can't figure out
This is really bugging me, but I have a component where a Button is
Hay all, this is really bugging me. I have downloaded phpimage from http://sourceforge.net/tracker/index.php?func=detail&aid=2844769&group_id=103281&atid=738747 I've

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.