Jump to content

FredFogg

New Members
  • Posts

    8
  • Joined

  • Last visited

    Never

Everything posted by FredFogg

  1. I don't want him to have to hit Print for each record, there will several hundred people that have registered. There has to be a way to read each record from the database, write the headers and the record to a txt file through a loop. The later on he can print the txt file. I just don't know how to do it in PHP.
  2. I have a MySQL database with each record of a person who has registered for an event, I am displaying the information on a web page for a user, but he wants to be able to print out all the records in alphabetical order by last name, first name later on so he will have a hard copy of each person who has registered at the table when they arrive. How can I write each record to a Txt file that he can print out later that will be formated with the record contents along with each fields definition (Ex. Last Name - Smith, First Name - John, etc)?
  3. Is there any example code of how to do this? I am somewhat new to PHP and am still learning. I want to query a MySQL database and write out the result to a txt file the user can download. 1. the user clicks .txt 2. the .txt is written to the server 3. the .txt is then downloaded to the users computer by the user 4. the .txt is then deleted from the server
  4. I have a webpage where the user enters an email address and hits the tab key to activate a function onChange and I use Ajax to read a MySQL database and then displays a message if that email address is already on the database or not. It works fine in IE8, but in Safari it doesn't work. Here is my function to check for which XML Http Object: function GetXmlHttpObject(){ if (window.XMLHttpRequest) { // code for IE7+, Firefox, Chrome, Opera, Safari return new XMLHttpRequest(); } if (window.ActiveXObject) { // code for IE6, IE5 return new ActiveXObject("Microsoft.XMLHTTP"); } return null; } And here is how I call it: var xxmlHttp; xxmlHttp=GetXmlHttpObject(); if (xxmlHttp==null){ alert ("Browser does not support HTTP Request"); return; } I am not getting the alert, it just tabs to the next field. What am I doing wrong. I need this to work with all browsers. So then I put alerts in my function GetxmlHttpObject and it displays the alert saying that it got the xml requets for Safari. So why doesn't it display the message. I am sending the message to a div id tag that I have below the input textbox for the email address. <div id="output1" style="color: blue;"></div> and here is the code to check the email address for duplicate. function omrCheckEmail(){ var divid = 'output1'; var loadingmessage = 'Processing...'; var xxmlHttp; xxmlHttp=GetXmlHttpObject(); if (xxmlHttp==null){ alert ("Browser does not support HTTP Request"); return; } xxmlHttp.onreadystatechange = function(){ if (xxmlHttp.readyState > 0 && xxmlHttp.readyState < 4){ document.getElementById(divid).innerHTML=loadingme ssage; } if (xxmlHttp.readyState == 4) { emBoolean = xxmlHttp.responseText; if (emBoolean == 'true') { document.getElementById(divid).innerHTML="THIS EMAIL HAS REGISTERED!"; } else { document.getElementById(divid).innerHTML="THIS EMAIL HAS NOT REGESTERED!"; } } } var queryString = '&email=' + (document.getElementById('custom').value); xxmlHttp.open("POST", "omrCheckEmail.php", true); xxmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); xxmlHttp.setRequestHeader("Content-length", queryString.length); xxmlHttp.setRequestHeader("Connection", "close"); xxmlHttp.send(queryString); } And my omrCheckEmail.php returns either "true" or "false" accordingly. Any help? Thanks, Fred
  5. Ok, that fixed the formatting, but caused my variables not to print: $email_msg = 'Email : ' . $Email; $email_msg .= "\n" . 'First Name : ' . $FirstName; $email_msg .= "\n" . 'Last Name : ' . $LastName; results in: Email : First Name : Last Name :
  6. I changed it to double quotes and this is what I got Parse error: syntax error, unexpected T_STRING in /mnt/w0712/d04/s31/b0301c6a/www.blah.com/members/omrSendEmail.php on line 88
  7. I am using php to send a text email and I am populating the message and I have tried a couple examples I found on the internet, but it isn't working. It is a simple email, so no need to send in html format. Here is what I have $email_msg = 'Email : ' . $Email; $email_msg .= '\n' .'First Name : ' . $FirstName; $email_msg .= '\n' . 'Last Name : ' . $LastName; and the email I am getting Email : johnsmith@live.com\nFirst Name : john\nLast Name : smith what I want is Email : johnsmith@live.com First Name : john Last Name : smith What am I doing wrong or do I need to add something to the header?
  8. FredFogg

    Newbie

    Hi, just want to introduce myself. I used to program many moons ago and got out of it and have recently taken over a non-profit national organizations website (many hours, no pay duh) and find myself learning new languages and new tools. I have recently started teaching myself php and have implemented a few scripts on the website and am in the process of using Ajax calling some php scripts to update my webpages. So I thought what better way to learn than from others that have been there or are going there. So here I am! Thanks, Fred
×
×
  • 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.