divinity02 6

hi dani

that was just something that I was trying to do just to see if it will work but it didnt, kinda fix it but still it is not inserting. yesterday i was out all day with a friend of mine, trying to get it to insert but to no avail. will post the new code later on today

divinity02 6

thank you very much dani

divinity02 6

hi it is me again, this is my assignemet been trying to fix this php script for a long time

first to begin, it was issuing an error,

Warning: join(): Invalid arguments passed in C
this is the first error

and the second error was: notice: undefined index in c.
apprently if my html code, i had register a the values when registering but in my php code i had enter instead, so i fix it right

now after i finished fixing it, i tried to register a user and now i am getting a blank page, dont know what is the cause but maybe a third eye can see what I cant. please help
here is what i have tried.

<?php

        //$register=$_POST['register_user']; 
         if(isset($_POST['register']))
        {

            //capture the variable from the form and store in php variables
            $title=$_POST['title'];
            $firstname=$_POST['fname'];
            $lastname=$_POST['lname'];
            $username=$_POST['username'];
            $email=$_POST['email'];
            $gender=$_POST['gender'];
            $service= join(", ", $_POST['services']);
            $address=$_POST['address'];
            $mypwd=$_POST['mypwd'];

            include'db_server.php';

            //Query the database
            $sql="SELECT * FROM members WHERE username='$username'";

            $result= mysqli_query($conn, $sql) or die ("ERROR:" .mysqli_error($conn));

            $rowcount=mysqli_num_rows($result);

            //checking to see if username is already exist
            if($rowcount >= 1) 
            {
                 echo "<script type=\"text/javascript\">
                      alert('Username already exits');
                      window.location=\"../xhtml/register_user.html\";
                       </script>";

            }
            else
            {
                //insert data into table

                $sql = "INSERT INTO members
                VALUES('$title', '$firstname', '$lastname', '$username', '$email', '$gender', '$service', '$address', md5('$mypwd'))";

                if(mysqli_query($conn,$sql))
                {

                    echo "<script type=\"text/javascript\">
                      alert('Welcome!! $firstname $lastname, you are now a member of the Caribbean Nature Seekers Institute TT(CNSITT)');
                      window.location=\"../index.html\";
                       </script>";

                        mysqli_close($conn);    
                }
                else
                {
                    echo "Error inserting values into database";
                }

                //end of line

            }
        }

?>

divinity02 6

I am trying to validate my registration form but my php codes blocking it some how, I keep this error, Notice: undefined index: in gender c and for the life of me cant seem to find the correct way to fix it nothing I tried is working.

and also I have been trying to insert data in the database and it is not inserting at all, I knew there is an error somewhere within the codes and I cant find. can someone plzzzzzzzzzzz help me fix this. here is both the php scripts and the html to go with it

this is the html codes

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" 
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head>
        <title> Register </title>
        <link rel="stylesheet" type="text/css" href="../css/stylesheet.css" />
    </head>
    <body>
        <div id="container" >
            <div id="header">
                <img src="../images/header.jpg" alt="header" />
            </div>
            <div id="navbar">
                <ul>
                    <li><a href="../index.html" id="tlinks" class="toplinks" >Homepage</a></li>
                    <li><a href="featureNationalWonders.html" id="thold" class="toplinks">Feature National Wonders</a></li>
                    <li><a href="contact.html" id="linkhold" class="toplinks">Contact Us</a></li>
                    <li><a href="register.html" id="phold" class="toplinks">Sign Up</a></li>
                    <li><a href="login_user.html" id="loglinks" class="toplinks">Login</a></li>
                    <li><a href="aboutus.html" id="panlinks" class="toplinks">About Us</a></li>

                </ul>   
                    <form method="post" id="search"   action="" >
                        <div>
                            <input type="text" name="search" value=""/>
                            <input type="submit" value="Search"/>
                        </div>                      
                    </form> 
            </div>
            <br/><br/>
            <div id="contentArea">
                <form method="post" action="../php/register_user1.php" name="frmRegister" onsubmit="return validateForm()";>

                        <p>
                            <label> User Personal Information</label>
                        </p>
                                <p>
                                     <label>Title</label>
                                    <select id="title" name="title">
                                        <option value="" selected="selected" > Select a Title</option>
                                        <option value="Ms">Ms.</option>
                                        <option value="Mrs">Mrs.</option>
                                        <option value="Mr">Mr.</option>
                                        <option value="Dr">Dr.</option>
                                    </select>
                                </p>

                            <p> 
                                 <label>First Name:</label>
                                <input type="text" name="firstname" id="firstname" size="47"/>

                            </p>
                            <p>
                                <label>Last Name:</label>
                                <input type="text" name="lastname" id="lastname" size="47"/>
                            </p>
                            <p>
                                <label> UserName:</label>
                                <input type="text" ...

