Jump to content

MesaFloyd

Members
  • Posts

    35
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Male
  • Location
    So Calif

MesaFloyd's Achievements

Newbie

Newbie (1/5)

0

Reputation

  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.
×
×
  • 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.