PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Warning: Missing argument 1 for PrintNow::printNow(), called in C:\xampp\htdocs\register\inc\Register.php on line 33 and defined in C:\xampp\htdocs\register\inc\PrintNow.php on line 8
Warning: Missing argument 2 for PrintNow::printNow(), called in C:\xampp\htdocs\register\inc\Register.php on line 33 and defined in C:\xampp\htdocs\register\inc\PrintNow.php on line 8
I think you need to get rid of all of the errors first (such as using $first and $last in printNow() ). And I really don't know what you are trying to do with all of those redirects, but please stop! There should be one redirect max.
Remember that HTTP parameters are pass as "index.php?name=value", so "index.php?firstname=Bob&lastname=Smith" will populate $_GET['firstname'] and $_GET['lastname']. Doing "index.php?value=firstname" will populate $_GET['value'].
If i remove $first and $last in function printNow() then how can i make my function print some thing? Do you think it would be wise to return the string that i want to print and then print it Register.php?
Those redirects are error redirects. Did you mean that I should assign all error values to a variable and have one redirect? Too make my code look neat, i have, you know, typed and indented well.
All codes before calling PrintNow class works fine. I have tested it using echo statement.
gimpact wrote:If i remove $first and $last in function printNow() then how can i make my function print some thing? Do you think it would be wise to return the string that i want to print and then print it Register.php?
The parameters are $firstname and $lastname. The variables $first and $last are not defined.
gimpact wrote:Those redirects are error redirects. Did you mean that I should assign all error values to a variable and have one redirect? Too make my code look neat, i have, you know, typed and indented well.
The usual practice is to redirect when there are no errors. That gets rid of the resubmit problem with forms. You should use logic for the errors and collect the error messages in a string or array of strings. Then redisplay the form with the error messages if there are errors.