divinity02 6

this assignmet call for inserting data into the database and also retrieve. at one time it was inserting into the database but for strange reason it just stop inserting, i have search every noook and cranny within the code to find the error. I know that there is an error there that cause it to stop inserting. but what it is I really dont know. I am almost to the point of pulling out my hair. and another thing error is that I have set it to redirect it to the login page(this is the registration page am talking about) one mine it giving an error underfined index: gender in C, but I dont know how to fix it. ah lots of things is going on with this php codes and i cant seem to find what is worng and now am trying to validate it using js and cant get it to do it.

here is my html

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" 
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head>
        <title> Register </title>
        <link rel="stylesheet" type="text/css" href="../css/stylesheet.css" />
    </head>
    <body>
        <div id="container" >
            <div id="header">
                <img src="../images/header.jpg" alt="header" />
            </div>
            <div id="navbar">
                <ul>
                    <li><a href="../index.html" id="tlinks" class="toplinks" >Homepage</a></li>
                    <li><a href="featureNationalWonders.html" id="thold" class="toplinks">Feature National Wonders</a></li>
                    <li><a href="contact.html" id="linkhold" class="toplinks">Contact Us</a></li>
                    <li><a href="register.html" id="phold" class="toplinks">Sign Up</a></li>
                    <li><a href="login_user.html" id="loglinks" class="toplinks">Login</a></li>
                    <li><a href="aboutus.html" id="panlinks" class="toplinks">About Us</a></li>

                </ul>   
                    <form method="post" id="search"   action="" >
                        <div>
                            <input type="text" name="search" value=""/>
                            <input type="submit" value="Search"/>
                        </div>                      
                    </form> 
            </div>
            <br/><br/>
            <div id="contentArea">
                <form method="post" action="../php/register_user1.php" ...

divinity02 6

I am doing this assignment i have to redirect the login page to the welcome back page to authenticate the use identity but i am getting this error in the welcome_back page in page. i have look everywhere to find the error. the error is the

and now here is my code for it.

        <div id="contentArea">
            <?php
                    session_start();
                    if(!session_is_registered("username"))
                    {
                        header("location:login_user.php")
                    } <--the error is right here
                     Parse error: syntax error, unexpected '}' in C:\wamp64\www\Taylor_Luana_ITEC244_Assignment\php\welcome_back.php on line 43
            ?>
            <?php
                    echo "Welcome back " . $_SESSION['username'];
            ?>

            <div id="footerbox">

                    <div id="footerholder">
                        <div id="">

                            <a href="browsenationalwonders.php">Browse National Wonders</a>
                            <a href="updateprofile.php">Update Profile</a>
                            <a href="postnaturalwonder.php">Post Natural Wonders</a>
                            <a href="logout.php">Logout</a>

                        </div>

                    </div>
            </div>
        </div>

    </body>

</html>

divinity02 6

in my assignment I trying to create a popup box but someting wrong with my code. it supposed to popup when called and close as it have a close button but the button is not working

can something tell me what did i do wrong.

here is my code: is there somethings that some else can i and I cant

<?php
    /*session_start();
    if(!isset($_SESSION['view']))
    {
        header("location:../xhtml/login.html");
    }*/

