PHP - Change Link Text
change link text
Code: [Select] <?php require 'connect.php'; ?> <html> <head><title>Admin</title> <link rel="stylesheet" type="text/css" href="tab_style.css"> <script type="text/javascript"> function getXMLHTTP() { var xmlhttp=false; try{ xmlhttp=new XMLHttpRequest(); } catch(e) { try{ xmlhttp= new ActiveXObject("Microsoft.XMLHTTP"); } catch(e){ try{ xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); } catch(e1){ xmlhttp=false; } } } return xmlhttp; } function approve(e) { var req = getXMLHTTP(); if (req) { req.onreadystatechange = function() { if (req.readyState == 4) { // only if "OK" if (req.status == 200) { document.getElementById("appr <?php echo $fet['s_id']; ?>").innerHTML=req.responseText; } else { alert("There was a problem while using XMLHTTP:\n" + req.statusText); } } } req.open("GET", "approve.php?stu="+e, true); req.send(null); } } function block(b) { var req = getXMLHTTP(); if (req) { req.onreadystatechange = function() { if (req.readyState == 4) { // only if "OK" if (req.status == 200) { document.getElementById('blok').innerHTML=req.responseText; } else { alert("There was a problem while using XMLHTTP:\n" + req.statusText); } } } req.open("GET", "block.php?blo="+b, true); req.send(null); } } </script> </head> <body> <?php $admin_err=''; $pass_err=''; if (isset ($_REQUEST['submit'])) { require 'connect.php'; $admin = $_REQUEST['admin']; $pass = $_REQUEST['password']; $err=0; if($admin=="") { $admin_err="enter username"; $err=1; } if($pass=="") { $pass_err="enter password"; $err=1; } if ($err == 0) { $check = mysql_query("SELECT admin FROM admin_login WHERE admin='".$admin."' and password='".$pass."' "); $exi = mysql_num_rows ($check); if($exi == 0) $err_msg = "Username/password combination incorrect."; else { $sel = mysql_query("SELECT * FROM stud"); echo "<h4 class='table-caption'>Students</h4>"; while ($fet = mysql_fetch_array($sel)) { ?> <div class="base-layer"> <div class="table-row"> <div class="c_one"><p class="text"> <? echo $fet['name']; ?></p></div> <div class="c_two"><p class="text"> <? echo $fet['email']; ?></p></div> <div class="c_three"><p class="text"> <? echo $fet['school']; ?></p></div> <div class="c_four"><p class="text"> <? echo $fet['subject']; ?></p></div> <div class="c_five"><p class="text"> <? echo $fet['class']; ?></p></div> <div class="c_six"><p class="text"> <? echo $fet['teacher']; ?></p></div> <div class="c_seven" id="appr <?php echo $fet['s_id']; ?>"><p class="text"> <?php if ($fet['approve'] == 0) ?> <a href="#" onClick="return approve(<?php echo $fet['s_id']; ?>);" style="text-decoration:none"> Approve</a> </p> </div> <div class="c_eight" id="block"><p class="text"> <?php if($fet['approve'] == 1) ?> <a href="#" onClick="block(<?php echo $fet['s_id']; ?>);" style="text-decoration:none"> Block </a> </p> </div> <div class="space-line"> </div> </div> </div> <?php } die(mysql_error()); } } } ?> <form id="formid" method="post" name="myform" action=""> <p> <label for="username">Admin:</label> <input name="admin" type="text" size="20" value="<?php if(isset($admin)) echo $admin; ?>" /> <?php echo $admin_err; ?> </p> <p> <label for="pass">Password:</label> <input name="password" type="password" value="<?php if(isset($pass)) echo $pass;?>" /> <?php echo $pass_err; ?> </p> <p> <input name="submit" type="submit" value="Log in" > </p> <?php if(isset($err_msg)) echo $err_msg; ?> </form> </body> </html> approve.php Code: [Select] <?php require_once 'connect.php'; $id = $_REQUEST['stu']; $upd = mysql_query ("UPDATE stud SET approve = '1' WHERE s_id = ".$id." "); if (!$upd) die(mysql_error()); //header("Location:administrator.php"); echo "Approved"; //echo "<h3>Student Approved</h3>"; ?> Similar TutorialsHi,
I have the following submit button and would like to change it into a link with a class.
<input type="image" alt="Click here to Continue" name="I2" src="altimages/buttons/continue.gif" id="submit">How would I do this using jQuery? Thanks! Hi Support, I have a form, where it collects user description input. I can collect the inputs and store it with newline. The issue is - how to collect the http link to actual hyperlink ref during display. The following is my code: <textarea name="description" cols="50" rows="10" id="description"><?php echo str_replace("<br>", "\n", $description);?></textarea></td> For example, User input: Hi, Check it out - http://www.google.com/ I would like to display google link as href so that Viewers can click the link and go to the page. Right now, it is not href and user need to copy the link to new tabs or pages and then it can come. Thanks for your help. Regards, Ahsan Every other time a user/users click on a link I want the link to change to a different url the next time a user clicks onto that link.
For example two links
url1.html
url2.html
url1.html shows up when a user clicks that link the link auto changes to then when a new user clicks the linke url2.html then back to url1.html and so on?
Don't know where to start on how I would do this let alone have the server remember to keep which ever link to be held for the next user?
I have a line like this it prints text link but I prefer image link how should i edit it I would appreciate some feedback Code: [Select] $templates['etiket'] = array('name' => t('ETİKET'), 'module' => 'uc_invoice_pdf', 'path' => $templates_uc_invoice_pdf_path, 'pdf_settings' => $pdf_settings); This topic has been moved to JavaScript Help. http://www.phpfreaks.com/forums/index.php?topic=342245.0 Hi there,
Apologies if this is in the wrong section, not sure what would cover it aha
I have a client who would like to be able to update her photos in the gallery weekly, and possibly update any text on the site herself (description etc). What is the best way to go about this? She used a site builder to get it up and running, but I don't have access to the host, so I don't have access to databases or know if they allow PhP.
Would an admin panel be the best way about this?
If so, would anyone mind talking me through a rough step-by-step of the process?
This is what I have now and need to change "" Thanks "" to some kind of picture ?> <html><style type="text/css"> <!-- body { background-color: #fff; } body,td,th { color: #000; } --> </style> <body> Thanks </body> </html> This topic has been moved to JavaScript Help. http://www.phpfreaks.com/forums/index.php?topic=357414.0 Is there a way to add an HTML link in a Text E-mail that was generated by PHP? I am trying to create an e-mail that looks like this... Quote Dear Member, Your password was re-set, and the following Temporary Password has been assigned: Use this temporary password to Log In. Debbie I'm wondering if anyone can help me find/create a script which allows a preview of a link to be generated? Basically I need a user to be able to simply enter a url and click submit and then a preview of that link will be shown in the form of some text and an image. Very similar to what Facebook does when a user shares a link. I think they use the description tag of the site in general. Can anyone point me in the right direction in doing this? I need to be able to do it in php/javascript alone without the use of jquery or plugins. I am in the middle of a project on my own website and want to add a filter on it, the results are displayed in a HTML table and are pulled in from a mysql database using php and want to add a text filter on the site. I want the filter to work by clicking on a status text link such as open, pending or closed and it filters the results that match that on the same page for that relevant text value. I was not sure if it's more a php question or if can be done with ajax/javascript I am trying to wrap a string with an anchor tag if it finds a match with a block of text. Here is an example text block: CONOCO 1'10x8 VC DF TP SGN||PRINCIPAL ILLUMINATION||ENG: CO3028TP_0VPR||DWG: CO200428||TO BE: DYED DIESEL (SPEC)|| The string I would want to wrap with a link would be "CO200428". The next problem is the drawings (what I'm searching the text for) has over 115,000 possibilities. The text blocks to search are over 1300. I have the drawing names stored in a simple mysql table...but doing a foreach takes forever...I imagine it will take even longer when looking in the text blocks... Is there a way to easily to do the anchor wrap? I don't know regex very well... Hello all! I am somewhat new to PHP and SQL, but I think I have a basic understanding of how the language works. I have read through a million different websites and forums, and have tried a million different ways but am just not getting anywhere! This is what I am trying to do... I have a text link that I want to click through to an outside URL from my website. This outside URL was already entered into an SQL database, and I just cant seem to get the text link to bring up the outside URL from the database. This is what I have so far... 1.) My webpage that I am working on is www.mywebsite.com/articles.php 2.) I want the text "Read more..." on this webpage to click through to an outside URL, like "http://www.google.com", which was already entered into an SQL database under the title of "article_link" in a new window 3.) So I would like for "Read more..." to click through the outside URL that was entered into "article_link" in the database Code: [Select] <?php echo <p><a href="\' . $article_link . '\" target="_blank">Read more...</a></p>; ?> Nothing I have tried has worked so far, nothing clicks through to the outside URL in the "article_link" entry from the database. Sorry if I am being redundant, I have been at this all day! Please help and thank you in advance!! Hello, I am having a problem with a link text when ever there is a text that has multiple words. (e.g. 2 Cor prints out with the white space but when I click on the text the url is printed without the text as 2Cor and so it doesn't find a match) here is my code: Code: [Select] <?php if($_GET['book'] == ''){ $books = $wpdb->get_results(" SELECT book_name FROM {$wpdb->prefix}sb_books_sermons LEFT JOIN {$wpdb->prefix}sb_books ON {$wpdb->prefix}sb_books_sermons.book_name = name GROUP BY book_name ORDER BY {$wpdb->prefix}sb_books.id ASC "); foreach($books as $book){ echo '<li><div class="droidlist"><a href="bible/?book='.htmlentities($book->book_name).'">'.$book->book_name.'</a></div></li>'."\n\t"; } } Code: [Select] <?php echo $row_Recordset1['name']; ?> i want to convert the name in to like <a href=main.php?name= $row_Recordset1['name'] >> in databse i has 3 name Steve Mark Lisa i want that names into link like main.php?name=mark and so on how to do it help me h I know with a submit button I can have a new record created when clicking it, but is it possible to do with a text link? hey there peoples i have a bit of a problem with my php code. when i click on the name it wont play the video. but if i click on the thumbnail it plays here is the code Code: [Select] echo "<div class='Video_thumbnail'>"; echo "<a href='/Video.php?id={$row['id']}'>"; echo "<img src='http://i.ytimg.com/vi/{$row['link']}/hqdefault.jpg' width='220' height='170' alt='click' /></a>"; echo "<br>"; echo "</br>"; echo "<a href='/Video.php?={$row['id']}'>"; echo "{$row['navn']}</a>"; echo "</div>"; Hello.
I have a bit of a problem. When I fetch the link field from the database.i don't see an actual link on the page.
One more thing, what type of field should I use to store the link in the database? Probably there is where I went wrong.
All help is
Hi I've got this database I created with fields ProductId ProductName Image I've managed to get it to list the ID,productname, and Image urls in a list. My next step is to have the image field actually display an image and make it clickable: heres what I've done so far: Code: [Select] <?php $con = mysql_connect("localhost","root",""); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("productfeed", $con); $result = mysql_query("SELECT * FROM productfeeds"); echo "<table border='0'> <tr> <th>Firstname</th> <th>Lastname</th> <th>Image</th> </tr>"; while($row = mysql_fetch_array($result)) { echo "<tr>"; echo "<td>" . $row['ProductID'] . "</td>"; echo "<td>" . $row['ProductName'] . "</td>"; echo "<td>" . $row['ImageURL'] . "</td>"; echo "</tr>"; } echo "</table>"; mysql_close($con); ?> Heres what I want to do: Code: [Select] while($row = mysql_fetch_array($result)) { echo "<tr>"; echo "<td>" . $row['ProductID'] . "</td>"; echo "<td>" . $row['ProductName'] . "</td>"; // my changes beneath echo "<td>" . <a href="<?php echo $row['ImageURL'];?>"> <img src="<?php echo $row['LinkURL']; ?>"> </a>. "</td>"; echo "</tr>"; } echo "</table>"; mysql_close($con); ?> Can you guys point me in the right direction? Many thanks |