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 |
|
||||
|
How do I echo <?php .....
An easy question.....
How do i echo or print this (it's part of an html form) in php
|
|
|
|
||||
|
Re: How do I echo <?php .....
The first one ...
|
|
||||
|
Re: How do I echo <?php .....
Oops...i forgot to mention that it's in part of a function
|
|
||||
|
Re: How do I echo <?php .....
Actually, i just need to echo a string
For some reason it's not echoing the variable |
|
||||
|
Re: How do I echo <?php .....
with echo I usually do
|
|
||||
|
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)
|
|
||||
|
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
|
|
||||
|
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)
|
|
||||
|
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
|
|
||||
|
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)
|
|
||||
|
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
|
|
||||
|
Re: How do I echo <?php .....
As I mentioned in the above post I'm pretty sure it's because you're using $old_value rather than $oldvalue (which you are using in the rest of the script).
Cheers,
Last Blog Entry: The wannabe juggler's quest (Oct 27th, 2007)
|
![]() |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| echo proxy to csv | stiassny | JavaScript Forum | 1 | Apr 13th, 2008 16:51 |
| Echo and If | simonb | PHP Forum | 2 | Aug 27th, 2007 16:22 |
| how to echo 2 classes | geyids | PHP Forum | 3 | Aug 9th, 2007 13:47 |
| Echo and Sessions | kool77 | PHP Forum | 6 | Jun 1st, 2007 22:32 |
| Echo vs Print | Sqrlgrl | PHP Forum | 3 | May 30th, 2005 22:31 |