?>

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head>
        <title> Caribbean Nature Seekers Institute Trinidad and Tobago Chapter</title>
        <link rel="stylesheet" type="text/css" href="../css/stylesheet.css" />
    </head>
    <body>
        <div id="container">

            <div id="header">
                <div  id="banner">
                    <img src="../images/header.jpg" alt="header" />
                </div>
            </div>
            <div id="navbar">
                <ul>

                    <li><a  href="../index.html" id="tlinks" class="toplinks">Homepage</a></li>
                    <li><a  href="featureNaturalWonders.html" id="thold" class="toplinks">Feature Natural Wonders</a></li>
                    <li><a  href="contact.html" id="linkhold" class="toplinks" >Contact Us</a></li>
                    <li><a  href="register_user.html" id="phold" class="toplinks"> Sign Up</a></li>
                    <li><a  href="login.html" id="loglinks"class="toplinks"> Login</a></li>
                    <li><a  href="aboutus.html" id="panlinks" class="toplinks"> About Us</a></li>

                </ul>   
                    <form method="post" id="search"   action="" >                       
                        <input type="text" name="search" value=""/>
                        <input type="submit" value="Search"/>                                               
                    </form>             

            </div>  

            <br/>
            <br/>
            <br/>

<html lang="en" dir="ltr">  
    <head>
        <meta charset="utf-8">
        <link rel="stylesheet" href="../css/stylesheet.css"/>

    </head>
    <body>
        <div class="show_box">
            <a class="btn">show Box</a>
            <div id="box">
                <span class="ion-checkmark-round"></span>

                <h1>"Hi Welcome!!!!!! Luana Taylor, you are now are member of Caribbean Nature Seekers InstituteTT ('CNSITT')");</h1>

                <a class="close">Close</a>

            </div>

            <script  type="text/javascript">
             var c=0'

             function pop()
             {
                 if(c == 0)
                 {
                     document.getElementById("box").style.display = "block";
                     c ==1;

                 }
                 else
                 {
                     document.getElementById("box").style.display = "none";
                     c ==1;
                 }
             }
        </div>
    </body>
</html>

        <div id="contentArea">

            <div id="footerbox">

                    <div id="footerholder">
                        <div id="">

                            <a href="../index.php">Homepage</a>
                            <a href="popupbox.php">Popup box </a>
                            <a href="featureNationalWonders.php">Feature National Wonders</a>           

                        </div>

                    </div>
            </div>
            <div id="footerFix"></div>              
                <div id="footerbox">
                    <div id="footer" >
                        <div id="footerholder" ...

divinity02 6

I got it fix thanks

divinity02 6

I use the echo, to echo out the error and that is how that error come up

divinity02 6

that is the problem dani, am not getting any kind of errors that i can show, all it say error inserting data in database, so i dont know if it is some error within the code and I am not seeing it. and i run it again and i am now seeing this error,

the error is the variable $conn,

Notice: Undefined variable: conn in C:\wamp64\www\Taylor_Luana_ITEC244_Assignment\php\register_user.php on line 35

divinity02 6

hi

am doing this assignment in web develpment. have been trying to run it but for some reason it is not working.

maybe a third eye will hope

here is the code

<?php

        error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE);

        if(isset($_POST['register_user']))
        {
            //capture the variable from the form and store in php variables

            $title=$_POST['title'];
            $fullname=$_POST['fullname'];
            $lastname=$_POST['lastname'];
            $screenname=$_POST['screenname'];
            $email=$_POST['email'];
            $gender=$_POST['gender'];
            $address=$_POST['address'];
            $mypwd=$_POST['mypwd'];

            //connecting to the server

            include'db_server.php';

            $conn = mysqli_connect($db_host,$db_username,$db_password) or die (mysqli_connect_error());

            //select the database you want to query

            mysqli_select_db($conn, 'national_wonders') or die (mysqli_error($conn));
            $sql = "SELECT * FROM members WHERE screenname='$screenname'";
            $result = mysqli_query($conn, $sql) or die ("ERROR:" .mysqli_error());
            $rowcount = mysqli_num_rows($result);

            if($rowcount >= 1)
            {
                echo"<script type=\"text/javascript\">
                    alert('Username already exits!!');
                    window.location=\"../php/popup.php\";
                    </script>";
            }
            else
            {
                //insert data into table

                $sql = "INSERT INTO members
                VALUES('$title', '$fullname', '$lastname', '$screenname', '$address', '$email', '$gender',  'md5('$mypwd))";

                if(mysqli_query($conn,$sql))
                {
                    echo"<script type=\"text/javascript\">
                    alert(Welcome);
                    window.location=\"login.php\";
                    </script>";
                }
                else
                {
                    echo "Error inserting values into database";
                }

            }

        }   

?>

divinity02 6

