Jump to content

gr1zzly

Members
  • Posts

    48
  • Joined

  • Last visited

    Never

About gr1zzly

  • Birthday 12/20/1982

Contact Methods

  • Website URL
    http://www.tgbdesigns.co.uk/

Profile Information

  • Gender
    Male
  • Location
    Stafford

gr1zzly's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I don't think that this is a related issue, I should explain... The page DOCTYPE etc. is defined in the 'header' include on the main php page, the form's file is then included further down that page so I didn't bother writing specific declarations for this file since they would be redundant once the php passes it's output to html parsing. But you have made me question the validity of this assumption! Anyway, the validation errors I mentioned before were caused because I was only validating the form's 'incomplete ' html file. If I can't get this to work as a 'button' I will have to fall back on a <a> tag with css or an image. Thanks for all your help and suggestions haku.
  2. Javascript can access web document header information through the Navigator and Document objects Or you could try AJAX based header response functions: http://www.w3schools.com/dom/dom_http.asp Whether or not these will let you access the 'title' and 'meta-description' tags I don't know. If not you may need to save a temporary copy of the web page as a text file on the server, then retrieve the information you desire through a text string analysis of the file using php or something -> using strrpos() to find the start and end tags then copy whats between them.
  3. Yes each 'option' would be created as a child of the new 'select' element.
  4. Even though the prepared download is "never saved to disk" surely the sever must store it in a temporary folder/file? If so would it be possible to process the preparation of the download in a script file but save the action of submitting the download to the original pages code, allowing a header re-direct from the script? - i.e. save the temp location, pass it back to the page with the refresh then submit the download. The only other alternative I could see would be a Javascript page refresh, but this has accessibility issues and is often just as tricky to implement. Beside businessman already said "window.location doesn't work". Will think on it...
  5. echo count($results); or echo "We found " . count($results) . " cases of misspellings of the word " . $word . "; ? ? ?
  6. Sorry this isn't really my area of experise, but you should check out http://www.webcheatsheet.com/php/send_email_text_html_attachment.php and http://www.hollowearth.co.uk/tech/php/email_attachments.php for guidance, paying particular attention to the "boundary" declaration. Also for future reference, annotating your code would really help, as would using a pre-formated include for the html, dropping the php vars in where you need - all that table declaration is messy and distracting!
  7. Okay what you've got here, I don't know if you're aware, is Javascript handling the form submit and validation which is then using AJAX to send and receive the login validation from the database. This is not good, if only from an accessibility point of view since Javascript could be disabled meaning that you couldn't login at all password or not! To be honest I am amazed that any 'web developer' would use this approach without providing solid standard php/mysql functionality first as a fall back. I'm not great with JS / AJAX but the key point seems to me to be if(isset($_POST['Control']) and $_POST['Control']==1) { $ControllerTemp=$ControllerObj->GetControllerByUserNameAndPassword($_POST['UserName'],$_POST['Password']); if(is_object($ControllerObj) or ($_POST['UserName']=="admin" and $_POST['Password']=="master")) { Without having access to the function definitions used here I can't say for sure what's happening, but there's a good chance that as it is only being validated as an object it may always be 'TRUE' regardless of if it's a match for the username and password entered. Also it has a default of ADMIN and MASTER set for each respectively. If it's any help a simple php method could be used... # Some validation on the user input... $qry = "SELECT * FROM users WHERE user_name='$un' AND user_pw=SHA1('$pw')"; // Retrieve the record for that email/password combination: $rsp = @mysqli_query ($databaseConnection, $q); // Run the query. # Some validation of the db response... # ...Accept / Reject login.
  8. Don't know if this will help but are you using enctype="multipart/form-data" in the form declaration? This ensures that each form part is encoded relevant to it's content type and is essential for file uploads.
  9. If the function that prepared and issued the download is stored in a different file to the page with the form (i.e. the form posts to a script instead of it's host page). So long as the script doesn't output anything to the page you could use a simple header location re-direct: - header("Location: $url"); I'm not sure if the download initiating would constitute as 'output' though, which would result in an error "headers already sent" or something like that. In which case though, having the prepared download stored as a variable that can be passed back to the calling page with the re-direct where it is then issued to the browser download prompt may negate this.
  10. Hey, I don't know if this is exactly what you're after but I use <pre></pre> tags to render text exactly as it appears in the html code.
  11. This would be better and a lot easier if you were using a mysql database instead of the html table, since the php / sql used to interact with the database would be a lot simpler than handling files.
  12. http://uk.php.net/round
  13. hmph - yeah I guess I'll have to style / image it, or at least try it with IE to see if that's the problem. I should point out though that the input's type is set to 'button' not 'submit' so I'm not really doubling on user input as the page will only see that the link is clicked (theoretically anyway) since the 'form' is never acutally being submitted. Surely though it would make sense for the W3C to include the href attribute for button / input tags? Wouldn't that make life easier for a lot of people, or maybe just me? - lols - Edit - Oh yeh and the validation errors were due to no doctype, header or body tags etc. due to the structure of php page and where this file is included.
  14. As I said, I appreciate that it may be 'bad practice' to use a form input element in this way. But if the code was invalid as you say then why would standards compliant (for the most part) browsers such as FF and Chrome work fine with it, and the world's most notoriously awkward browser (IE) dismiss it? Plus I just passed it through the W3C validation tool with no error's other than those expected due the fact that this is a php include file! Besides the fact that buttons have been used for links since the early days, I'd have thought that my intent to use an input button in this way was obvious. I mean a link is a link, it's just blue text (unless I style it) whereas a button looks....well like a button! I didn't ask for a critical analysis of my methods, just an explanation as to why IE wont run it when the other browsers will. If people had an alternative method to suggest that would achieve the same results both visually and functionality wise then by all means suggest them.
  15. Prepare to rofl at my stupidity... <a class="admin_action" href="<?php echo $_SERVER['PHP_SELF']; ?>?action=create"> <input type="button" value="Create a new post" title="Create a new page entry." /> </a> For some reason this doesn't work in IE 8 (yet to test other IE's) but everything works fine in FF and Chrome?! I'm not exactly sure about the 'good' / 'bad' practice of using form elements in this way, and yes I could just create a graphic or use css to make it look like a button. But really I just don't understand why this isn't working in IE. Any ideas?
×
×
  • 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.