Banderson 29 Junior Poster in Training

To expand on cereal's comment. You may also look into the types of comparison operators.
== is Equals. Using this operator will only compare the value.
=== is Identical. This operator will compare type and value of the variable.

=== Should be used on strings.

Banderson 29 Junior Poster in Training

NetBeans user here as long as I care to remember.

Banderson 29 Junior Poster in Training

In logout.php maybe try to use
unset($_SESSION['username']);

<?php 
unset($_SESSION['username']);
session_destroy();
header("location:index.php");
?>
Banderson 29 Junior Poster in Training

This is how I would do this. Create a form to add everything including the upload for the license and note. Choose what type of formats you want to allow also. (eg: pdf, png, jpg, rtf etc....)

Add the form fields to the database and upload the license and note to a protected folder on your server. Name the uploaded file first name_last name_state_some_random string or numbers and use this path in the database field.

You could also create a folder for that user on the fly with a random unique name and number and use that in your database for the file path.

This is just my opinion. I personally like directory structures for images and files instead of using a database. The less calls to a database the better.

Banderson 29 Junior Poster in Training

Yes you can use variables to build your query. One way is to build your form, validate whether or not fields in your form are blank and if so do not process those fields. The fields that are activated use them for your query. You can also put all the database and form fields in an array and process them that way.

Also since you are using PDO you can also look into prepared statements and transactions.

There are several ways to do this. These are just a couple of possibilities.

Banderson 29 Junior Poster in Training

The most obvious place is the manual itself you can view them online or download it in multiple languages.

Click Here

I also found the O'Reilly php books very helpful when I was a beginner and still do from time to time. Good luck in your experience.

Click Here

Banderson 29 Junior Poster in Training

Hi Wikit. If you have found a solution please mark this thread as solved.

Banderson 29 Junior Poster in Training

Be sure the path to your images are correct and that the images actually exist. What is happening with the code? Are you getting just a broken image error?

If you have GD installed locally and this code is working properly on another server, I would think it could possibly be a path problem. Be sure it is not.

Banderson 29 Junior Poster in Training

I don't think it is possible using PHP since PHP is server side only. It will only return the time and date of the server. You may need to use javascript or another client side language to get the client machine time and then capture that value with PHP and insert it into your database.

Banderson 29 Junior Poster in Training

As pritaeas mentioned, it is probably a misconfiguration on localhost. Try to run this code in localhost:

<?php
if ( extension_loaded( 'gd' ) && function_exists( 'gd_info' ) ) {
                echo "You have the GD Library installed";
} else {
                echo "GD Library is not installed";
}
?>
Banderson 29 Junior Poster in Training

If this is happening to you input your information into your code instead of GMail ports, host and your credentials. Check with your host. Almost all servers have SMTP installed. If your host offers email solutions from your website then they more than likely have SMTP servers installed. If your looking for totaly free solution then you could use localhost by installing SMTP on localhost and editing your PHP ini file to reflect the correct info. (ie: username, password, port, and host)

Also if your sending multiple emails from your database at one time then it may be getting caught in GMail's spam filters. One way to avoid this is to send the emails using threads. That way you can set timers to send the emails over a period of time instead of all at once.

Banderson 29 Junior Poster in Training

I usually use GDChart if I need to generate a graph or chart in PHP. Also if you need have a way to manipulate the chart in a browser you could use PHP to update the values or you could use JQuery. What you use depends on the type of manipulation you require.

The Extension is Here:
http://pecl.php.net/package/GDChart

Banderson 29 Junior Poster in Training

Yes there are several free alternatives for SMTP and PHP.

If your server has PEAR installed you could use that. You can also use GMail or SwiftMailer to send email. The solution that urtrivedi has given you is a free solution, but here are a couple more links below.

pear.php.net Click Here
swiftmailer Click Here

Banderson 29 Junior Poster in Training

Do you have your PHP extensions configured correctly? Also I am not sure what version of PHP version you are using or your OS, but PHP support for MSSQL is not supported on windows with PHP 5.3 or later.
http://www.php.net/manual/en/intro.mssql.php

Banderson 29 Junior Poster in Training

This can be done using Bootstrap.
Have alook at this fixed top example.

Banderson 29 Junior Poster in Training

Make sure you uploaded your files to your public folder.

Banderson 29 Junior Poster in Training

There is documentation on it if you use the symbol as intended with an @see in JAVADOC

Click Here

