![]() |
|
#1
|
||||
|
||||
Variable scope questionHi folks,
I guess I've caused enough trouble in the C forum, so... Please. I'm even newer to this than I was with C, so some of my nomenclature may not be exactly correct... I have inherited a pre-existing web-site with no database access, all HTML and JS. The designer has added forms at the customer's request to create a member/email list, and I'm having problems passing results of my PHP scripts back to the HTML page (if it's even possible). I'm trying to do this without having all of the HTML code being radically modified. example: Sone of the HTML code (straightforward), but I know will need to modified to deal with the results of the PHP script. HTML Code:
some of the PHP script registrationNew.php - it's only a prototype to show what I'm after. I know it's rife with no-nos and stupid newbie tricks. PHP Code:
What I'm after is to be able to, after returning to the HTML page is to display (in HTML) an error if one occurs in an area on the same page as the form and "force the user to re-enter the info in to the form. I know this is PHP 099, but new to me and any help to get me on track wouod be greatly appreciated! I have read and read different tutorial sites plus two VERY large books I have and just can't divine what it is I'm looking for. Thanks in advance, Mike M. |
|
#2
|
||||
|
||||
Re: Variable scope questionBasically you're asking if it's possible to display an error message on the original web page i.e. registrationSubmission.html?
The answer is no, at least not with PHP. It's not exactly impossible either but you may need to use some Javascript, at least. You could do the redirect appending a query string to the original document and use that query string value to display an error message using Javascript. It's not what people do normally but you wanted to know if it was possible. Also, a good habit to develop is this: PHP Code:
I won't comment further on your PHP script because that's not what you asked for. |
|
#3
|
||||
|
||||
Re: Variable scope questionThank you very much for your response!
Quote:
Here's an example of some HTML from another site that appears to be doing what I want (without the newbie errors) -sorry for the formatting, it ws the best I could do... HTML Code:
Thanks for your coding advice. Why don't books often not use best practice when demonstrating coding examples, even in advanced chapters? You stated: I won't comment further on your PHP script because that's not what you asked for. Thank you, but I would accept any advice at anytime, even if it's off-line. So, can anyone use my last two posts and give me any advice. Surely what I'm asking for is not impossible (based on the HTML included in this post). Thanks again, folks - I always appreciate the help I get here, that's why I hang around. Cheers, Mike M |
|
#4
|
||||
|
||||
Re: Variable scope questionQuote:
Well, I must admit, I'm dead wrong about doing this the way I want using PHP and HTML exclusively. I'm off to Barnes & Nobles! Thanks everyone! Mike M. |
|
#5
|
||||
|
||||
Re: Variable scope questionThis may not interest you right now but I was in the mood. Assume that this document is saved as register.php. PHP Code:
|
|
#6
|
||||
|
||||
Re: Variable scope questionQuote:
I think I have enough information between your post and a couple days of research to "get 'er done!" Cheers, Mike M. |
Recent GIDBlog
NARMY by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| [Tutorial] Pointers in C (Part II) | Stack Overflow | C Programming Language | 0 | 27-Apr-2005 17:36 |
| [Tutorial] Pointers in C (Part I) | Stack Overflow | C Programming Language | 1 | 08-Apr-2005 18:35 |
| Repetition structure problem and question | brookeville | CPP / C++ Forum | 17 | 29-Oct-2004 17:48 |
| Which Header Files to Use?? | BobbyMurcerFan | CPP / C++ Forum | 8 | 16-Jun-2004 18:29 |
| my compiler says I have to have a variable at the end of my structure | ambeco | C Programming Language | 10 | 24-Feb-2004 10:37 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The