Jump to content

jrod356a

New Members
  • Posts

    6
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

jrod356a's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hi All, Thanks for your input. The reason I'm adding this in a php file is because there is a condition that has to be met. Let me clarify exactly what I'm trying to do here: I'm trying to build a web form that based on the users radio button selection, runs a query and presents the results to the user as a report. I have this part working fine. The last 3 radio buttons on the form are for sales/admin specific reports that access should be limited only to management and supervisor so my solution to accomplish this without having to offer these report options on a separate page, etc., is to pop up a window with a login page that the user would have to logon to (thereby verifying their access rights to these features). If login is successful, the will be allowed to proceed. If not successful, an error message will be thrown and processing will be terminated. Am I going about this in the wrong way? Thanks for any guidance/input you can provide...
  2. Hi all, I'm a PHP "Newbie" and am having trouble figuring out how to do the following: I have a page with a form that contains radio buttons for each option available to the user to submit via a submit button. The "form action" for the form is set to call a php script file (rpt_rdo_sel.php) when the submit button is clicked. I am trying to have a popup window opened when the user selects one of a particular set of radio buttons (any of the last 3 radio buttons on the form). The popup window is supposed to open and load an existing page located in my site's "dev/" directory. Through my research on the web, I found sample code to do this as follows: I made these entries in the rpt_rdo_sel.php file that is called when the submit button is clicked: Add the javascript code before the "<?php" or after the "?>" tags (I chose to put it before): <script type="javascript"> function openRequestedPopup() { window.open('http://www.usedcarinteriors.com/dev/finadminlogin.php', 'FinanceAdminReportsLogin', 'width=545,height=326,resizable=yes,scrollbars=yes,status=yes'); } </script> Then add the following code within the PHP tags: echo "<script type='javascript'>openRequestedPopup();</script>"; I then tested this by opening the form page in a browser window, I clicked one of the radio buttons that I designated for this function and clicked the submit button. I then got a blank page and the popup window I expected did not open. No errors were displayed on the resulting page however, I have FirePHP (a debugger tool) installed (I performed the test with FireFox) and I checked the output under the "Net" tab. The "Post" values were correctly passed but the "Response" values reported show the javascript code and the php "echo" code I added in the .php file. Now I'm not sure if my assumption is correct but I'm thinking that code may have been treated as comments text instead of program instructions and this is why all I'm getting is a blank page result? Can anyone help me to get this working like I want it to?
  3. hi phpdragon, Wow! Thank you so much for clarifying things for me! - JROD
  4. Hey phpdragon, I've been reviewing the code sample you provided me and I'm seeing some things that I am having trouble understanding. As I mentioned in my original post, I am totally new to php and actually, while I have some development experience in other program languages, I don't consider myself an "Expert" developer in any language (I'd say I'm a "novice" to "intermediate" level developer) so please accept my apologies and I ask for your patience with me if I'm showing my ignorance of something that should be pretty basic knowledge! Anyway, here are my questions: 1. The AJAX code should be added in the head area of an ".html" page (not a ".php" file), right? 2. Can you please clarify for me what the values of "var strURL=" represent? I get that "statecall.php" is the php file that contains the select box to be included in your case statecall.php but what do the "?countrycode=" and "+codeId;" values represent? 3. Regarding the "statediv" part where you say "this is the name of the div tag that will be updated in your page.", is this where the select box will be included? 4. In the statecall.php code, I see that there is an include statement with a value of 'data_connect.php'. Is this supposed to be the php file that contains the database connection parameters? If so, should this file be stored in the same directory that the statecall.php file is stored in? I ask this because I noticed that there is no directory path info included with this value. I think that everything else is pretty much self-explanitory (hopefully!) and I'm pretty confident that I understand it. Thanks again for your help so far and thanks in advance for any input you can provide to clarify these questions and please accept my sincerest apologies for any inconveniences my ignorance may be imposing! :-D - jrod356a
  5. phpdragon, Thank you so much for your quick reply! I will try this out and let you know things went. Again, thank you!
  6. Hi All, I am totally new to developing in PHP and I am having problems figuring out how to do the following: I am currently trying to create a data entry web form for entering car parts info into a mysql database. I have added some dropdown form fields to allow the user to select a vehicle manufacturer and a vehicle model. I would like to add conditional processing that would populate the vehicle model dropdown field (form field is named "MODEL") with the appropriate models for the vehicle manufacturer (form field is named "MAKE")that the user selected. For example, if the user selects "Acura" as the manufacturer then the vehicle model dropdown should only display a list of all the Acura models, if "Honda" is selected then only Honda models are displayed in the models dropdown, etc. In my mysql database, I have a table named "MAKE_MODELS" and it contains a row entry for each vehicle model for each vehicle manufacturer. I.e: MAKE MODEL ----- ------- ACURA CL ACURA NSX HONDA ACCORD HONDA CIVIC and so on... I believe that the logic should be something like this: If the selected value of the MAKE field is "Acura" then select MAKE_MODELS.MODEL where MAKE_MODELS.MAKE = "Acura"; populate list values for MODEL field with returned results of select query I'm not sure if I would create else/elseif statements for each MAKE selection condition or if this should be handled with a "CASE" routine (not sure if PHP has a "CASE" statement?). Again, I am totally new to PHP development and as such, I may be way off point from how this should actually be handled so any help/guidance that anyone can provide me with will be greatly appreciated!
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.