Banderson 29 Junior Poster in Training

There is nothing to explain. # is not used because it is not implemented in JAVA to be used that way.
You could put it in a string , but you cannot use it the way you are explaining.
That character is not accepted everywhere anyway. JAVA is designed to run in all enviroments and the #
has multiple meanings. This is probably the main reason you cannot use it that way.

It can mean :

pound
hash
number

and more. How is JAVA suppose to know what total is by using this character?

Banderson 29 Junior Poster in Training

You could easily create a PHP method to record each hit from each IP.
Just input the hits to your database and increment a given column on the table.
If so many hits deny IP by writing to Apache or another php script which will deny IP.
If you think the culprit is running proxy on your server then you can incorporate JAVA to get the machine name or use MaxMind Click Here and incorporate the exact idea I listed.
Problem solved, bad guy gone..

Banderson 29 Junior Poster in Training

What is your database name? Where are you selecting it? Are you connecting and selecting in another include?
If this is your complete code above, then the query is failing. Add die() like so on this line.

$resultcitrix = mysql_query($select_query_citrix)or die(mysql_error()); 

You will need to connect and select above this line.

Banderson 29 Junior Poster in Training

PHP can read text files with any separator you input.
The text files needs to be read access on your server to be read.
However, you do know this will expose your passwords and acccount information to anyone that finds the path to this text file on your server, right?

In other words, I highly recommend you do not store sensitive information in a text file.
As cereal said, use Facebook's API. It has been tested for security and you will be within the boundries of the developer's agreement.

Banderson 29 Junior Poster in Training

This code is encrypted. You will need a key or hash to decrypt, echo will not work. That simple.
It's not that easy :). Has the developer given you permission?

Even if you figure out how to decrypt it , unless it is your code your illegal. It is called reverse engineering.
You do it to any of my apps and I am coming after you with lawyers to get what you got.

I also know this code belongs to :
paymentmedium.com

With error code:
This script is locked for paymentmedium.com domain name. Your details submitted to Admin.

Who are you trying to fool?

Banderson 29 Junior Poster in Training

You want complex eh? Use Laravel. Laravel is OOP and why reinvent the wheel?

I like a touch of craft in my applications this is why I always use objects and not arrays.

Banderson 29 Junior Poster in Training

@diafol I agree. In my development I can do without Ajax completely as PHP can do what Ajax can do if coded correctly, on the fly(eg: return errors()).

I'd also like to add that the more javascripts you add to a page the slower it can become for the client since these types are client side.
My verdict, if you want speed then code keep your "code => standards" and stay on the sever side as much as possible.

Banderson 29 Junior Poster in Training

@cmps Yes input date is a new type defined in HTML5. Actually pretty handy.
To bad it doesn't work in older browsers(eg: IE 8) and 9 as features are limited. HTML5 is great for the upcoming web however.

Banderson 29 Junior Poster in Training

There is no such thing as a date input type unless your developing with HTML5.

Your code needs to be:

<?php
$system_date = Date('m/d/Y');
?>

<input type = "text" value ="<?php echo $system_date; ?>">

The date method in PHP has single or double quotes, since it is a defined function.

Banderson 29 Junior Poster in Training

Sorry wrong forum. deleted.

Banderson 29 Junior Poster in Training

Sounds like your query is failing. Try to replace

// if successfully updated. 
if($result){
echo "Successful";
echo "<BR>";
echo "<a href='list_records.php'>View result</a>";
}

else {
echo "ERROR";
}

with:

// if successfully updated. 
if($result):
echo "Successful";
echo "<BR>";
echo "<a href='list_records.php'>View result</a>";
elseif(!$result):
    die('Error: ' . mysql_error());
endif;

This should give you a detailed error message as to why it is failing instead of a generic error message.

Banderson 29 Junior Poster in Training

We can't help you because the code you posted above does not pertain to these problems.
You will need to post the codes that are causing you these problems.

Also, you may want to pm a moderator and ask for them to move this thread to the PHP forum since this is more of a php related problem.

Banderson 29 Junior Poster in Training

Read your error. Connection to host was established , but username and/or password are wrong.

Banderson 29 Junior Poster in Training

Wow Dani, I am sorry to hear this. I have been a member here for a few days. I do not post a lot, but I do frequent the forums. Personally I enjoy this forum more than Stackoverflow.

Looking at your examples, I believe it is the way the answers are linking to Daniweb.

