PHP - How Do Insert A Hyperlink In $message Php?
This is a partial script but I can't get the hyperlink. It shows the whole code instead of just showing "link" as a link.
Code: [Select] $email=$_POST['email']; $password=$_POST['password1']; $username=$_POST['username']; $to=$email; // Your subject $subject="My Website - Your login info"; // From $header="from: Mywebsite<webmaster@mywebsite.com>"; $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; // Your message $message="This is your log in information: \r\n"; $message.=" Username: $username \r\n"; $message.=" Password: $password \r\n"; $message.="Click on <a href=\"http://www.mywebsite.com\">link</a> and login to start posting."; // send email $sentmail = mail($to,$subject,$message,$header); Similar TutorialsHello Everyone. Im new here, but hopefully you can help me I have designed a CMS using PHP and MySQL. Its fairly basic, I'll talk you thorugh the stages: 1.) The user inputs their product information into a form and the script uploads it to the database giving it a unique ID. 2.) The user is then asked to upload a big image for that product, the image is added to a folder on the server. 3.) Now the user must choose a thumbnail and it uploads in the same manner. My problem is linking the two together... So far I have this: <?php $images = "products/"; $big = "big/"; $cols = 2; if ($handle = opendir($images)) { while (false !== ($file = readdir($handle))) { if ($file != "." && $file != ".." && $file != rtrim($big,"/")) { $files[] = $file; } } closedir($handle); } $colCtr = 0; echo '<table width="212" cellpadding="2"><tr>'; foreach($files as $file) { if($colCtr %$cols == 0) echo '</tr><tr><td colspan="2"></td></tr><tr>'; echo '<td wdith=50% align="center"><a href="' . $images . $big . $file . '"><img border="0" class="gradualfader" src="' . $images . $file . '" /></a></td>'; $colCtr++; } echo '</table>' . "\r\n"; ?> This displays a lovely list of thumbnails, which when clicked opens the larger image. What i would like to do is insert a "ID" for each image so the product data can be grabbed from the database ? I think i've explained this well enough? reply if not and illl try and add more detail. To see it in action you can go to http://design.surreylabs.co.uk/parliament/2/products.php Thanks in Advance! Hi i have this while fetch query which brings up a images from the database but know i tried to add a delete link in each image so i add a delete hyperlink inside the query but instead counts the link as if it was a image too. like if i have 5 images it will double to 10 because of the delete hyeprlink why is this happen help please <?php define('ROOT_DIR', './'); define('PROPER', TRUE); /** * include common files */ include_once(ROOT_DIR. 'includes/common.inc.php'); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Untitled Document</title> <link href="css_eurico/lightbox.css" rel="stylesheet" type="text/css" /> <link href="css_eurico/jquery.lightbox-0.5.css" rel="stylesheet" type="text/css" media="screen" /> <script type="text/javascript" src="js_eurico/jquery.js"></script> <script type="text/javascript" src="js_eurico/jquery.lightbox-0.5.min.js"></script> <script type="text/javascript"> $(function() { $('#gallery a').lightBox(); }); </script> </head> <body> <?php $album_id = $_GET['albums']; $photo = mysql_query("SELECT * FROM photos WHERE album_id='$album_id'"); echo '<div id="menu">'; while ($row = mysql_fetch_assoc($photo)) { echo '<div id="gallery">'; echo'<div class="Image">'; echo '<a href=photos/thumbs/'. $row['photo_proper'] . ' "><img class="picture" src="photos/' . $row['photo_proper'] . ' " width="100" height="100 " /></a>'; echo '<h4 class="brand">' . $row['photo_name'] . '</h4>'; echo '</div>'; echo '<a href="index.php">alo</a>'; } ?> </div> </div> </body> </html> Hello there, I am trying to build my site more efficient by sending me error messages that occur. I have decided that most of my errors are mysql errors. Thinking about what to do, I tried to put an insert query in the die message. Here is my line of code below. Code: [Select] $globalsql=mysql_query("SELECT * FROM global") or die(' $error=mysql_query("INSERT INTO errors (name, identity, user,) VALUES ('"'Error 1'"', '"'global_functions.php'"', '"'System'"')") '); However, I get this error: Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in global_functions.php on line 4 Which is that line. Any ideas? Thanks! In drive.php
public function insert($postBody, $optParams = array()) Can anyone tell me why this is not INSERTing? My array data is coming out just fine.. I've tried everything I can think of and cannot get anything to insert.. Ahhhh! <?php $query = "SELECT RegionID, City FROM geo_cities WHERE RegionID='135'"; $results = mysqli_query($cxn, $query); $row_cnt = mysqli_num_rows($results); echo $row_cnt . " Total Records in Query.<br /><br />"; if (mysqli_num_rows($results)) { while ($row = mysqli_fetch_array($results)) { $insert_city_query = "INSERT INTO all_illinois SET state_id=$row[RegionID], city_name=$row[City] WHERE id = null" or mysqli_error(); $insert = mysqli_query($cxn, $insert_city_query); if (!$insert) { echo "INSERT is NOT working!"; exit(); } echo $row['City'] . "<br />"; echo "<pre>"; echo print_r($row); echo "</pre>"; } //while ($rows = mysqli_fetch_array($results)) } //if (mysqli_num_rows($results)) else { echo "No results to get!"; } ?> Here is my all_illinois INSERT table structu CREATE TABLE IF NOT EXISTS `all_illinois` ( `state_id` varchar(255) NOT NULL, `city_name` varchar(255) NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; Here is my source table geo_cities structu CREATE TABLE IF NOT EXISTS `1` ( `CityId` varchar(255) NOT NULL, `CountryID` varchar(255) NOT NULL, `RegionID` varchar(255) NOT NULL, `City` varchar(255) NOT NULL, `Latitude` varchar(255) NOT NULL, `Longitude` varchar(255) NOT NULL, `TimeZone` varchar(255) NOT NULL, `DmaId` varchar(255) NOT NULL, `Code` varchar(255) NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; I'm missing something here. I have a form, and when the submit is pressed, the relevant post data inserts into table one, then I want the last insert id to insert along with other form data into a second table. The first table's still inserting fine, but I can't get that second one to do anything. It leapfrogs over the query and doesn't give an error. EDIT: I forgot to add an error: I get: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'usage, why VALUES ('14', '', '123', '','1234', '', '')' at line 1 query:INSERT INTO tbl_donar (donar_fname, donar_name, donar_address, donar_address2, donar_city, donar_state, donar_zip, donar_email, donar_phone, donar_fax, donar_company) VALUES ('test 14', 'asdfa', 'asdf', 'adf','asdf', '', '', '', '123', '', '') Code: [Select] if (empty($errors)) { require_once ('dbconnectionfile.php'); $query = "INSERT INTO tbl_donar (donar_fname, donar_name, donar_address, donar_address2, donar_city, donar_state, donar_zip, donar_email, donar_phone, donar_fax, donar_company) VALUES ('$description12', '$sn', '$description4', '$cne','$description5', '$description6', '$description7', '$description8', '$description9', '$description10', '$description11')"; $result = @mysql_query ($query); if ($result) { $who_donated=mysql_insert_id(); $query2 = "INSERT INTO tbl_donation (donor_id, donor_expyear, donor_cvv, donor_cardtype, donor_authorization, amount, usage, why) VALUES ('$who_donated', '$donate2', '$donate3', '$donate4','$donate5', '$donate6', '$donate7')"; $result2 = @mysql_query ($query2); if ($result2) {echo "Info was added to both tables! yay!";} echo "table one filled. Table two was not."; echo $who_donated; //header ("Location: http://www.twigzy.com/add_plant.php?var1=$plant_id"); exit(); } else { echo 'system error. No donation added'; Hey guys Just a quick question: How to embed hyperlink into a database cell? Basically I echo out a table on the user interface of my site and there's an URL in one of the cells I want the user to access it by clicking on it, without copying and pasting the URL into the URL bar of the browser I tried updating the cell in phpmyadmin using <a href = http://www.example.com>http://www.example.com</a> but didn't work out, the resulting cell only had the text format Any help would be appreciated Thanks. I am having problems with a line of code. This is what I have so far. I am missing a "," according to my error message. Im trading in deep water with this line of code. I am trying to use the data from my echo state to be a hyperlink... If that makes sense. Code: [Select] echo "\t" . '<td><a href="' . APP_ROOT . 'onlinebanking/viewtransactions.php">. $account['BankAccountID'] . </a>' '</td>' . "\n"; Hello im wondering how i can make a hyperlinks adress be a set after a variable. this is my php: $result1 = mysql_query("SELECT id, namn, url FROM stuff ORDER BY id desc limit 1;"); $result2 = mysql_query("SELECT id, namn, url FROM stuff ORDER BY id desc limit 1,1;"); <html> <a href="???"> <p class="note-general"> The first link </p> <a href="???"> <p class="note-general"> The the second link </p> </html> The important thing is that the url from $result1 will link under "the first link" and url from $result2 link under "the second link". I have searched this forum and haven't found a solution to my question. please don't flame... I am trying to send a table field from one page to another. the field i'm sending is id. I have managed to populate the field updateplayer.php?id=***** now i have a syntax error trying to get the field to show up on the update player form. Parse error: syntax error, unexpected T_VARIABLE in /home/netman13/public_html/bccsl.org/managers/updateplayer.php on line 7 The id field is supposed to get the id variable from the previous page ?id=***** Here is the update player code: Code: [Select] <?php include 'dbc.php'; $qP = "SELECT * FROM players WHERE id = '$_GET['$id']' "; $rsP = mysql_query($qP); $row = mysql_fetch_array($rsP); extract($row); $id = trim($id); $first = trim($first); $last = trim($last); $address = trim($address); $city = trim($city); $postal = trim($postal); $phone = trim($phone); $feet = trim($feet); $inches = trim($inches); $weight = trim($weight); $birth = trim($birth); $status = trim($status); $number = trim($number); mysql_close(); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Update Player</title> <link href="styles.css" rel="stylesheet" type="text/css"> <script language="JavaScript" type="text/javascript" src="js/jquery-1.3.2.min.js"></script> <script language="JavaScript" type="text/javascript" src="js/jquery.validate.js"></script> <script> $(document).ready(function(){ $.validator.addMethod("username", function(value, element) { return this.optional(element) || /^[a-z0-9\_]+$/i.test(value); }, "Username must contain only letters, numbers, or underscore."); $("#regForm").validate(); }); </script> </head> <body> <script language="JavaScript"> <!-- /*********************************************** * Required field(s) validation v1.10- By NavSurf * Visit Nav Surf at http://navsurf.com * Visit http://www.dynamicdrive.com/ for full source code ***********************************************/ function formCheck(formobj){ // Enter name of mandatory fields var fieldRequired = Array("first", "last", "address", "city", "postal", "phone", "hft", "hinch", "weight", "birthdate", "status"); // Enter field description to appear in the dialog box var fieldDescription = Array("First Name", "Last Name", "Address", "City", "Postal Code", "Phone Number", "Feet", "Inches", "Weight", "Birthdate YYYY/MM/DD", "Player Status"); // dialog message var alertMsg = "Please complete the following fields:\n"; var l_Msg = alertMsg.length; for (var i = 0; i < fieldRequired.length; i++){ var obj = formobj.elements[fieldRequired[i]]; if (obj){ switch(obj.type){ case "select-one": if (obj.selectedIndex == -1 || obj.options[obj.selectedIndex].text == ""){ alertMsg += " - " + fieldDescription[i] + "\n"; } break; case "select-multiple": if (obj.selectedIndex == -1){ alertMsg += " - " + fieldDescription[i] + "\n"; } break; case "text": case "textarea": if (obj.value == "" || obj.value == null){ alertMsg += " - " + fieldDescription[i] + "\n"; } break; default: } if (obj.type == undefined){ var blnchecked = false; for (var j = 0; j < obj.length; j++){ if (obj[j].checked){ blnchecked = true; } } if (!blnchecked){ alertMsg += " - " + fieldDescription[i] + "\n"; } } } } if (alertMsg.length == l_Msg){ return true; }else{ alert(alertMsg); return false; } } // --> </script> <table width="100%" border="0" cellpadding="5" cellspacing="0"class="main" > <tr> <td colspan="1"><p></p></td> </tr> <tr> <td width="17%"><? //Call Menu include 'menu.php'; ?></td> <td width="3%"> </td> <td width="80%"><p align="center">Update Player Information</p> <p align="center"><? if (isset($_GET['msg'])) { echo "<div class=\"msg\">$_GET[msg]</div>"; } ?></p> <p align="center"> </p> <form action="playerupdate.php" method="post" enctype="multipart/form-data" name="form" id="form" onsubmit="return formCheck(this);"> <table width="653" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td width="148" height="29">First Name</td> <td width="153"><label> <input name="first" type="text" disabled="disabled" class="required" id="first" value="<?=$first ?>" /> </label></td> <td width="91" height="30">Last Name</td> <td width="261"><label> <input name="last" type="text" class="required" id="last" value="<?=$last ?>" readonly="readonly" /> </label></td> </tr> <tr> <td height="30">Address</td> <td><input name="address" type="text" class="required" id="address" value="<?=$address ?>" /></td> <td>City</td> <td><label> <input name="city" type="text" class="required" id="city" value="<?=$city ?>" /> </label></td> </tr> <tr> <td height="28">Postal Code</td> <td><label> <input name="postal" type="text" class="required" id="postal" value="<?=$postal ?>" size="12" /> </label></td> <td>Phone Number</td> <td><label> <input name="phone" type="text" class="required" id="phone" value="<?=$phone ?>" size="13" /> </label></td> </tr> <tr> <td height="29">Height <strong>(ft / in)</strong></td> <td><label> <input name="feet" type="text" class="required" id="feet" value="<?=$feet ?>" size="3" /> / <input name="inches" type="text" class="required" id="inches" value="<?=$inches ?>" size="3" /> </label></td> <td>Weight (lbs)</td> <td><input name="weight" type="text" class="required" id="weight" value="<?=$weight ?>" size="5" /></td> </tr> <tr> <td height="35">Birthdate <strong>(yyyy/mm/dd)</strong></td> <td><label> <input name="birth" type="text" class="required" id="birth" value="<?=$birth ?>" size="13" readonly="readonly" /> </label></td> <td><label>Player Type:</label></td> <td><p> <label> <input name="status" type="radio" id="type_0" value="1" checked="checked" /> Church</label> <br /> <label> <input type="radio" name="status" value="2" id="type_1" /> Import</label> <br /> <label> <input type="radio" name="status" value="3" id="type_2" /> Witness</label> <br /> </p> <label></label></td> </tr> <tr> <td height="35">Player ID:</td> <td><input name="id" type="text" id="id" value="<?=$id ?>" readonly="readonly" /></td> <td>Player Number:</td> <td><input name="number" type="text" class="required" id="number" value="<?=$number ?>" size="5" /></td> </tr> <tr> <td height="29"> </td> <td><label></label></td> <td><p> <input name="teamid" type="hidden" id="teamid" value="<? echo $_SESSION['teamid'];?>" /> <input name="division" type="hidden" id="division" value="<? echo $_SESSION['divisionid'];?>" /> <input type="hidden" name="currentdate" size=11 > </p> <p> <input name="teamname" type="hidden" id="teamname" value="<? echo $_SESSION['team_name'];?>" /> </p> <p> <script> /*Current date in form credit: JavaScript Kit (www.javascriptkit.com) Over 200+ free scripts here! */ var mydate=new Date() var theyear=mydate.getYear() if (theyear < 1000) theyear+=1900 var theday=mydate.getDay() var themonth=mydate.getMonth()+1 if (themonth<10) themonth="0"+themonth var theday=mydate.getDate() if (theday<10) theday="0"+theday //////EDIT below three variable to customize the format of the date///// var displayfirst=theyear var displaysecond=themonth var displaythird=theday //////////////////////////////////// document.form.currentdate.value=displayfirst+"/"+displaysecond+"/"+displaythird </script> <input name="approved" type="hidden" id="approved" value="0" /> </p></td> <td> </td> </tr> </table> <p align="center"> <label> <input type="submit" name="submit2" id="submit2" value="Submit" /> </label> <label> <input type="reset" name="reset2" id="reset2" value="Clear" /> </label> </p> </form> <p align="center"> </p> <p align="center"> <label></label> </p></td> </tr> <tr> <td colspan="3"> </td> </tr> </table> <p> </p> </body> </html> Thanks for your help. This forum has been an awesome resource for me. I am using xampp. <a href="/">Home Page</a>The above code (when clicked in browser) takes me to the localhost instead of localhost/website How can i clear this issue? Hi there, im trying to echo a hyperlink and parse a url parameter. Its not quite working as iam getting T-string error. If someone with fresh eyes could quickly glance for me that would be ace. Code: [Select] <?php if ($row_ship['PlayerName'] == '$_SESSION['MM_Username']'){ echo '<a href="ship_edit.php?recordID='.$row_Ship['ShipID'].'">Edit</a>';} ?> Thank You Hello, I'm having a bit of a problem here, all help to this issues would be much appreciated I am trying to use text boxes to insert numbers into the database based on what is inputed. If I have a string, like this for example: $variable = 09385493; And I want to insert it into the database like this: mysql_query("INSERT INTO integers(number) VALUES ('$variable')"); When checking the integers table in my database, looking at the number field, the $variable that was inserted is outputted as 9385493 Notice the number zero was taken out of the front of the number. If the number is double 0's (009385493), both of those zero's would disappear, too. Thanks This is my code for a 'gallery' so to call on my website (http://www.thenourishedcanuck.com/blog/). I would like to introduce a hyperlink, so that I can link to an article, in with the caption. It works for the original image, but I would like to add different links to the captionbox when each image is called. (I.e. see the image that says 'why won't this work' - how can i make that sentence a hyperlink; something like that) Any help or suggestions would be greatly appreciated! p.s. this gallery only works on Firefox and Chrome; not on Internet Explorer Here is the code for that portion: <div> <div id="gallery"> <div id="gallery-wrapper"><img class="output" src="<?php bloginfo('template_url'); ?>/images/img01.jpg" width="512" height="202" alt="" /> <div class="caption-box"> <span class="caption">Nourished Canuck</span><span class="caption2">Welcome to the Nourished Canuck.</span></div> <br class="clear" /> <ul class="thumbnails"> <li><<img class="active" src="<?php bloginfo('template_url'); ?>/images/img01.jpg" title="Why won't this work?"></li> <li><img src="<?php bloginfo('template_url'); ?>/images/img04.jpg"></li> <li><img src="<?php bloginfo('template_url'); ?>/images/img05.jpg"></li> </ul> <br class="clear" /> </div> </div> <script type="text/javascript"> $('#gallery').gallerax({ outputSelector: '.output', // Output selector thumbnailsSelector: '.thumbnails li img', // Thumbnails selector captionSelector: '.caption', // Caption selector captionLines: 2, // Caption lines (2 lines) fade: 'fast', // Transition speed (fast) }); </script> <!-- end --> </div> for example, I will like harrypotter as the hyperlink and it holding a hidden value "books" Hello I've some text and I want remove hyperlink that in text. for example this code : Code: [Select] <p align="left"><img src="http://www.ebookz.ir/static/images/book/PhotoshopElements9:TheMissingManual.jpg" width="180" height="220" align="right"></p></br><b>Paperback:</b> 640 pages<br /><b>Publisher:</b> <a href="http://www.ebooks.com/tags/Pogue+Press/" >Pogue Press</a>; 1 edition (September 29, 2010)<br /><b>Language:</b> English<br /><b>ISBN-10:</b> 1449389678<br /><b>ISBN-13:</b> 978-1449389673<br /><br />Elements 9 offers much of Photoshops power without the huge price tag. Its an ideal tool for most image-editing buffs -- including scrapbookers, photographers, and aspiring graphic artists. But Elements still doesnt come with a decent manual. This bestselling book will help you get the most out of the program, from the basics to advanced tips for both Windows and Mac. <br />Quickly learn your way around. Customize Elements to suit your working style. <br />Get to work right away. Import, organize, and make quick image fixes with ease. <br />Retouch any image. Learn how to repair and restore your old and damaged photos. <br />Add some pizzazz. Give images more zip with dozens of filters, frames, and special effects. <br />Find your creative flair. Create scrapbooks, greeting cards, photo books, and more. <br />Use advanced techniques. Work with layers, blend modes, and other tools. <br />Try out your new skills. Download practice images and try new tricks as you learn.</div></div> I want remove this hyperlink <a href="http://www.ebooks.com/tags/Pogue+Press/" >Pogue Press</a> can anyone help me? The $_SESSION['record_to_chage'] variable is set- I know this as I can echo it out. $openedfile = file("myfile.txt"); sort($openedfile); // foreach($openedfile as $key => $newpick) { echo "<a href=\"/editpage.php?request=$_SESSION['record_to_chgange']&newcat=$newpick\" target=\"_parent\">$newpick</a>"; echo "<br>"; } The Resulting error: Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in For the life of me I can not figure where I am going wrong. Going to get coffee and some fresh eyes. Cheers Can someone tell me why this gives me undefined variables? The $id variable is showing up fine in this bit of code. When I click the link it is supposed to pull the data from the database related to the $id. Code: [Select] <a href='javascript: window.document.Vids<?php echo $id; ?>.submit();'>Watch</a> <form name="Vids<?php echo $id; ?>" action="<?php echo $PHP_SELF; ?>" method="post"> <input value="<?php echo $id; ?>" type="hidden" name="Vids" /> </form> here is the code which is supposed to display the info. Code: [Select] if (isset($_POST['Vids'])) { $result = mysqli_query($link, "SELECT * FROM vidaud where id =".$_POST['Vids']); echo $id; the error i get is Quote Notice: Undefined variable: id in /services5/webpages/util/b/b/bbctech2.site.aplus.net/public/dbsite/a_newsite/sermons.php on line 32 I'm just not sure why the $id variable isn't being posted by my form and read by the code. Thanks. |