Jump to content

MesaFloyd

Members
  • Posts

    35
  • Joined

  • Last visited

    Never

Everything posted by MesaFloyd

  1. I am still a dummy, What am I suppose to do with that? var doc = eval("document.readme."+d); is already there... what so you suggest I change. Please understand, I am not very good at programming, just learning I come from a hardware background. thanks for Helping
  2. Not sure what you mean. Could you point it out to me please.
  3. Hi Again HTH Notice that my statments already are: text<?php echo $i++; ?> So it should be correct... correct?
  4. Thanks HTH Please notice that I did put $i=1 just before the 'while' statement. I just now changed it to $i=0, but no joy... Floyd
  5. I am an <older> rookie, please be gentle with me. I make a table called from a DB using PHP The table loops the DB untill all the occupied fields are displayed - works fine - I am trying to insert a button for each row (JS), that when pressed will highlight and copy to clipboard one particular cell of that row The button is not working properly. When I press any of the buttons on the table, only the first cell is higlighted and copied. I know it is because all the buttons are calling the same cell, but I don't know how to make the button increment for that row. I then added the $i= statement now I get and error message when any of the buttons are pushed You can see it here... http://almcom.net/iponthego/viewdatabase-testbutton-help.php Any of you programming gru's able to help me. - yes, I know this will only work in IE - I think the solution is in JS, but I am not sure if it can be fixed in PHP. Please keep it simple for me. Thanks in advance Floyd <script language='Javascript'> function doact(d) { var doc = eval("document.readme."+d); cp = doc.createTextRange(); doc.focus(); doc.select(); cp.execCommand("Copy"); } </script> <form name="readme"> <?php include("database.php"); $query = "SELECT * FROM users"; $result = mysql_query($query) or die(mysql_error()); echo "<table border='1'>"; echo "<tr> <th>Username</th> <th>IP Address</th><th>Email Address</th> <th>Last Visit Date-Time </th></tr>"; // keeps getting the next row until there are no more to get $i=1; while($row = mysql_fetch_array( $result )) { // Print out the contents of each row into a table echo "<tr><td>"; echo $row['username']; echo "</td><td>"; ?> <TEXTAREA name="text<?php echo $i++; ?>" style="width: 150px; height: 20px;" > <?php echo $row['pcidip']; ?> </TEXTAREA> <!-- <input onclick="doact('text1')" type="button" value="Copy IP"> --> <input onclick="doact('text<?php echo $i++; ?>')" type="button" value="Copy IP"> </form> <?php echo "</td><td>"; echo $row['email']; echo "</td><td>"; echo $row['datetime']; echo "</td></tr>"; } echo "</table>"; ?> I added the $i= statement to increment the loop but it does not do the trick. I am missing something you might see.
  6. thanks for that "You'd require Javascript not PHP for this...." would I need JS for simple highlighting (not copying) when the button is pressed also?... or can that be done in PHP?
  7. Rookie here(old guy), but some <dangerous> knowledge. I make a table that has rows called from a DB (works fine) I need to add a column with button for each row, that when pressed, will copy to clipboard the content of a particular cell in that row ...'pcidip'... If too complex to copy to clipboard, alternatively, perhaps just higlight the content of the cell and the user can then <cntl>C to copy to clipboard. I need it to operate across all platforms (IE, Chrome, Firefox... etc) Can this be <simply> done in PHP? Here is what I have ... snip... echo "<table border='1'>"; echo "<tr> <th>Username</th> <th>Password</th> <th>IP Address</th> <th>Email Address</th> <th>Chk</th> <th> Last Visit Date-Time </th> <th>Copy/Highlight IP</th> </tr>"; // keeps getting the next row until there are no more to get while($row = mysql_fetch_array( $result )) { // Print out the contents of each row into a table echo "<tr><td>"; echo $row['username']; echo "</td><td>"; echo $row['password']; //show the passwords //echo " Blocked "; //passwords are blocked - use this -or- the above, not both echo "</td><td>"; echo $row['pcidip']; echo "</td><td>"; echo $row['email']; echo "</td><td>"; echo $row['emailchk']; echo "</td><td>"; if ($row['datetime'] < date("Y.m.d - H:i:s",time()-60*60)) { echo "<font color='red'>"; echo $row['datetime']; echo " (zzzz)"; } else { echo "<font color='green'>"; echo $row['datetime']; } echo "</td><td>"; echo "button here"; //want button to copy 'pcidip' to clipboard <or HL> - don't know how yet echo "</td></tr>"; } Im sure this would be simple but the only thing I can find is with JS and unique to IE. Please be gentle with me... Im not that savvy, but I try hard... Thanks in Advance Floyd
  8. Correction... I saved it as ANSI... like PFM... suggested.... (not ASCII) I say this because this is a very sublte issue... that causes majore problems... Thanks again PFM....
  9. PFM... WOW!, that did it... now to take that to the actual page I am(was) having problems with.It will take a while to get to it but thank you sooooo much.... I "ASSUMED" the file and what i saw was pure ASCII, but apparently it is embedding something before the first line... and saving it as ASCII removed it.. I save it in notepage(ASCII) and then uploaded it as I usually would. Ive been on this for 3 days, and NEVER would have gotten that. I cant thank you enough. (I hope this is transferrable to my web page I've been pulling (whats left of) my hair.) we will see... Have a great remainder of Xmas, and New Year Floyd
  10. PFM Clearly, I'm out of your league ... I am using Sharepoint Designer... What you see is the exact characters put on the web site.... noting before nor after.. (I know I know... a wysiwyg arrrrrg!!!) but it is PHP, so it is only the pure code I am working on. Hope I am making sense... Floyd
  11. premiso I have taken your code and put it here with the errors to be viewed.. I am not great at programmaing but it shows error and I don't see where is is from You can see function here with the code also... almcom.net/testcookie2.php Here is the code only <?php ini_set ("display_errors", "1"); error_reporting(E_ALL); if (isset($_GET['set_cookie'])) { setcookie("name", "value", time()+3600, "/"); }elseif (isset($_GET['unset_cookie'])) { setcookie("name", false, time()-3600, "/"); unset($_COOKIE['name']); } if (isset($_COOKIE['name'])) { $output .= "The cookie name with a value of " . $_COOKIE['name'] . "<br /> <a href=testcookie2.php>Click here to refresh the page</a> <a href=testcookie2.php?unset_cookie=yes>Click here to unset it</a>"; }elseif (isset($_GET['set_cookie'])) { header("Location: testcookie2.php"); }else { $output .= "The cookie has not been set yet. <a href=testcookie2.php?set_cookie=yes>Click Here</a> to set one."; } echo $output; echo "<br /><br /><br />------begin display of testcookie2.php code----<br />"; highlight_file("testcookie2.php"); echo "<br />------end of testcookie2.php code---------------<br /><br />"; ?> Floyd
  12. Hi PFM... thanks for your help You will notice, I already have the phpinfo() on this page also to help find the problem if it is on the server settings. I have added this to the testsetcookie.php --- ini_set ("display_errors", "1"); error_reporting(E_ALL); --- This testcookie.php web page is on a professional hosting site so I cannot immediatly reset the servers If you go here, you can see it all http://almcom.net/testcookie.php Hope you can spot something,,, I just don't see it... presimo, I am working on your suggestion also. Thanks to you both again for helping, I will continue my beating. Floyd
  13. thanks premiso, I will take a look at what you suggest... but... when I run my script (yes I understand, it will not show the cookie in the same page) it does not put a cookie on my two pc's... (I am looking after every visit...) I will load your suggestion and keep beating on the, thanks Floyd
  14. Merry Xmas to those on this foruum Older guy here with some experience but not allot so please be gentle. I am having problems with setting cookies on my web site. At one time they worked and for the life of me I cannot find the problem... 3 days now ... no joy. To make it as simple as I can, I wrote a very simple program that should demonstrate the problem... I am not that good on server settings, but i have a hunch it is on the server. My program (testcookie.php) has phpinfo() combined with the small program that demonstrates so you can see the exact problem. Can anyone see what I am doing wrong? BTW, I have no .htaccess file. You can see the problem here .. almcom<dot>net/testcookie.php Here is the same code you will see on the above location. <?php setcookie("IM_A_COOKIE", "IM_COOKIE_CONTENT", time() + 3600, "/"); //cookie expires in 60min echo "<br />Running testcookie.php ------- SEE BELOW phpinfo() -------"; echo "<br />-----------------------------------begin display of testcookie.php code------------------<br />"; highlight_file("testcookie.php"); echo "<br />----------------------------------------end of testcookie.php code------------------------<br /><br />"; if (isset($_COOKIE["IM_A_COOKIE"])) echo "It was set... " . $_COOKIE["IM_A_COOKIE"] . "!<br />"; else echo "<h4>Cookie was <font color=red>NOT</font> set</h4>"; echo "-----------------------------------------------------------------------------------"; echo "<br />Here is the phpinfo():..."; phpinfo(); ?> <HTML> <HEAD><TITLE><br /><br />Cookie Tester</TITLE></HEAD> <BODY>END of testing with testcookie.php</BODY> </HTML>
  15. I am about to undertake a web project - I am not a true programmer but I have some ability. I know exactly what I want. I will eventually look for a programer but at this point I am in the definition stage. (Designing the forms and reports and defining the db fields and sorting functions I will need.) In one regard, the closest way to explain is that it is similar to Craigslist. The useres will post their information. There will be much more function however. The webmanagers will screen it and allow or deny. The database will track details. The db will have several forms and several reports. Their will be fields, buttons and radio buttons... My qustion is fundamenta at this time. I know this is a PHP forum and I'm sure your suggestion will be pure PHP, but is it possible (or practical) to use HTML(Please don't laugh) -or- would Joomla be a better way for me. IMHO Joomla would allow me to make some adjustments and not annoy the programmer with my anal changes I would think. What I don't know is if Joomla is flexible enough for building the forms and reports. At this point, I have augured myself to look at HTML, PHP or Joomla. The DB would be mysql. Any suggestions - appreciate your patience.
  16. Thanks Andy, I suspected as much in this foruum. I have the confiramtion <nudge> I was looking for. I looked at the phpMyEdit, and from my limited knowledge/ability, it looks like a good way to setup the table/database. It also refers to 'php-form-generator' ... but the form examples I see are very structed. I guess I will need to edit the form on the html level to get specific postions 'look' and 'feel' on the web page. Thanks again for directing me over there. Floyd
  17. Thanks AndyB for the 'OR' link I think that is much more than I need. The final product is actually a 'rental listing' which our customers will subscribe to. Right now, we simply email it in .pdf if their subscription is current. The main work are the 'forms' for our employees(2-3 we're small). The form screens will allow us to easily update (add/delete/modify) the listings and add/delete/charge/manage new customers. The concept is, the subscribers(customers) go to the web site, login, then have access to the db 'report' There they could arrange/sort to their liking... (by price, location, pets, bd/ba..etc) Once they have sorted to their liking, then they could print it. The OR you pointed to <I think> is alot more than I need. We are presently using Excel and Outlook for the DB and it is painful trying to mangage it... just sooo many steps. IMHO we need to go to a DB that has all the info and can be managed from the web. My question is, should I go PHP/Mysql, or try to continue this with MS Access. I don't mind starting from scratch. Any thoughts about how I should begin would be appreciated. Floyd
  18. I know this is a silly question for this foruum, but... I am about to start a project of developing a WebBased DB for managing housing Rentals Seems like PHP and mySQL would be a perfect fit. My problem is I am pretty much alone and no one to share thoughts with. I am not a real programmer but I have some knowledge and a bit of web/programming ability (Older guy) I have already built about 70% of the functions in MS Access, but I recently decided to put all the operations on the Web Rather than in an office. I like MS Access because for a non-programmer it gives alot of help... I did write some routines in VB but overall it is working. I am at a crossroads to continue in MS Access and try to have that be the core for the Web design, but in the back of my head, I have a feeling I should go to PHP/Mysql ... mainly due to the expansiveness of PHP. There will be about 3-5 people that will need to add/delete/manage the database, then there will be the customers that would access the database to read/sort/print the rental listings. Also they would have the ability add a listing (property owners). The web/database will have to have access security levels (manager/customer) - login/logout and other normal db management routines. I come to this foruum to ask if anyone can comment on my endeavour before I start, because I hate to find out later that MS Access may have been a better choice. - Also, I want to avoid requireing a MS web server over apache (basically a $$ issue). Apache gives me more options I understand. Thanks for any thoughts
  19. Little Guy I followed your <excellent> instructions... and I think your code works great! For those <dummies like me> just some details... When I first saved the file, I saved it as .html and the php code appeard in the box... not the IP address... even so, when I push the copy button, it DID copy the code... Here is what appears in the box and what is copied.. <?= $_SERVER['REMOTE_ADDR']; ?> Then, I had an "ipifiny"(sp) ... duh! , I changed the file name to .php... and viola, it works. I will now integreate it on the working web page(I tested an experiment page) I'm promoting you to "THE BIG GUY"... ub da man! Thanks so much (BTW-new to this, I don't know how to tag this as SOLVED! so I put it in the headder, hope thats OK)
  20. I am a 'rookie' please be gentile. I have a website in PHP with some HTM/L. I display a visitors IP address by using this <?php echo $_SERVER['REMOTE_ADDR'] ; ?> All works fine, I simply want to add a <Copy to Clipboard> button <or link> that when pressed copies that IP to a the users clipboard (I do not want him to highlight then <ctl-C>... My problem is, I see several solutions, but most do not function in both IE and Firefox... I have also seen solutions that require a flash plugin, which is not desireable... Can anyone suggest a clean and simple solution. Thanks in advance.
  21. Blade and Jonsjava Thanks to you both. Your scripting was very helpful.... I did a bit of adjsting for my code and works now I appreciate both your cleverness.... Jons... I had already referred to the DB so I didnt need your connect method I just needed the way you posted the date to mysql... worked like a charm Eternally grateful Floyd
  22. Hi Blade, thanks for looking, I replaced my four lines of code with your code (without your <?php and ?> ) ...still a Blank screen.... Just for a sanity check, I // out your and my code, and goes back to working my mind is 'boggled'
  23. Hi, For what it's worth, my providor (ipower.com) recently 'updated' their servers.... my MySQL stopped working After spitting and sputtering... I had to change the old standby term of 'localhost' to mypersonalurl.ipowermysql.com Their 2nd tier tech's said 'localhost' no longer works... and ya know.. it doesnt, but after running down all my 'localhost' references and replaced them with...mypersonalurl.ipowermysql.com voila.. life is good now... Check with your providor Lots of luck.
  24. I am a layperson, please be gentle. I have a login script that works fairly well. It sets cookies for people that login. I would like to have that persons datetime field get updated whenever he revisits the site if his cookie is still active. I added 4 lines of code that should do it, but does not<heavy sigh>... the result is a blank screen, I remove the lines and all is back and OK. 4 lines of code... simple right???? not for me.... ;-) Here is the code.. I added a few lines before and after so you can see the setup... My problem lines are numbered #1...#4... Thanks in advance function displayLogin() { global $logged_in; if($logged_in) { //FK----attempt to update datetime field for people that log visits to the site // $query = "UPDATE users SET datetime=date("Y.m.d - H:i:s"), //Line#1 // WHERE username='$_SESSION[username]'"; //Line#2 // $result = mysql_query($conn, $query) //Line#3 // or die ("could not execute the query."); //Line#4 //FK-----attempt end echo "<br><h1>Logged In!<br><br></h1>"; echo "Hello <b>$_SESSION[username]</b> you are logged in.<br> You can see the // where I been tesing to control those lines (Maybe you can also tell me how to disply the error message rather than just a blank screen) Any help would be very appreciated.. please be simple in you explanations Thanks in advance.
  25. Please check your email, if you do not have a message from me, please let me know via this forum thanks again my friend
×
×
  • 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.