| | hi can any one correct the error on line 7 ??
help me plz
<?php session_start(); if(isset($_SESSION['username'])) { echo "You're already registered as $_SESSION[username]."; } else if($_SERVER['REQUEST_METHOD'] == 'POST') { if(!empty(trim($_POST['username'])) //Fatal error: Can't use function return value // in write context && !empty(trim($_POST['email']))) { $uname = htmlentities($_POST['username']); $email = htmlentities($_POST['email']); $_SESSION['username'] = $uname; echo "Thanks for registering! <br />", "Username: $uname <br />", "Email: $email <br />"; } else { echo "Please fill out both fields! <br />"; } } else { ?> <form action="test.php?username=overwritten" method="post"> <label for="username">Username:</label> <input type="text" name="username" /> <label for="email">Email:</label> <input type="text" name="email" /> <input type="submit" value="Register!" /> </form> <?php } // End else statement ?> |
|
| | I tried gues about else if not elseif |
|
| | can u fix it? |
|
| | echo "Thanks for registering! <br />", "Username: $uname <br />", "Email: $email <br />"; why no using dot |
|
| | http://pastebin.com/1pkPQBHQ |
|
| | using comma.. and the error is in line 7 |
|
| | tried my code |
|
| | same problem |
|
| | is this working on your pc? |
|
| | is working |
|
| | so what happened on me? can u tell me? |
|
| | tried change !empty(trim($_POST['username'])) into !isset($_POST['username']) |
|
| | no not working |
|
| | share ur full code in pastebin.com |
|
| | pk |
|
| | ok |
|
| | done now what to do ? |
|
| | copy paste the link here |
|
| | ya done |
|
| | will any one correct it ? |
|
| | where the lin? |
|
| | http://pastebin.com/3Zz8fMxq |
|
| | //Fatal error: Can't use function return value // in write context this include in your code?? |
|
| | yes |
|
| | i just included the error as comment |
Tidak ada komentar:
Posting Komentar