I am created a homework tutorial webpage where i have to make an image clickable and what I meant is that when the image is click, it should open up a pdf file and that is where iI am having the problems

this is what i have tried on numerous occasion and it is not working. < href="https://www.studentorientation.com and many other like it but none seem to be working.

would like to know what is the correct code to get it to work. any help would be much appreciated.

thanks in advance

divinity02 6

hey guys dont bother i figure out how to apply the background color but thanks for 7 views and zero replies

divinity02 6

hi everyone

I am currently in the process of designing a bank atm machine appliction and I would like to apply a backgrond color to some of the button, I tried some codes but it dont seem to be working, well what I meant was I dont know if the codes I used is the correct form for a background color of a jbutton. I am probably missing codes, can you all tell me if what I have here is the correct thing and could point me in the correct direction here is the codes that I used. do I put it in the cancel button

      `   private void btn_cancelActionPerformed(java.awt.event.ActionEvent evt) {                                           

               do i type the codes inside of here or outside. but these are the codes i usex

        } 

        `                          

or do i type it outside of the cancel actionperformed button

       ` public void run() {
                    try{

                        UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());

                }catch(Exception e){
                        e.printStackTrace();
                }

                    JButton btn_cancel = new JButton("Cancel");
                    btn_cancel.setBackground(Color.RED);
                    btn_cancel.setContentAreaFilled(false);
                    btn_cancel.setOpaque(true);

                    //JOptionPane.showMessageDialog(null, btn_cancel);

            }

    };
                SwingUtilities.invokeLater(run);
                any help would be appreciated`

divinity02 6

oka james but am getting two errors here
error no.1 when I remove the zero it is telling it need to initalizing and
error no.2 when i remove/grayout the variable, it is telling me to create a local variable and it cannot find symbol

what do i do and how do i fix this

divinity02 6

hi people

I am building a atm machine but havent actually coding it as yet, just the gui interface part i have done so far because i am doing something else at the moment but in between i would do someting with it. so i have put in an if and else statement.

the atm should be work like this, when a person deposit any amount a pop box will tell u the money is deposit. it should also show u your current balance, bal enquiry, be able to get fast cash and able to widthdrawal right.

I have started with the widthdrawal part for. well i mean am just testing it out so i put in an if and else statement. the things is with the widthdrawal, i have put a limit to which a user can widthdraw, if the user goes beyond the required widthdrawal amount, a pop box will tell the user that it is an invalid transaction, meaning that the transaction entered exceeded the amount, but for some reason it only goes to the part where it tells the user to take the case when the wrong amount is entered when it should go to the else statement to tell the user that the wrong amount has been entered.

tell me what i have done wrong. I havent been programming for a while eh. here is the code that i used .

it is the same for the savings and the chequeing account.

any help will ...

divinity02 6

yes I have said so before like u didnt read, i have successfully import java sql before and had no problems with importing it

divinity02 6

hi james and rprofiitt

there version of netbeans that i am using is version 8.2

divinity02 6

hi james

if I download the javame edition, seeing that it is the upgrade to the one that I hve which is 2.5.2 which is the old versio, will it over ride that one that I have at present or will it be just be separate

divinity02 6

javame is what" is that another software where u can write programs or is it an upgraded version

divinity02 6

yes i have other program that I am currently working on and it doesnt have that problem,

divinity02 6

hi james

yes it is java am using, i have not starting using any other languages, or have learned any other languages as yet

divinity02 6

hey jc

i have upload the file for you to see where the error, is it called screenshot, all the errors are there and the error message says, it cannot find symbol the red lines underneath
Connection
ResultSet
PreparedStatement

that is the error,

divinity02 6

hi james and rproffitt

here is the code

package forensic;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import javax.swing.*;

/**
 *
 * @author luana taylor
 */
public class forensic_login extends javax.swing.JFrame {
Connection conn = null;
PreparedStatement pst = null;
ResultSet rs = null;