Example 1 : Link Text is "Here"
Example 2 : Doesn't add up at all to me. DaniWeb should clearly be on top in this case.
Example 3: Is the entire link instead of link text.
Example 4: Another entire link instead of link text.
Example 5 : This one doesn't add up either.

I would contact Google and find out why these results are being displayed like this. Maybe they can give you some insight. As a last resort you could always block any referer you wish.
Eventually the linking would stop. I think this could possibly hurt even more short term, but increase traffic like it was in the future.

Banderson 29 Junior Poster in Training

I am assuming you are requiring a captcha of some sort.
As pritaeas stated, look into AJAX.
You can refresh a css DIV using AJAX without refreshing the entire page.
Generate the string with PHP and embed the string/function into the css DIV.
Make an AJAX call whenever you want it to refresh, by doing this you should generate a function call to your PHP.
Update your database and/or sessions to the newly generated string to allow comparison.

Banderson 29 Junior Poster in Training

Have a look:
Click Here

veedeoo commented: thanks for sharing Mr. Banderson +8
Banderson 29 Junior Poster in Training

I doubt very seriously that you will be able to deploy an app running under that version.
Even so I would not recommend it. That version of PHP is 7 years old.
It has major security flaws in it. If you decide to deploy it under that version I would expect to get hacked.

Banderson 29 Junior Poster in Training

I'd like to add also. You can't remove an item from an array, it is not possible.
You can only change its value to whatever you need or NULL. If the value is null then the key is still there, but it's value is NULL.
When you create an array it's values are placed into a memory block on the system until the end of program execution or a break point.

Banderson 29 Junior Poster in Training

Actually i m new to java.......tell me one thing whats the diff. between java programming language and javascript programming language

About 82 USD more an hour is the first thing that comes to my mind.

Banderson 29 Junior Poster in Training

That's the best way to overwrite anything in a framework.
In CodeIgnitor just extend the base class and put it in the appropriate folder.
CodeIgnitor has empty Library , helper etc... folders. Simply extend the class you want and put it in those empty folders.

Banderson 29 Junior Poster in Training

I have never worked with MATLAB so I can't comment on how to import with it, but it remains the same. You will still have to import them into your application and call the library packages as needed.
As you know you have to have a main method to execute and these jar files do not contain a main, they are only class files.

Banderson 29 Junior Poster in Training

This prints for me. Yes you can store the value(s) of config[] in a database.

<?php $config['slogan'] = "My Website Slogan"; ?>

<div class="row-2">
    <div class="titles">
        <?=$config['slogan']?>
    </div>
</div>
Banderson 29 Junior Poster in Training

Yes you can use curl to do this. If it is a very large video then you will probably have to increase memory on your PHP installation or you can crash the server
if your php locks and can't close the connection. Being on shared hosting I would not attempt this. Your host techs will notice it almost immediately through bandwidth tranfers.

If you want to really do this, then you will need to be hosted in a cloud or a dedicated server and you will have direct access to your server.
And yes be careful about copyrights or you can end up with a hefty fine.

Banderson 29 Junior Poster in Training

This is a framework. You can't just execute it. It is for development. If you want to work with it then you have to go to your IDE and import the library, which is the jar file and then import the packages from the library into your code as needed.

Banderson 29 Junior Poster in Training

The current url is not being declared nor do you have a redirection as I said in the code you have posted.

Banderson 29 Junior Poster in Training

This is the way I do MVC in instances like this. I post the form to self (eg: the curent URL) validate the form on the fly and check for credentials if all is well redirect to the auth pages.

In other words above the line :

$this->setAction("/auth/index");

you need to get the current url and pass it to the setAction()

Banderson 29 Junior Poster in Training

I started to wonder the same. You can't have an input text with a clickable link in it. If you want this array to be passed to the input field you can use what veedeoo said which is easier than trying to parse a string like that.

  <?php
           $data2 = array('c'=>'google.com');
           ?>
           <INPUT name="c" value="<?php echo 'http://',$data2['c']?>">&nbsp;
Banderson 29 Junior Poster in Training

Try this:

<INPUT name=c value="<?php echo 'href=http://',$data2['c'],' " ',$data2['c'] ?>">&nbsp;
Banderson 29 Junior Poster in Training

