Jump to content

ahvceo

Members
  • Posts

    20
  • Joined

  • Last visited

    Never

Everything posted by ahvceo

  1. Hi All, Sorry I haven't been back sooner but I got tied up. Seems i just cannot fet as much done in a day as I used to and I haven't learned that yet. Anyhow, I cannot get the text in the input box to be red no matter what I do, but in the process of trying I learned that I don't want to do that anyway because then the error message can get in the system as a user name. Take a lot od work to get around that so I have just put an error message at the top of the screen and everything works fine now, Thanks for all your time and suggestions. They were a big help to me, ahvceo
  2. Thank you Andy-H, That is exactly what I was looking for. I would never have guessed the name. Thabks Again, ahvceo
  3. Hi All, I know you have all seen and used them, the little boxes with machine unreadable text you need to fill in in order to login on some sites. I would like to add one to my site but I don't know where to get one of even what they are called so I can search for one. Does anyone know what those little boxes are called? Or where I can get one? Thanks ahvceo
  4. Hi Guys, I have tried everything you suggested without success. I am pretty sure I need to do something at the html level where the inputbox is being displayed. I thought the following code would work but I cannot get the syntax straight. The server keeps puking on the first "echo" line. Can someone help me out here? Thanks ahvceo <tr> <td><b><font face="Verdana, Arial, Helvetica, sans-serif" size="2" color="#000000">Choose Password: *</font></b></td> <td><b><font face="Verdana, Arial, Helvetica, sans-serif" size="2" color="#000000"> <? if ($errorMsg == AFF_SI_USEREXISTS) echo "<input type="text" name="ausername" maxlength="12" size=30 background-color=#FA1B00 value="<?=$_POST['ausername']?>"; else echo "<input type="text" name="ausername" maxlength="12" size=30 value="<?=$_POST['ausername']?>"; ?> </font></b></td> </tr> [/cvode]
  5. Hi All, Thanks for the help! I am really getting too old for this stuff. What I used to do in 5 minutes now takes me an hour or two. I was really starting to get frustrated but finally got there. Your code works and now so does mine. Thank you all! ahvceo
  6. Hi All, 20 years ago I thought I knew how to do a query but I guess I have forgotten. I am trying to update a single value in one row in one table in a database with 5 tables. I thought the following code would work but no joy. $payment = "3.50"; $ref = $_COOKIE['ref']; mysql_connect($server, $db_user, $db_pass) or die ("Database CONNECT Error (line "); $monthlydue = mysql_db_query($database, "select monthlydue from affiliates where memid=" . $ref); $monthlydue = $monthlydue + $payment mysql_db_query($database, "INSERT INTO affiliates (monthlydue) VALUES ('".$monthlydue."') where memid =" . $ref) or die(mysql_error()); Thyere are no errors in the database values or names because I use the same values and names to add rows with no problem. If it makes any difference the value I am trying to return is a double but I have the same problem with a string when I try to access just the email address. Can anyone tell me what I am doing wrong? Thanks ahvceo PS Would you believe I have looked a over 20 examples of this on the net and not a single one of them addressed the issue of accessing only one value in a table. Every one showed how to return or insert or add or update a complete row, but not one showed how to get or insert a single value in a row.
  7. Hi Guys, I tried your code and the results are attached in a screen shot. As you can see part of the code is placed in the input box and the rest of it after the input box. I think what needs to be done is address the attributes of the input box which this code does not do. I haven't the foggiest idea od how to do that. Thanks ahvceo [attachment deleted by admin]
  8. Hi All, I have a form on a php page and when the user name is aready in use I send a message to the User Name input box. I would like to be able to indicate the message is an error by coloring it red, or better yet changing the background color of the input box. I have searched the web for several hours but I can not find anything that works if(mysql_num_rows($chk_user) > 0) { $errorMsg .= AFF_SI_USEREXISTS.'<br>'; $_POST['ausername'] = 'Name Already Taken, Try Another'; } The "ausernane" refers to the input box where the error message is displayed. Can anyone tell me how to make something appear in red to show that an error message is being displayed? Thanks ahvceo
  9. Thanks All, I have the problem in habd now thanks to your help. ahvceo
  10. Hi Wayne, Yjanks for the information. How about the first part of my question? Is there any difference between the statements of does it just write yhe same cookie 54 times? Thabks again ahvceo
  11. Thanks Starphp for the information. I am from the old school and started programming in 1962 so I like to see errors output to a file. How do I log the errors other than fopen, fwrite and fclose? Thabks again ahvceo
  12. Hi Again All, When I run my php script, a screen flashes with error messages on it but then in covered be the http screen. Is there any way I can make the server "pause" or "stop" so I can see these error messages? Thanks ahvceo
  13. Hi All, I am 72 and just trying to learn php, it wasn't around when I was programming 20 years ago. I got this code off of the web and I don't quite understand what is happening! I do know that the $_GET statement returns the reefer's username from the affiliate link but that is about all. if($_GET['ref']) { if($cookieExpiration != 0) $cookieLifetime = time() + $cookieExpiration*86400; else $cookieLifetime = time() + 3650*86400; SetCookie ("ref",$_GET['ref'], $cookieLifetime, $cookiePath, $cookieDomain); SetCookie ("ref",$_GET['ref'], $cookieLifetime, $cookiePath, $cookieDomain); SetCookie ("ref",$_GET['ref'], $cookieLifetime, $cookiePath, $cookieDomain); SetCookie ("ref",$_GET['ref'], $cookieLifetime, $cookiePath, $cookieDomain); SetCookie ("ref",$_GET['ref'], $cookieLifetime, $cookiePath, $cookieDomain); as you can see there are 4 Set "SetCookie" statements in a row that look identical to me. Is there a difference in what each statement does? In a different php file I want to use the following code... $myFile = 'testFile.txt'; $fh = fopen($myFile, 'a') or die("can't open file"); $ref = $HTTP_COOKIE_VARS["ref"]; while (list (WHAT GOES HERE, AND HERE, AND HERE)=each ($HTTP_COOKIE_VARS)) fwrite($fh, "WHAT GOES HERE"); fclose($fh) to read the cookie I just set with the previous statements and write them out to a file so I can see what is returned. Is "$HTTP_COOKIE_VARS" a good statement? I read some where that it was depreciated and replaced with a new statement. Since I don't know what or how many variables are being returned what goes where I have written "WHAT GOES HERE", AND HERE, AND HERE" in the code above? There were 2 variables in the list or orginally. Thanks ahvceo PS What is wrong with this text editor? I cannot see the bottom of the page after a few lines. Why doesn't someone fix it?
  14. Thank You Dannie10. My problem was that I wasn't saving it as php. It now works fine and I can now try some interesting things ahvceo
  15. Hi Dannie10 Thanks for the quick reply. I tried your changes and I get the following output when I run it. 5) {echo "yes";} else {echo "no";} ?> Here's my code copied from the source... <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN"> <html> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <title>Make Table</title> </head> <body> <table> <tr> <?php for($l = 1; $l <=7; $l++): ?> <td align="center"> <?php if($l > 5) {echo "yes";} else {echo "no";} ?> </td> <?php endfor; ?> </tr> </table> </body> </html> Any suggestions? I would really like to be able to embed php to make tables. You could have a bunch of images in a database and display them in a nice grid. Thanks ahvceo
  16. Hi All, I got this off of the web because it looked like an interesting thing to try. If it works I would be able to fill a table from a database, which is something I would like to play with. Here's the code... <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <title>Make Table</title> </head> <body> <table> <tr> <?php for($l = 1; $l <=7; $l++): ?> <td align="center"> <?php if($l >= 5;) {echo "yes";} else {echo "no";} ?> </td> <?php endfor; ?> </tr> </table> </body> </html> It is supposed to create a table with 7 columns in 1 row with "no" in the first 5 columns and "yes" in the last 2. Of course the code doesn't work although it looks to me as if it should. Can anyone shed some light on why it doesn't work? And yet again the "echo" statement gives me nothing. Does the "echo" statement ever do anything? Thanks ahvceo
  17. Hi All, Thank much for the quick replies, I really appreciate it. Does the "$referrer = $_GET['referrer'];" statement get any referral id or does it just get the ones that are identified by a particular code. For instance if my referral code is "http://amazinghomeventures.com?ref=ahvceo", would the above statement work or would I use "$referrer = $_GET['ref'];"? Does the statement return "referrer=username or just the username? Does it work if there is an interveining URL? For instance if someone is referred to my site and I send them to PayPal before I try to get the referrers name, can I still get it this way? Thanks again, looking forward to your next reply! ahvceo
  18. Hi Guys, Thanks for all the good cheer! The only thing being wrong with being 72 is your memory isn't as good and you have trouble with tiny details. There was one other thing that I lost some time ago but I can't remember what it was. Well the server is no longer puking on my code thanks to your help. I run the code with no errors. The only problem is I cannot find the file! Where in the XXXX does it go? I have changed the code slightly as follows $ref = $HTTP_COOKIE_VARS["ref"]; echo $ref; $f = 'xyz.txt'; $today = date("F j, Y, g:i a"); // March 10, 2001, 5:16 pm if (!$handle = fopen($f, 'w')) { echo "Cannot open file ($f)"; exit; } if (fwrite($handle, $ref) === FALSE) { echo "Cannot write to file ($filename)"; exit; } if (fwrite($handle, $today) === FALSE) { echo "Cannot write ($today)"; exit; } fclose($handle); I added a write time statement so I would know if the file was really being written when I though it should be and I added a fclose statement because I remember form somewhere that you need to close a file before it really wirite it out. I also tried to put a path in the file namer(C:\xyz.txt) to see if I could find it on my C drive, No Luck. Any ideas where the file might be going of how I find out if it is being written at all? Thanks ahvceo
  19. Hi All, I am 72 and I am just learning php. I have a general question about referals. If I refer some one to a site using my affiliate link how do they know it was me that refered the person to that site? I know my link is coded with a code identifing me but how do they get that code? I would really appreaciate some help with this as it bothers that I might not get paid for refering someone. I might also want to have someone refer people to my site and I would like to pay them for it. Can anyone explain to me how this all works? Thanks ahvceo
  20. Hi All, I am 72 and just starting to learn php. I am having a problem with the "$ref = $HTTP_COOKIE_VARS["ref"];" statement so I tried to see what was being returned in $ref. I see nothing if I do an "echo" (I never have seen echo output anything I could see!) so I thought I would write $ref out to a file. The server pukes at the fopen statement at line 57 (where the fopen statement is) with the following error message: " Parse error: syntax error, unexpected T_IF in /home/ahventur/public_html/user/cookie.php on line 57" I copied and pasted the code for writing to a file directly from a tutorial and I have checked several other sources and all say the same thing. The code is right I think. Can someone tell me how to get at the $ref contents so I can see what is being returned by $HTTP_COOKIE_VARS["ref"]. I would like to be able to use the fopen and fwrite functions for future reference. Any help would be appreciated greatly. Thanks ahvceo code follows: $ref = $HTTP_COOKIE_VARS["ref"]; echo $ref; $f = xyz.txt if (!$handle = fopen($f, 'w')) { echo "Cannot open file ($f)"; exit; } if (fwrite($handle, $ref) === FALSE) { echo "Cannot write to file ($filename)"; exit; }
×
×
  • 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.