Jump to content

PHP error, I need help Pls. (I'm New to PHP)


u0206787@nus.edu.sg

Recommended Posts

1. Undefined variable: on line 41 ([color=red]if ( $signin != "" ) {[/color] )
2. Undefined variable: on line 75 ([color=red]mysql_close($link); {[/color] )
3. mysql_close(): supplied argument is not a valid MySQL-Link resource on line 75
4. Undefined variable: on line 77 ([color=red]if ( $adminsignin != "" ) {[/color] )
5. Undefined variable: on line 105 ([color=red]mysql_close($link); {[/color] )
6. mysql_close(): supplied argument is not a valid MySQL-Link resource on line 105

I'm running on EasyPHP 1.8.0.1; with Apache 1.3.33; PHP 4.3.10; MySQL 4.1.9. Pls I need your kind advise.i have the code in PDF format, pls help me


[attachment deleted by admin]
Link to comment
https://forums.phpfreaks.com/topic/22115-php-error-i-need-help-pls-im-new-to-php/
Share on other sites

[code]<?php

if ( $signin != "" ) {
// Make a MySQL Connection
$link = mysql_connect($host, $user, $password) or die(mysql_error());;
mysql_select_db("myfirstphp_uk_db") or die(mysql_error());
mysql_close($link);
?>
[/code]

[code]<tr>
<td width="100%" align="center"><input type="submit" value="Sign In"
name="signin" tabindex="3"><input type="reset" value="Reset" name="B2"></td>
</tr>
</form>
<tr>
<td width="100%">&nbsp;</td>
</tr>[/code]

why i can't use the variable 'signin'? It shows it's an undefine variable. Pls anyone can spot the mistake.
[quote author=wildteen88 link=topic=109557.msg442315#msg442315 date=1159356494]
Where does $signin variable come from?

Prehaps use this instead:
[code=php:0]if (isset($signin) && !empty($signin)) {[/code]
[/quote]

Thanks wildteen88, you are great! a million thanks. It really works once I changed the code.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.