Jump to content

ginerjm

Members
  • Posts

    6,906
  • Joined

  • Last visited

  • Days Won

    99

Everything posted by ginerjm

  1. It amazes me that with your lack of understanding of English that you can program in any computer language.
  2. First - are you debugging your script in your browser to see if it's throwing errors at you and you aren't catching them?? (In IE, hit F12, click on the Script tab and hit refresh on your actual webpage window.) Second - your English is confusing me. Is your submit button triggering the js function? In other words, are you getting alert boxes at all? Third - You seem to be calling your js function twice - unnecessary. Fourth - your html is over doing it. Why put a <p> inside a <td>? As for your php - you are doing: return true; after every good validation test. So - where are you returning to? If this code is in a function, they you should start with a var set to true: $valid_input = true; (note - put $valid_input in a global statement at the top of the function.) and in each validation (if) test, if the input is in any wrong, set $valid_input to false, and add some text to an error message variable: $errmsg .= "This field is bad<br>"; Note the .= to collect all the error messages. At the end of this function do this: return $valid_input; and check the returned value in your calling statement and display $errmsg when you go output.
  3. You need to develop a file upload html document. Google is your friend. Write something from what you find in you research and if you're then stuck, come back.
  4. Not sure what you want to do. Eminently do-able of course, but why do you want to do this thing: IF SiteGallery == 1 THEN 'checked' The button will be in a checked state if the value equals 1. Are you saying you want to set the radio button checked/unchecked when you output the page? Then use that same logic to set a var to null or 'checked' and add that var to your input tag. $on=''; $off=''; if ($SiteGallery == '1') $on = 'checked'; else $off = 'checked'; echo "<label>Gallery On <input type='radio' name='SiteGallery' value='1' $on/> </label> <label>Gallery Off <input type='radio' name='SiteGallery' value='0' $off /> </label>";
  5. Look up the 'continue' statement. It's how you skip an iteration of a loop, which is what you want to do. As well as moving that section of html code INTO your while loop.
  6. XLS or xsl?? Do you mean "spreadsheet", aka, a client file? Saving a file to your server (aka, 'uploading') is simple. You can find many examples of how to code this. Try google. As for setting a php var with the header statement you proposed, I don't think that works. But I've been wrong many times.
  7. Of course you need a coder! You would dare to dive into some great working code yourself?
  8. Get or post does not matter. U need to think some more
  9. turning on error checking will allow you to debug your code so that at least the syntax is correct even if it doesn't do what you want. That is half the battle for newcomers. Been there. Done that. Still do.
  10. you didn't answer litebearer's question. You "say" that you have been unsuccessful using session_start(). What does that mean? You already have a clear understanding of the difference between setting a cookie and setting a session variable and their lifetimes. What is it you seek?
  11. The background may come in handy later on. For now - where are the dropdown boxes you referred to? And if you wish to build them , my prev post tells you what to change. And again - why all the divs? That is not how you build a web page.
  12. Again - no execute in sight prior to getting the inserted id value. Also - you appear to be mixing the use of MySQL functions with pdo - no can do. What is the getValue function - I am unfamiliar with that one (amongst a lot of other things!) Again - your code is flawed - can't possibly be running. Hanging comma in your query statement. Do you have error checking enabled??? Put this at the top of every script until you are done developing them: error_reporting(E_ALL | E_STRICT); ini_set('display_errors', '1');} set_time_limit(2); // avoid runaway conditions change if necessary.
  13. ginerjm

    PHP Poll

    Would love to help you out. However, you could make our help easier to obtain if you asked a direct question and pointed us to the code you suspect is the problem. This whole script can't be your problem, so do your debugging and show us what you've found.
  14. HTH. If you find success, be sure to come back here and mark your question as answered.
  15. Not familiar with printing using JS. Have had much success using the FPDF class of php. Takes a little experimenting to get used to it but works great. Allows you complete freedom in design an output, so designing your journal output page will be easy, then you simply call your PrintPDF function with a php var containing the addressee and the journal text and you're done. Of course you will have to actually manually press File,Print at the end of your process, but that's minor.
  16. Try putting quotes around your indices. You should also learn to use single quotes so you don't have to keep escaping double quotes in double-quoted strings. Less typing, less errors perhaps.
  17. Most important - we don't see where you actually executed the query. Please don't show us re-typed code samples - time and time again they will have errors in them. Paste in the section of code you are questioning instead of trying to type it in for us. Waste of your time and ours. Tip - you can use single quotes around your php vars in the query string since it is wrapped in double quotes already. $sql="INSERT INTO ip_requests (make,model,qub_id,mac,dnsname,) VALUES ('$make', '$model', '$qub_id', 'mac', '$dnsname' ") Much less typing and easier to read and understand.
  18. What drop down boxes? I didn't see any in your long sample of code. Simply loop thru your results and build the <option> statements using an element of your $row instead of building table rows. BTW - why so maaaannny <div>? Bad practice. Also - you'll be happier in the long run if you use associative arrays when retrieving your results. Using 'num' can lead to trouble down the road if you change your table structure. Unless you have an awful lot of fields in your table, using nums doesn't buy you a thing.
  19. Do some googling on "js window open". You'll find a lot of info on how to use js in your main page to open a window of a specific size/location and call a php script to run and populate it.
  20. And that's what I deduced. As for your error. Your original post: <?php if (strpos($_SERVER['REQUEST_URI'], 'upload.php') == false) { echo 'the stuff below is removed, or if the URL is something else, its not removed' ?> is flawed. You are missing the closing curly bracket as well as a semi at the end of the echo. So obviously you've never run this code. Anyway this statement says "if the uri does NOT contain 'upload.php' show the message 'stuff is removed'. You were close - you just have to include the code that you wanted to remove. So - taking my post and correcting it you would have: <?php if (strpos($_SERVER['REQUEST_URI'], 'upload.php') == false) { echo '<div class="navbar" name"navbar" Id="navbar">'; // this line has an error echo '<div class="navbar-inner" name="navbar-inner" Id="navbar-inner">'; echo a_view('core/account/login_dropdown'); // I'm assuming that "a_view" is some function defined somewhere echo a_view_menu('topbar', array('sort_by' => 'priority', array('menu-hz') ) ); // again - a function call? echo a_view('search/search_box', array('class' => 'search-header')); echo '</div> </div>'; } Now the code will NOT be displayed if the uri contains your script name.
  21. I'm assuming that the Title and Description change with the image. You need to hide them in input tags along with the image name when you send the output to the client and then grab them in your php from the POST array upon Submit and pass the text vars to your email and attach the image file to the email. Not familiar with sending images in email myself, so I can't offer anything more.
  22. You're mixing client side code with server side code. No Can Do. If you want your php to grab the contents of the div, you need to get it into your $_POST array somehow. (or $_GET.) Since a div is not an input field you need to change your html to make it so, which sounds silly. What exactly is in this div that you want to "send" to someone?
  23. Have no idea what you are trying to do, but try this. <?php if (strpos($_SERVER['REQUEST_URI'], 'upload.php') == false) { echo 'the stuff below is removed, or if the URL is something else, its not removed' } else { echo '<div class="navbar" name"navbar" Id="navbar">'; echo '<div class="navbar-inner" name="navbar-inner" Id="navbar-inner">'; echo a_view('core/account/login_dropdown'); echo a_view_menu('topbar', array('sort_by' => 'priority', array('menu-hz') ) ); echo a_view('search/search_box', array('class' => 'search-header')); echo '</div> </div>'; } This would prevent the second part from being output. Note - there is at least one error in that code, so I don't think it's working as shown. Also your first if statement is backwards if you want the "else" stuff dropped if the uri is upload.php
  24. That is definitely the lack of using "dot equals" as you build your output string.
  25. while ($completed_customers = MySQL_fetch_array($completed_orders) { (build your heml) } echo </table> echo your accumulated html BTW - in your loop you are re-initializing $requested_customers every time, so you are probably only seeing the very last customer anyway. s/b "$requested_customers .= blah blah blah;
×
×
  • 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.