This is a discussion on "How do I echo <?php ....." within the PHP Forum section. This forum, and the thread "How do I echo <?php ..... are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
How do I echo <?php .....
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
#1
|
|||
|
|||
|
How do I echo <?php .....
An easy question.....
How do i echo or print this (it's part of an html form) in php
|
|
|
|
#2
|
|||
|
|||
|
Re: How do I echo <?php .....
The first one ...
|
|
#3
|
|||
|
|||
|
Re: How do I echo <?php .....
Oops...i forgot to mention that it's in part of a function
|
|
#4
|
|||
|
|||
|
Re: How do I echo <?php .....
Actually, i just need to echo a string
For some reason it's not echoing the variable |
|
#5
|
|||
|
|||
|
Re: How do I echo <?php .....
with echo I usually do
|
|
#6
|
|||
|
|||
|
Re: How do I echo <?php .....
Is this what you want?:
Last Blog Entry: 10 Reasons Why My Laptop Is Better Than Your Girlfriend (Dec 15th, 2007)
|
|
#7
|
|||
|
|||
|
Re: How do I echo <?php .....
By using your code I made some changes and now when i view source i can see value="" in the form which obviuosly the variables are getting passed. It should have either "old old value" or "new new value" in the value field.
Here is the function
|
|
#8
|
||||
|
||||
|
Re: How do I echo <?php .....
You need to delclare $oldvalue and $newvalue as global in the error_field function as they currently cannot be found in this function's scope.
You are probably getting some undeclared variables warnings in your error log.
Last Blog Entry: The wannabe juggler's quest (Oct 27th, 2007)
|
|
#9
|
|||
|
|||
|
Re: How do I echo <?php .....
Many thanks Rakuli, you've helped me out yet again
I did think that i needed a global variable but i didn't know where to put it. i did try the check_form and show_form functions but it didn't work |
|
#10
|
|||
|
|||
|
Re: How do I echo <?php .....
Now that I have it doing what I want, I need to pass variables between functions
What I do is connect to the database, assign some variables with values from the database and I need to assign $oldvalue in the validation check to each of the variable taken from the database. Variables taken from database
|
|
#11
|
||||
|
||||
|
Re: How do I echo <?php .....
Silly observation but your global declaration uses $oldvalue and the assignment uses $old_value (note the underscore -- this might explain why it isn't populating?
Also notice you're using a regex to check for just letters, I would suggest using ctype_aplha($first_name) which will return false if anything apart from an alphabet character is found. Cheers
Last Blog Entry: The wannabe juggler's quest (Oct 27th, 2007)
|
|
#12
|
|||
|
|||
|
Re: How do I echo <?php .....
I checked what was getting echoed at the end and all the variables are getting echoed so those variables are getting passed through the check_form() function. I did some further tests and I found that $old value was not getting assigned anything The problem lies in this bit I believe
|