    /**

the errors that I am getting is that it cannot find symbol

I have now starting to build the login gui page, I want it to hook up to the database, so when there is a login it can say you are login successfully or invalid login

divinity02 6

rproffitt
what is wrong with my question, i have seen question asked worst than mine and it was answered and yes I did check to see if there was any questions that may be pertaining to mine but I didnt see any hence the reason for asking if my question wasnt good enough to warrant an answer then sorry

divinity02 6

hi everyone

i have not been here in a while. so here I am practicing building a forensic managment java application but the thing, i am trying to connect to the database, so, like i am importing the codes that would help connect to the database, like I mean the connection, the preparedstatement and the resultset and for some reason am getting errors, is it because that java is not finding the it or wat.

the errors stating that it cannot find the symbol, I am only importing.

divinity02 6

hi all

presently am doing an assignment. for the past hour or have been experiencing one error to the next with it. it is website am doing where a user can register, login, view their profile etc.
one part of the assignment is where u have to insert and display images on the site using php.

I get thru in some aspect of the assignment concerning the inserting and displaying images. i cant get the images to display, dont know if there is something wrong with the code or what. I am currently getting this errors. have tried everything that I can think of. search on the net, got a few ideas, tried it out but nothing seem to be working. I have only 2 more day to finish this assignment. I am on crunch time here. so any solution would be greatly appreciated.
these are the two errors
error no. 1: Notice: Undefined variable: sql in C:\wamp64\www\luana_itec244\php\upload.php on line 22
error no. 2: Notice: Undefined variable: sql in C:\wamp64\www\luana_itec244\php\upload.php on line 22

they are both on the same line. here is my codes. I need some answers not people just viewing my questions and passing it str8. much thanks in advance.

<?php

        session_start();

    if(isset($_POST['submit']))
    {

        $db_host='localhost';
        $db_username='root';
        $db_password="";

        $con=mysqli_connect($db_host,$db_username,$db_password) or die(mysqli_connect_error());

            mysqli_select_db($con, 'food') or die(mysqli_error($con));
            if(isset($_GET["img_id"]))
            {

                $sql="SELECT * FROM tbl_images WHERE img_id='$img_id'";
            }
            if(isset($_POST['submit']))
            {
                $result=mysqli_query($con,$sql) or die("Error:" .mysqli_error($con));
                $rowcount=mysqli_num_rows($result);
            }

            if($rowcount >=1)
            {
                echo"<script type=\"text/javascript\";
                        alert('files not uploaded');
                        window.location=\"login.html\";
                    </script>";
            }
                else
                {
                    //insert images into table ...

divinity02 6

hi

I have a login form, when i tried to login i got this two errors:
Notice: Undefined index: username in C:\wamp64\www\FormTutorial\php\luana_login.php on line 6
Notice: Undefined index: password in C:\wamp64\www\FormTutorial\php\luana_login.php on line 7

I have been busting my head to figure out how to solve it so I went online to see if I can find a solution to fix the errors and I came across. I dont know how effective it is so
I have decide to give a tried to see how it work but this things when i put in my codes the errors gone but it give me a blank page when it should have give me the login form
to which i should be able to login.

this is the codes that I tried to use:

$username = @mysql_real_escape_string($_POST['user_name']);//when i add the code the errors is gone but give me a blank
$password = @mysql_real_escape_string($_POST['password']);

this is my codes below for the login form

<?php

        // capture values from the form and store in php variables

        $uname=($_POST['username']);
        $pword=($_POST['password']);

        //connection to the database

        $db_host='localhost';
        $db_username='root';
        $db_password="";
        $con=mysqli_connect($db_host, $db_username, $db_password) or die (mysqli_connect_error());

        //select the database to query
        mysqli_select_db($con, 'staff') or die (mysqli_error($con));
        $sql="SELECT * FROM applicant  WHERE uname ='$uname' AND pword=md5('$pword')";
        $result=mysqli_query($con,$sql) or die ("Error:" .mysqli_error($con));
        $rowcount=mysqli_num_rows($result);

        if($rowcount == 1)
        {
            session_start();
            $_SESSION['user']=$username;
            header("location:luana_profile.php");
        }
        else
        {
            echo"<script type=\"text/javascript\">
            alert('username and password doesn't exist');
            window.location\"../xhtml/luana_login.html\";
            </script>";
        }
        mysqli_close($con);

?>

how is that possible, what can i do to fix it or tell me ...

divinity02 6

hi pple

I have an question, i am creating a webpage for an assignment and one is that I have to create a page for the users to upload their pictures for other to see and take but I would like to know how do i go about doing that in php. can someone point me in the right direction. or at least give me a head start.

divinity02 6

1 contributor, 2 views 0 replies, sad smdh