Squidge 101 Newbie Poster

what is the URL before you start this script?
where are you requesting the $email from?

if you var_dump($email); is there a valid output?

Squidge 101 Newbie Poster

dgerbergss,

Have a look here, it is from MySQl website and shows how to nest queries

Squidge 101 Newbie Poster

Where is your Login/Logout button?

Assign your button a name (ie/ button_1), then use your existing IF statement.

if(isset($_SESSION[user_active_statue] == 1))
{
    $button_1 = "Logout";
}
else {
    $button_1 = "Login In";
}
Squidge 101 Newbie Poster

WTF, i got a PM today. Please block how ever this bell end is:

Hello
my name is queen
how are you doing ,i hope fine i saw your profile today and became interested in you, it will be my humble pleasure to know you the more, and i kindly want you to send an email to my mail so that i will send you my picture for you to know whom i am . Here is my email address [jobe.queen@yahoo.com] I believe we can move from here if it will be your pleasure thanks and God bless,have the best of the day. am waiting for your reply in my mailbox please don't send it in the site
[Remember the distance or color does not matter but love matters allot in life]

[jobe.queen@yahoo.com]

Squidge 101 Newbie Poster

You could select all User email address and create an array.

Then use the array in the BCC field (that way no one gets other peoples email address')

Squidge 101 Newbie Poster

id Studentid Department Subject Semester Marks Min Max Total Percentage
1 111819 MBA History Fourth 200 100 200 200 94.93
2 111820 MCA c third 100 40 60 80 67.9

So, to make sure i undestand.
If student with ID 111819 puts in his/her ID you want the Dept/Sub/Marks etc to be displyed?

If your first question is resolved, please vote up :)

Squidge 101 Newbie Poster

lenthy post well that is all about the PHP

You need to include your post data or the sql is not goning to update any info.

To double check the data is populated in the POST array:
var_dump($_POST);

If this is showing the data, you will need to clean it (never trust user input)

Then assign the POST data:

`

$Studentid = $_POST['Studentid'];
$id = $_POST['id'];

`

You should then be able to update the data in the DB

Squidge 101 Newbie Poster
   $host="localhost"; // Host name
    $username="root"; // Mysql username
    $password="root"; // Mysql password
    $db_name="project"; // Database name
    $tbl_name="add_marks"; // Table name
    // Connect to server and select database.
    mysql_connect("$host", "$username", "$password")or die("cannot connect");
    mysql_select_db("$db_name")or die("cannot select DB");
    // update data in mysql database
    $sql="UPDATE $tbl_name SET Studentid='$Studentid' WHERE id='$id'";
    $result=mysql_query($sql);
    // if successfully updated.
    if($result){
    echo "Successful";
    echo "<BR>";
    echo "<a href='edit_marks.php'>View result</a>";
    }
    else {
    echo "ERROR";
    }

Is this the code you use to update the DB?

Where is the POST data?

Squidge 101 Newbie Poster

Can you provide your form code, and also the DB layout?

Squidge 101 Newbie Poster

@CarterLangley
You would need Java/JQuery to auto refresh the form on the change of the drop down.

Give your form an ID and call submit on it using something like:

$('#myform').submit();

where 'myform' is the id of your form

Or something like this

Squidge 101 Newbie Poster

You have missed the ";"

<label class="grey" for="firstname">Firstname:</label>
<input class="field" type="text" name="firstname" id="firstname" size="23" value="<?php echo $firstname; ?>"/>
Squidge 101 Newbie Poster

looks good totti2007

Squidge 101 Newbie Poster
Squidge 101 Newbie Poster

@totti2007,

I came across this some time back Click Here

Squidge 101 Newbie Poster

<form action="home.php" method="get"> Email:<input type="text" name="email"/> </form>

also try adding id="email"

<form action="home.php" method="get"> Email:<input type="text" name="email" id="email"/> </form>

Squidge 101 Newbie Poster

karolismf, you are wanting to URL rewrite (aka MOD_REWRITE), this is done via .htaccess file.

So for example you could turn this url:

www.somewebsite.com/index.php?s1=43&s4=44

Into something like:

www.somewebsite.com/43/44

Squidge 101 Newbie Poster

the error you are seeing is relating to the login details/access rights.

Is the DB user you are using got access rights to the database it self?

Squidge 101 Newbie Poster

why in the PHP section?

Squidge 101 Newbie Poster

Oh BLISS! Thanks Squidge +1 from me!

lol, you are welcome

Squidge 101 Newbie Poster

Thank you diafol. I am starting to learn OOP. I haven't heard of 'Yii', i will have a look at that.

I did look at Zend and well..... very almost gave up :)

I used Aptana 3 a while back, but it kept locking up on me for a starnge reason

Squidge 101 Newbie Poster

not sure if this is correct but remove the die statment from your redirect:

<?php
if ($Count == 0)
 {
 mysql_close();
 header("Location: Errors/Login/Existance.php");
 exit();
 }
?>

Also check the relativness of the path to your current script

Squidge 101 Newbie Poster

I have been looking over current frameworks available and I am looking to settle on CodeIgnitor.

What framework and IDE do you use?

What are the plus sides, limitations of your choice?

Squidge 101 Newbie Poster

@BadManSam, for user login form as veedeoo syas if this is not done correctly you can leave your complete system open for some very powerful attacks.

