PHP - Problem With Links
Hi! I have an odd problem... I inserted a flash file in a php doc, and basically what happens is that on some computers, the link does not work without the www extension ... by that i mean if people go to http://mysite.com they will not be able to click the banner but if they put http://www.mysite.com it works...
Very odd as the link is part of the flash movie and it only happens on some computers not all ... anyone would have an idea as to what could cause this ? Alternativly what can I do with this piece of code that does not seem to do the trick either Code: [Select] <div class="subtitulo"><a href="http://hostelsuites.com/hostel-banner.php?Buenos+Aires+Hostel+Suites+Florida&id_hostel=30&idioma=3&id_banner=2"><?php echo ucfirst($lang["expanish"]) ?></a><br /> <br/></div> Many thanks for any help ! Similar TutorialsHi Everyone, I have a page on my website that displays a list of products from a mysql database in a table. Currently when the column titles are clicked, the data is sorted in order with the highest first. $sort = $_GET['sort']; if ($sort == 'price') { $query = mysql_query("SELECT * FROM products ORDER BY price DESC"); } else{ $query = mysql_query("SELECT * FROM products ORDER BY product"); } ... echo "<a href='products.php?sort=price'>Price</a>"; Does anybody know how i would go about setting it up so that if the sort link is clicked a second time, the data is re ordered from descending to ascending? Then if the click is clicked again it would change back to descending, and so on.....? Many thanks I am having trouble get links to email when the Link Text does not match the link. <a href=\"http://mysite.org/?upfriday.php&e=$email&v=$v&r=no\">I do not need a ride this Friday</a> Just prints the text with no link, while: <a href=\"http://mysite.org/?upfriday.php&e=$email&v=$v&r=no\">http://mysite.org/?upfriday.php&e=$email&v=$v&r=no</a> Sends the link just fine. Is there a workaround for this? Or is this just a limitation of PHP? The thing is that I want to put 3 options in each email... each of which sends a different response to a script that will enter their response into the database. I'm afraid if the links are this long and non-descriptive, it will confuse my users. Thanks for any help. Hello guys i want your help in adfly clone script , i have it installed it but i have problem - shrinking links not working on main page, but working good when user logged in all server Requirements are ok my website: adglo.be script: mediafire vt: virustotal regards, Edited by ForexSon, 09 August 2014 - 06:49 PM. <html> <?php $id = $_GET['id']; $dbusername="web148-matt"; $dbpassword="matt"; $dbdatabase="web148-matt"; mysql_connect(localhost,$dbusername,$dbpassword); @mysql_select_db($dbdatabase) or die( "Unable to select database"); mysql_query("UPDATE count SET clicks=clicks+1 WHERE id='$id'"); $sql = mysql_query("SELECT link FROM count WHERE id='$id'"); $fetch = mysql_fetch_row($sql); $result = mysql_query("SELECT * FROM count"); while($row = mysql_fetch_array($result)) { echo "<a href=" .$row['link']. ">Link</a>"; } ?> <a href='http://www.google.com'>Google</a> <a href='/index.php?id=2'>link2</a> </html> So I have been working on my website for a while which all is php&mysql based, now working on the social networking part building in similar functions like Facebook has. I encountered a difficulty with getting information back from a link. I've checked several sources how it is possible, with title 'Facebook Like URL data Extract Using jQuery PHP and Ajax' was the most popular answer, I get the scripts but all of these scripts work with html links only. My site all with php extensions and copy&paste my site links into these demos do not return anything . I checked the code and all of them using file_get_contents(), parsing through the html file so if i pass 'filename.php' it returns nothing supposing that php has not processed yet and the function gets the content of the php script with no data of course. So my question is that how it is possible to extract data from a link with php extension (on Facebook it works) or how to get php file executed for file_get_contents() to get back the html?
here is the link with code&demo iamusing: http://www.sanwebe.c...-php-and-jquery
thanks in advance.
Hi... I am really new to this. Please help me with this... as part of a gallery, I have categories and a thumbnail. As of now the title/link to the gallery shows up on the side of the thumbnail. How can I place the link below the thumbnail? Here is the code Code: [Select] $result_array[] = "<a href='viewgallery.php?cid=".$row[0]."'>".$row[1]."<img src='/photos/categoryimages/category".$row[0].".jpg' border=0 height='133px' width='200px' </a>"; Thank you for your help... ok so im trying to make a news website and i want to be able to include links inside me headline like most news website they talk about the stuff and include some links along the way how would i manage to do that. I would put all my story in the Release textarea Code: [Select] <form class="createheadline" action="createrelease.php" method="post" enctype="multipart/form-data"> <table> <tr> <td></td> <td><?php echo $msg;?></td> </tr> <tr> <td>Author:</td> <td><input type="text" name="author" size="30"/></td> </tr> <tr> <td>Date:</td> <td><input type="text" name="date" /></td> </tr> <tr> <td>Title:</td> <td><input type="text" name="title" size="30"/></td> </tr> <tr> <td>Main Picture</td> <td><input type="file" name="picture" /></td> </tr> <tr> <td>Release:</td> <td><textarea name="release" cols="75" rows="27"></textarea></td> </tr> <tr> <td></td> <td><input type="submit" name="submitbtn" /></td> </tr> </table> </form> I am trying to create a link with an ID from one of my MySQL records. $data = mysql_query("SELECT * FROM USERS"); $info = mysql_fetch_array($data); echo "<a href=a.php?'$info['id']'>hello</a>"; is what I am attempting, but this does not work. Any ideas? Hi, I have a string which contains a mix of Content and anchor links Example: //Example $strContent = 'I am some <a href="/content.htm">Content</a> here, but I could have <a href="/link.php">a Link</a> <a href="http://www.example.com">Followed by another</a> Link, Mix external and not.'; I basically want to programatically pull out all of the Anchor links, and have an array of such Array('/content.htm', '/link.php', 'http://www.example.com'); Help me please. Got a brain freeze as its Friday Afternoon I replaced the display settings URLs permalink and .htaccess this is i write in .htaccess file RewriteEngine on RewriteCond %{HTTP_HOST} ^www.sportskevesti.co$ RewriteRule ^/?$ "http\:\/\/sportskevesti\.co" [R=301,L] RewriteRule ^vest/([0-9_]*).html$ index.php?opcija=permalink&=$1 [L] RewriteRule ^kategorija/([0-9a-zA-Z-_]*).html$ index.php?opcija=kategorija&kategorija_naziv=$1 [L] link is : http://sportskevesti.co/index.php?opcija=vest&permalink=evo-sta-se-desi-kad-srpskom-treneru-pukne-film-video and nothing happens what is wrong ? With my custom CMS I'm developing I have a menu structures type module where the admin can create a menu structures for their website. Inside the db is the links table and I'm trying to figure out what I can do if the link has an actual image. I created a field called link_image however I just thought of what if the link is apart of a sprite which would have most of the time 3 parts of the image (active, hover, normal) or whatever or has its own sprite. How should I handle this if I want to store this information in the database. hi guys i need a bit of help, im trying to build a page which lists all orders in the database, and next to each order put in some links. i could do this fine, but i've now changed certain things and each user has certain permissions. my table is like this _users firstname | lastname | login | password | groupid _usergroups groupid | groupname _usergroup_permissions groupid | area | subarea all should be self explanitory, but in the permissions table `area` refers to the page (orders, customers, system) and `subarea` refers to the actual permission (Add, Edit, Delete, Manage) using the following script, im trying to: 1 - trying to get all the orders 2 - getting the groupid from the users table 3 - getting the permissions for the particular user's group $qry = mysql_query("SELECT o_id, sales_id, job_number, accounts_id, cust_id, status FROM `_orders` ORDER BY o_id DESC LIMIT 50") or die(mysql_error()); while ( $row = mysql_fetch_array($qry) ) { $sql1 = sprintf("SELECT `group` FROM `_users` WHERE `login` = '%s'", $_SESSION['user']); $qry1 = mysql_query($sql1); if(!$qry1){ die('could not query:' . mysql_error());} $sql2 = sprintf("SELECT `subarea` FROM `_usergroups_permissions` WHERE `gid` = '%s' AND `area` = 'Order' ", mysql_result($qry1, 0)); $qry2 = mysql_query($sql2); if(!$qry2){ die('could not query:' . mysql_error());} my group permissions are set to Add Edit and Delete, but there are additional privilages. what i want to happen is for each user that logs in, next to each order are links and depending on if they have the permission, the link will be shown. i tried using the following code in the while loop but it only showed upto the second if statement, and nothing else $link = "<a href='#'>View</a> | "; // show regardless of permissions (THIS WORKS if($racc == 0){$link .= "<a href='#'>Pick Up</a> | ";} // shown if the accounts id isn't set (THIS WORKS) if($qwerty == Edit ){ $links .="<a href='#' onclick='return false'>Edit</a> | ";} //Shown if the permission level says the user can Edit (THIS WORKS) if($qwerty == Delete ){ $links .="<a href='#' onclick='return false'>Delete</a> | ";} //Shown if the permission level says the user can Delete(DOESN'T WORK) if($qwerty == Approve ){ $links .="<a href='#' onclick='return false'>Approve</a> | ";} //Shown if the permission level says the user can Approve (DOESN'T WORKS) if($qwerty == Acceptance ){ $links .="<a href='#' onclick='return false'>Acceptance</a> | ";} //Shown if the permission level says the user can Acceptance (DOESN'T WORKS) I asked about this on another forum and they said its because $qwerty cant be everything and that i should look at using an array, unfortunately that has an undesired effect. so to summaraize...for me the page should look like order - salesman - customer - VIewLink | Addlink | Editlink | Deletelink | Approvelink but for someone who (for example) doesn't have the ADD and Delete permissions order - salesman - customer - VIewLink | Editlink | Approvelink . if NONE of that makes sence, i can provide links and try to explain again. but what i want is different links to be shown depending one what permissions a user has thanks for any help (sorry for waffling on a bit...its getting to that time of the day ) Jack Hi all, Im sorry if this is in the wrong section. But nonetheless, I use php to display my news: I.e - news.php?id=1 that displays all the news on that id. What I want to know is using php how can I get the URL from news.php?id=1 too something like /news/titleofthestory ? Hope I've given enough detail. Thanks!! Hey all, I'm currently coding a Few Blacklists for my Website, in which I want to code it so I'll have all blacklists on one page so the URL would be like: localhost/blacklist.php?user localhost/blacklist.php?staff I've got a Blacklist coded which all works well, just I've attempted using the $_GET function to change the code to the blacklist that they clicked on... <?php session_start(); include ("includes/config.php"); include ("includes/functions.php"); logincheck(); $Username = $_SESSION['username']; ?> <table width='50%' cellpadding='0' cellspacing='0' border='1' class='table' align='center'> <tr> <td class='header' align='center' colspan='4'>Other Blacklists:</td> </tr> <tr> <td align='center'><a href='?user' target='mainFrame'>User Blacklist</a></td><td align='center'><a href='?money' target='mainFrame'>Most Money</a></td><td align='center'><a href='?racewins.php' target='mainFrame'>Race Wins</a></td><td align='center'><a href='?racelose' target='mainFrame'>Race Loses</a></td> </tr> <tr> <td align='center'><a href='?miles' target='mainFrame'>Most Miles</a></td><td align='center'><a href='?fosbl' target='mainFrame'>Faster Or Slower</a></td><td align='center'><a href='?police' target='mainFrame'>Police Chase</a></td> </tr> </table> <br /> <table width='20%' cellpadding='0' cellspacing='0' border='1' class='table' align='center'> <tr> <td colspan='2' align='center' class='header'>User Blacklist:</td> </tr> <tr> <td align='center' class='omg' width='5%'>Num:</td><td align='center' class='omg' width='10%'>Username:</td> </tr> <?php if ($_GET['user']){ $Query = mysql_query("SELECT * FROM users WHERE userlevel = '1' OR userlevel = '5' ORDER BY rep DESC LIMIT 25"); for ($Place < 25; $This = mysql_fetch_object($Query);){ $Place = $Place+1; if ($This->username != $Username){ $Colour = "bgcolor=#424242"; }else{ $Colour = "bgcolor=#111111"; } print ("<tr><td width='5%' align='center' $Colour>$Place</td><td width='20%' align='center' $Colour><a href='profile.php?viewuser=".$This->username."'>$This->username</a></td></tr>"); } } ?> </table> <br /> Soon as I added the $_GET['user]{ it stopped showing the Blacklist completely. Sorry if it wasn't explained well, but hopefully you can catch what I'm trying to-do Thanks. In the MySQL help forum someone asked how to list out all the files in a directory. Another person gave the following code: Code: [Select] <?php $handle = opendir('PUT NAME OF YOUR DIR HERE'); while (false !== ($file = readdir($handle))) { if ($file != "." && $file != "..") { echo $file,'<br />'; } } closedir($handle); ?> I found this to be very helpful! However, is there a way to modify it so that if there are subdirectories, it will list those as hyperlinks so the code would run off of the subdirectory if you were to click that link? When I asked that question in the MySQL forum, I was told that it had nothing to do with PHP which I know. So that's why I am posting it here. Can anyone help? Hello dear friends, Let say we have Code: [Select] $to = "gigi"; then we have link like this Code: [Select] mysite.com/file.php?id=$1 We can change it to new form by add rule at .htaccess codes Code: [Select] RewriteRule -(.*)\.htm file.php?id=$1 So that the link be like this Code: [Select] mysite.com/$to-$id.htm it will works , Now what if i want to make the link like this Code: [Select] mysite.com/$id/$to.htm what will be the .htaccess code in this way ??? thanks There are different methods to catch links in <a> tag from a webpage. But surprisingly, with none of them I was successful to catch all links from e.g. http://www.amazon.com/Notebooks-Laptop-Computers/b/ref=sa_menu_lapnet6?ie=UTF8&node=565108 All links are captured except a series in the main area; e.g. http://www.amazon.com/s/ref=amb_link_85318851_3?ie=UTF8&node=565108&field-availability=-1&brand=acer&emi=ATVPDKIKX0DER&pf_rd_m=ATVPDKIKX0DER&pf_rd_s=center-6&pf_rd_r=1HET3VVW5SXMJ0SRKJVM&pf_rd_t=101&pf_rd_p=1291722382&pf_rd_i=565108 http://www.amazon.com/s/ref=amb_link_85318851_22?ie=UTF8&node=1232596011&brand=samsung&pf_rd_m=ATVPDKIKX0DER&pf_rd_s=center-6&pf_rd_r=1HET3VVW5SXMJ0SRKJVM&pf_rd_t=101&pf_rd_p=1291722382&pf_rd_i=565108 Hey everyone, I'm relatively new to php and I have created a basic login page on my site. It checks whether someone is logged in by searching for a cookie. But I am wondering if there is a simple way to display content an link to only people who are logged in, and show user specific content based on who is logged it (much like forums - but not as complicated, just simple) Thank you and its very much appreciated Hi, I have a peice of code which publishes an image with a link from my database. However I cant get it to use external links. My code is: echo "<a href=\"" .$link . "\"> <img src=\"" .$image ."\" /> </a><BR />"; I have tried all the options I can think of but I cant get it work. Can anyone advise please? |