Here is the way it is suppose to be done. When a user registers the password is hashed and salt is applied to that hash and the hash goes into the database with the salt. Now when the user signs in you apply the same algorithm to the password and you match the hash not the plain password. As others have stated do not use encrypt on passwords with codeIgnitor. If a knowingly user gains access to your database they could easily decrypt all your passwords with a rainbow table attack to find your encryption key. Use encrypt for your sessions not passwords.

I am left to wonder why you are reinventing the wheel. Many developers have already created systems that have been time tested and are proven to work for frameworks like CodeIgnitor. That's why we design classes for other developers to build upon. Developers want to move forward, building better, safer and faster apps, not spin our wheels. Here is the one I use in all my apps, commercial and private.

http://haseydesign.com/flexi-auth/

iamthwee commented: solid +14
Banderson 29 Junior Poster in Training

The code I posted above has bugs in it. I rewrote the code for you. I used get instead of post. Unless your posting to a different script it is far less stressful to use get or request. I have double checked this code so it works. I coded it so you don't have to leave the page . You can continue changing last names all day using $_GET. This code can show you how powerful $_GET is. Sorry earlier for that post, it's been a long night.

<?php echo "
<!DOCTYPE>
<html>
    <head>

        <title>Update Data</title>
    </head>

    <body>


        <form name=\"form_update\" method=\"get\">";


            $con = mysqli_connect("localhost", "root", "", "ismat_db");

             // Attempt Connect
            if (mysqli_errno($con)) {
                echo "Can't Connect to mySQL:" . mysqli_connect_error();
            } else {
                echo "Connected to mySQL</br>";
            }

            // Drop menu id
            echo "<select name= 'id' >";

            echo '<option value="">' . '--- Please Select Person ---' . '</option>';

            $query = mysqli_query($con, "SELECT id, Firstname FROM persons");

            while ($row = mysqli_fetch_array($query)) {

                $fName = $row['Firstname'];
                $id = $row['id'];


                // Passing vars to dropdown . ID is value - First Name is String
                echo "<option value='" . $id . "'>" . $fName . '</option>';
            }

            echo '</select>';
            echo '&nbsp;';
            echo '<input type="submit" name="submit" value="Submit"/>';


            if (isset($_GET['id']) && isset($id)) { // is id set?
                $id = $_GET['id']; // Get the id via url string


                // Get record via id
                $result = mysqli_query($con, "SELECT id,Firstname,Lastname,Gender,Subject,Hobbies FROM persons WHERE id = '" . $id . "'") or die(mysqli_errno($con));



                echo '<table border="1" align="center">' . '<tr>' . …
Banderson 29 Junior Poster in Training

First you need to create a primary key id. What if you have 10,000 people in a database , more than likely a few of them will have the same first name. So we can use your primary key id for the selection. Also put an index on id and first name. It makes your queries faster when indexed.

I changed some in your code so you can study what I did. It works as expected on my machine. Also you can read about variable scope in PHP here

Here are my changes:
Line 27 - Added id to the Select
Line 30 - Put $row['id'] into memory.
Line 47 - Selected id again in the query so we can add it to the data array stack at 0 on line 62.

Line 97 Passed $id to the update. This is where it was failing.

<!DOCTYPE>
    <html>
        <head>

            <title>Update Data</title>
        </head>

        <body>


            <form name="form_update" method="post">

                <?php
                $con = mysqli_connect("localhost", "root", "", "ismat_db");
                //============== check connection
                if (mysqli_errno($con)) {
                    echo "Can't Connect to mySQL:" . mysqli_connect_error();
                } else {
                    echo "Connected to mySQL</br>";
                }
                //==========connection code end
                //==========dynamic drop down start
                echo "<select name= 'FirstName' >";

                echo '<option value="">' . '--- Please Select Person ---' . '</option>';

                $query = mysqli_query($con, "SELECT id,FirstName FROM persons");

                while ($row = mysqli_fetch_array($query)) {
                    $id = $row['id'];
                    echo "<option value='" . $row['FirstName'] . "'>" . $row['FirstName'] . '</option>';
                }

                echo '</select>';
                echo '&nbsp;';
                echo '<input type="submit" name="submit" value="Submit"/>';

                //-------------displaying associated row …
Banderson 29 Junior Poster in Training

Do you mean background color? If so use this, tweek as needed:

myContentPanel.getContentPane().setBackground(Color.YourColorVariable_here);
myContentPanel.getContentPane().validate();
myContentPanel.getContentPane().repaint();
Banderson 29 Junior Poster in Training

Use the SecurityManager class located in the java.lang package and set up a security policy for the files.