I would suggest a frame work that has been tried and tested and maintained. 2 that come to mind would be Zend_Framework found Here, or CodeIgnitor Here

Both are throughly tested for attacks, and will give you the functionality you are after

Squidge 101 Newbie Poster

mysqlquery("SELECT image_id FROM image WHERE ???");

Why not :
mysqlquery("SELECT image_id FROM image WHERE user_id = $_SESSION['user_id']");

Squidge 101 Newbie Poster

Are you getting an error message at all?

Are you amending

require_once ('includes/config.inc.php');
require('../connections/dbconnect.php');

to ensure the correct login details

Squidge 101 Newbie Poster

that would indicate the include file is not being created

Squidge 101 Newbie Poster

You could always change the string to lower case if you do not want to take case in to it:

$username='TestName';
$user='testname';

$username = strtolower($username);
$user = strtolower($user);

if ($username==$user){
    print "This is the result I want." ;
}else{
    print "This isn't the result I want." ;
}
Squidge 101 Newbie Poster

"UPDATE web_members SET name='$name', lastname='$lastname', email='$email' WHERE id='$id'";

$PDO_con = new PDO; // Create DB connection
$sql = "UPDATE web_members SET name='$name', lastname='$lastname', email='$email' WHERE id='$id'";
$q = $PDO_con->prepare($sql);
$q->execute; // Execute cmd
Squidge 101 Newbie Poster

But what does this mean?

An example

Squidge 101 Newbie Poster

Try this site:

Click Here

Found this

Squidge 101 Newbie Poster

i maybe wrong but i think you need to have your session before any output, also i notice you are changing between MySQL and MySQLi. Is there a reason for that?

Squidge 101 Newbie Poster

in php i insert some data into database. In database s_no automatic increase when any data instered.
I want to get that s_no. how do i get it.

Newbie1234, can you show some code you are using? What is the naming in you db table?

YOu would get the s_no (assuming primary key?) in the exact manner as you would any other data from the database

Select s_no from 'table' where s_no = 'something'

Squidge 101 Newbie Poster

what work have you already done in your student project?
All of these can be done, have you look over PHP.net?

meriyas commented: I am developing project management System +0
Squidge 101 Newbie Poster

+1 for PDO

Squidge 101 Newbie Poster

"INSERT INTO Crews (ID, Driver24, Medic24, DriverDay, MedicDay, DriverCall, MedicCall) VALUES('$_POST[Driver24]', '$_POST[Medic24]', '$_POST[DriverDay]', '$_POST[MedicDay]', '$_POST[DriverCall]', '$_POST[MedicCall]')";

UPDATE table_name SET field1=new-value1, field2=new-value2 [WHERE Clause]

update crews set Driver24='$_POST[Driver24]', Medic24='$_POST[Medic24]',DriverDay='$_POST[DriverDay]',MedicDay='$_POST[MedicDay]',DriverCall='$_POST[DriverCall]',MedicCall='$_POST[MedicCall]' WHERE id='$_POST[id]'

Squidge 101 Newbie Poster

To do a redirect after the SQL query you would use:
header("location:[page to redirect to]");

To edit existing data in the DB you would want to obtain the data from the DB and display in the text fields:

eg <input type="text" name="Medic24" value="<?php $variable_of_the_data; ?>size="60" />

You would change the "INSERT" into an "UPDATE" statement and use the 'ID' against the WHERE clause

Hope that helps

*EDIT:

You should also clean the form input before inserting/updating the database. don't trust anyone (in regards to form input)

Squidge 101 Newbie Poster

error log output? any error showing in the browser?

Squidge 101 Newbie Poster

Simplest way

use a form with 3 fields.
current password
new password
Confirm

Compare the current to that already in the DB table, use if stmt so if it is ok, then compare the new and confirm. If these match, update. If not throw exception

Squidge 101 Newbie Poster

DHCp server can be used for many things. If you have no need fo rit, i wouldnt worry to much. They assign IP address to units in a network, for example if you have a PXE server, any unit that connects to this would require an IP, so DHCp assigns for this, and away you go.

Inregards to where your PC's are getting there IP/DHCP from, this would be your router. Most modern routers, will act as a DHCP for easy local network setup. If you wanted to use a DHCp server you would need to disable this in your router. However this would require you to leave the DHCP server always on.

Squidge 101 Newbie Poster

have you checked the firewall? add an exception

Squidge 101 Newbie Poster

error logs?

Squidge 101 Newbie Poster

yes. I would suggest driving the AVAILABLE page by PHP and database

Squidge 101 Newbie Poster

dwlamb, with includes you need to include the path unless you have include the include path in your ini file

Squidge 101 Newbie Poster

It seems this is an issue with PHP 5.

Really??? you have an error some where

Squidge 101 Newbie Poster

data objects, are not stored data like a database, they are the data from the data base stored in objects.

This may help Click Here

Squidge 101 Newbie Poster

thanks to all.

i think diafol is right, i will try it.

let me know how you get on. looks interesting

Squidge 101 Newbie Poster

no is the short answer to that, PHP is a server side logic language. You would be looking at C, or C++ something like that

Squidge 101 Newbie Poster

do you have a typo in the file name?

is that the file location?

Squidge 101 Newbie Poster

to be honest I have no idea, could be to do with UAC on the OS.

Squidge 101 Newbie Poster

can you export the IIS setup and import to your other server?