Jump to content

jeffery1493

Members
  • Posts

    69
  • Joined

  • Last visited

    Never

Everything posted by jeffery1493

  1. excellent. That works better, but I already just found another work around that was similar. I just took the whole email routine and put it in another .php file, then had the <form> block call that .php instead of the original index.php. Then I set all the variables as hidden variables inside the <form> and retrieved each one in the second .php script with $_POST. IT worked!!!! Took me a bit of work because of all the nested quotations and whatnot........but I think we have a go. *****ISSUE RESOLVED***** and who says there aren't happy endings in PHP-land?
  2. I think I know what is happening. PHP is plowing right ahead, even though it puts up a prompt for the variable, it already passed that line and compiled and sent the mail message. So, the mail was already delivered, before you ever entered the time. No way apparently to make PHP stop at that point in the .php, and ask you for the time.
  3. I'm trying to put a PHP prompt and wait for input at that point in the PHP script, asking for the variable.
  4. Well I finally tried this. I took out the JavaScript and instead set within the index.php program, beforehand: echo ' <form action="index.php" method="post"> Would you like a time to meet?: <input type="text" name="meet_time" /> <br /> <input type="submit" /> </form> '; $mail_message = "We will be waiting to meet you at " . $_POST['meet_time'] . " ***\n\nHope to see you there soon!\n\n---------------------\nTHIS IS AN AUTOMATED EMAIL. PLEASE DO NOT REPLY TO THIS ADDRESS"; mail($email_address, "You Have Been Paged! ****", $mail_message); This opens up a prompt at the top of the page, which asks you for the time, and waits for Submit. Then the message is mailed. However, when the message is received, the time is still blank. Its going to be another long night...........
  5. Okay I'm confused. I looked up PHP prompts and this website says this: >>>> Jerry Stuckle Guest Posts: n/a #2: May 21st, 2007 re: Confirm dialog box Tomislav wrote: Quote: Hello, > I need a method to create Dialog box in PHP to confirm an action like for instance, sending an e-mail, so if "OK" is clicked action is performed and if "Cancel" is clicked action is canceled. > I found some examples that are implementing "javascript:return confirm()" function in "onSubmit" event of a form but none of such methods is functioning (?). > Is there any way to do this in PHP ? > Thanks, > Tomislav Not really. You can't open new windows in PHP. Your best bet is javascript - it works, just ensure you have javascript enabled. Or you can take them to a new "confirm" window. If they confirm then continue. If they do not, return to the previous page. >>> Here this guy is saying you can't really do it in PHP and your best bet is JavaScript. Anyone have that smiley with the gun to its head? :-|
  6. I can try doing all that, but what about the idea of setting the cookie with the page reload? Wouldn't that work? How would it be done in this case? Just reloading the page didn't work, at least the way I stated it. Surely that would just be adding one additional line with what I have now.
  7. wait do you mean I should send the variables inside the header request?
  8. Unfortunately I tried: $page = "index.php"; header("Refresh: 1; url=$page"); In between the cookie setting and the email. I sent several. When the emails arrived, each was still one cookie behind, just as before! ?
  9. >>Yes $_COOKIE['whatever'] will work, but you need to actually send the cookie to the server first (through an HTTP request)>> What do you mean by this? How would you do it?
  10. I absolutely don't need to use JavaScript. Frankly I just couldn't find a good example of how to do it the other way. I'm not exactly a PHP black belt. I'm more of a PHP self trainee. I actually don't like the JavaScript prompt because it forces you to use "SCRIPT PROMPT" and "Explorer User Prompt" in the headers and I can't find anywhere on Google that tells you how to change those, if they are at all changeable. I tried location.reload(true); in between the cookie and sending and got Fatal error: Call to undefined function reload() in ..../index.php on line 354 Is there something basic I'm missing? Does an include file need to be loaded?
  11. >>What you must understand is that PHP is a server-side language that runs once, sends the information to the browser and that's it. JavaScript is a client-side language that runs after the browser has received the output from the server.>> OMG if I had $1 for every time I read that line last night on so many web pages, I could retire for life. It is a very popular answer. lol
  12. Thanks. I have looked through reams of google articles on this, and Ajax is mentioned again and again as an 'alternative'. But it seems every Ajax answer imaginable is so lengthy and complex I can't make heads or tails of it. It seems to me a very typeheavy language and not very english-friendly for deciphering. I could be wrong. You say a page refresh- could I force a page refresh in between the setting of the cookie and the emailing? Would that accomplish what I am trying to do? it appears so frustratingly simple, but so far so difficult a thing to accomplish- just pass a variable from one line to the next.
  13. Hi All, :-\ This may be an easy question, or it may not be. However despite the fact that JavaScript is in the title and used, this is very much a PHP issue. If someone has qualms about what forum it should go in, then transfer me over. I have been stuck on this problem for a very long time, if anybody has any idea how to help I'd greatly appreciate. What I am trying to do is get some information from a JavaScript input message prompt, and pass it on to PHP to use in a mail message. I have tried many ways of doing this, as you can see here the most recent try is dropping the information into a cookie on the client side: <?php $message = '<script type="text/javascript">var javatime = prompt("INVITE - Would you like to add a TIME to meet this person?", "Enter TIME to meet here:");window.alert("The invite has been sent!");document.cookie = "javatimecookie="+javatime</script>'; echo $message; $mail_message = "Please meet me at: " . $_COOKIE['javatimecookie'] . " ***\n\nHope to see you there soon!\n\n\n---------------------\nTHIS IS AN AUTOMATED EMAIL. PLEASE DO NOT REPLY TO THIS ADDRESS"; mail($email_address, "***** You Have Been Paged! *****", $mail_message); ?> As you may expect by looking, PHP runs through all its code FIRST, before JavaScript ever has a chance to drop the cookie. So in effect, if I send 3 messages, message 1 will have a BLANK time, the cookie from message 1 will be in email 2, and cookie 2 will be in email 3. Definitely not what I want! I have tried other ways of passing the variable with no success. How in the world can you grab the information from the input prompt (the variable I call, "javatime"), and put it into the PHP mail message before it is sent? I fought with this for hours on end with no success..........thanks for any advice.
  14. Okay.... I think this is what I wanted: Pull selected fields, all data existing in single table, and display online as editable form (display.php) <?php // connect to the database mysql_connect(hostname,username,password); // select the database mysql_select_db(database) or die("Unable to select database"); // run the query and put the results in an array variable called $result $result = mysql_query("SELECT * FROM table ORDER BY course"); // start a counter in order to number the input fields for each record $i = 0; // open a form print "<form name='namestoupdate' method='post' action='update.php'>\n"; // start a loop to print all of the courses with their book information // the mysql_fetch_array function puts each record into an array. each time it is called, it moves the array counter up until there are no more records left while ($books = mysql_fetch_array($result)) { // assuming you have three important columns (the index (id), the course name (course), and the book info (bookinfo)) // start displaying the info; the most important part is to make the name an array (notice bookinfo[$i]) print "<input type='hidden' name='id[$i]' value='{$books['id']}' />"; print "<p>{$books['course']}: <input type='text' size='40' name='bookinfo[$i]' value='{$books['bookinfo']}' /></p>\n"; // add 1 to the count, close the loop, close the form, and the mysql connection ++$i; } print "<input type='submit' value='submit' />"; print "</form>"; mysql_close(); ?> And then update routine (referred to as: update.php) <?php // connect to the database and select the correct database mysql_connect(hostname,username,password); mysql_select_db(database) or die("Unable to select database"); // find out how many records there are to update $size = count($_POST['bookinfo']); // start a loop in order to update each record $i = 0; while ($i < $size) { // define each variable $bookinfo= $_POST['bookinfo'][$i]; $id = $_POST['id'][$i]; // do the update and print out some info just to provide some visual feedback // you might need to remove the single quotes around the field names, for example bookinfo = '$bookinfo' instead of `bookinfo` = '$bookinfo' $query = "UPDATE table SET `bookinfo` = '$bookinfo' WHERE `id` = '$id' LIMIT 1"; mysql_query($query) or die ("Error in query: $query"); print "$bookinfo<br /><br /><em>Updated!</em><br /><br />"; ++$i; } mysql_close(); ?> Well thats the basics, for those of us who are PHP impaired. I'd say, "Don't quit your day job, Jeff", except its already been outsourced, lol.
  15. Ha hahaaa...... once again I rank first in my searches. This always happens! http://www.google.com/search?hl=en&client=firefox-a&channel=s&rls=org.mozilla%3Aen-US%3Aofficial&hs=xYT&q=online+php+list+updateable&aq=f&oq=&aqi=
  16. Maybe for you! ; )- I just asked if someone had seen any online- I'm not asking anybody to do it for me.
  17. Hi All, Does anybody know of, or have seen online a code block for a simple online PHP list/form tied to a MYSQL table? Basically all I want to do is create a Christmas list online. I don't want any bells and whistles that will confuse the fam.....they are very low tech......... just a straight row of fields down the page linked to a MYSQL table: record, record, record, maybe 2 + columns (name, item, and how much they want it 1-5) and an update button. I looked for quite awhile but most everything is vast overkill.
  18. OKAY**************** I appear to have found out how to fix this bug: First, use the downloaded copy of the adodb files from the link I gave above: http://sourceforge.net/projects/adodb/files/adodb-php5-only/adodb-510-for-php5/adodb510.tgz/download 2. take the .tgz file and put it in the openchat/include directory 3. unpack the file with: gunzip -c adodb510.tgz | tar -xvf - mv adodb adodb_old mv adodb5 adodb 4. Edit class.Chat.inc vi class.Chat.inc Find: //create a database object $this->db = &NewADOConnection( DATABASE_DRIVER ); Replace with: //create a database object $this->db = NewADOConnection( DATABASE_DRIVER ); 5. Save file, then clear cache and all cookies 6. Re-enter PHP OpenChat. You may find all of your users are gone. However, I re-registered new users, and knock on wood- they are all working I hope this is of use to somebody! Good night.
  19. Thinking maybe ADODB might be corrupted, I tried downloading a new copy of the ADODB drivers for PHP, here: http://sourceforge.net/projects/adodb/files/adodb-php5-only/adodb-510-for-php5/adodb510.tgz/download I found there was a 'drivers' directory that included the file being mentioned. I loaded a new copy of PHPOpenChat 3.0.2 and replaced these new downloaded ADODB drivers with the ones they provided (including adodb-mysql.inc.php, just the contents of the drivers directory) and now I am getting this error instead: >>>> at /home/public_html/phpopenchat-3.0.2/include/adodb/drivers/adodb-mysql.inc.php:21 [2048] Declaration of ADODB_mysql::SelectLimit() should be compatible with that of ADOConnection::SelectLimit() Could not connect to database! Please check your database setup in config.inc.php by using the POC Installer! >>>>> I checked the web as far as I know I'm the only person to get this error that reported it at least as far as Google is concerned.......
  20. Just a note- I redownloaded their software again and re-installed a fresh copy from scratch, and the same error comes up now immediately. Its as if some kind of setting changed on my host site, some switch was flipped, but as far as I know I did nothing. I even generated a new php.ini file, still, the error. Bizarre!
  21. Hi PHP readers, Has anyone out there used PHP OpenChat 3.0.2 http://www.phpopenchat.org/ Its a downloadable live chat software utility that runs on PHP of course. I noticed that their "American" forum sourceforge.net appears to be abandoned, but they are still active in Germany: http://www.phpopenchat.de/ Anyway I had been using their software and incorporating it into my website for about a week when suddenly it bombed with this error: > Unknown error Sorry, an error occurred. at phpopenchat-3.0.2/include/adodb/drivers/adodb-mysql.inc.php:21 [2048] Declaration of ADODB_mysql::MetaDatabases() should be compatible with that of ADOConnection::MetaDatabases() Could not connect to database! Please check your database setup in config.inc.php by using the POC Installer! >> I looked up this error in Google and found page after page, maybe 200 entries, all with websites which appear to be stuck abandoned at the same error (see below): http://www.google.com/search?client=firefox-a&rls=org.mozilla%3Aen-US%3Aofficial&channel=s&hl=en&source=hp&q=Declaration+of+ADODB_mysql%3A%3AMetaDatabases%28%29+should+be+compatible+with+that+of+ADOConnection%3A%3AMetaDatabases%28%29&btnG=Google+Search I tried writing the PHP OpenChat people in Germany, even wrote personally to some of the programmers (through "Contact Us") and got no replies at all. I even saw one of the writers was in the forum reading my post yesterday, and he just ignored me or never answered. I used Babel Fish to translate, although I've heard that just about everyone living in Germany knows English. Is this some kind of doomsday bug? As far as I know I did nothing at all, just logged in one morning and there it was. Other people have posted this bug saying the same thing happened to them, but I've never found an answer posted anywhere, just the question and then nothing else. No idea how I might go about fixing it- but, this really sucks!!!!! :'(
  22. SLAMM!!!!!! It looks like its fixed. RE: setting output_buffering = 4096 in the php.ini file. As far as writing the code better, I'm sure it should be done, but I'll leave that to the writers. THANKS FOLKS!!!! And I'll take back what I said about PHP5. I think what I am dealing with, is a server company who likes to pass the buck! Too bad they never pass mine back.
  23. Wait----------hold the phone------------------ The header error messages are starting to disappear now that the buffer change was made. I don't know maybe it just takes awhile. still testing...........
  24. If I try to log in, I just get a blank white screen: Warning: Cannot modify header information - headers already sent by (output started at /home/maydayle/public_html/fish4tips.com/phpbb/includes/sessions.php:626) in /home/maydayle/public_html/fish4tips.com/phpbb/includes/sessions.php on line 278 Warning: Cannot modify header information - headers already sent by (output started at /home/maydayle/public_html/fish4tips.com/phpbb/includes/sessions.php:626) in /home/maydayle/public_html/fish4tips.com/phpbb/includes/sessions.php on line 279 Warning: Cannot modify header information - headers already sent by (output started at /home/maydayle/public_html/fish4tips.com/phpbb/includes/sessions.php:626) in /home/maydayle/public_html/fish4tips.com/phpbb/includes/functions.php on line 973
×
×
  • 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.