Jump to content

Search the Community

Showing results for tags 'links'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (PhpStorm, VS Code, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start





Website URL








Donation Link

Found 11 results

  1. Hello - I hope I explain this clearly... I have some php code that presently displays 4 boxes in a row with images. When you click on a box/image, you go to a web post. The code goes to the bottom, sets the link, then loops back for the next image and repeats the process. What I'm trying to do is break this code apart so that that I can make each image go to a different link - basically set it up as html - image with link to a page. ( 4 of these) However, I don't want to break the code or the page that it displays ( our home page ) Here's the code snippet: <div id="new-classes" class="carousel slide"> <!-- Wrapper for slides ufff--> <div class="carousel-inner"> <?php $pieces=array_chunk($gallery,4); $j=0; foreach ($pieces as $slice) { echo '<div class="item '; if($j==0){echo 'active';} echo '">'; foreach ($slice as $i => $conte) { ?> <div class="col-sm-6 col-md-3" > <div class="new-class" > <img src="<?php echo $slice[$i]['image']; ?>" alt="//" /> <div class="class-title" > <div class="occult" > TEST this is where the specialities boxes link is <a <?php echo colors('a');?> href="<?php echo $slice[$i]['link']; ?>" class="link" ></a> I duplicated the above line and put in a specific link but it makes all the images go to the same page <a <?php echo colors('a');?> href="https://www.absolutept.com/tendinopathy/" class="link" ></a> --> </div> <h3 <?php echo colors('h3');?>><?php echo $slice[$i]['title']; ?></h3> <p <?php echo colors('p');?> class="occult" ><?php echo wp_trim_words(insert_br($slice[$i]['desc']),10,'...'); ?></p> </div> </div> </div> <?php } //end slice echo '</div>'; $j++; } // end pieces ?> </div> our homepage is absolutept.com -- these images are the "specialties" section 3/4 of the way down In the theme( wordpress) - there's an option to enter specialties ( custom post type ) which we did but we don't want these links to go to those special posts, we want them to go to the pages that the user can find in the main menu I know this is breaking the set up of the theme but if it's doable, we'd like to try First - any idea if it's doable and if so, thoughts on how? =) Thanks in advance.
  2. Is w3c a truce source to follow for any errors found on a website? For eg. I have my links setup like this. < a href="record.php?id=4&user=smith"></a> W3C is tell me to not use "&" symbol and that instead escape it as & So what do I just replace & with & in all my links?
  3. I have question regarding the setup of url for multiple pages. For eg. How does one have a setup like this? http://www.groupon.ca/deals/gatineau_en/Antirouille-Metropolitain/35853918 The setup I have is like this. //Page 1 with posts shown in a specific catagory. www.mysite.ca/posts_cat.php?catagoryId=1 //Page 2 with a single post shown. www.mysite.ca/posts.php?title=this is my post As you can see, my url setup is quite different than Groupon's. I am not sure if it's the correct way to do it; but it does work. The reason I have two different pages for posts are because I have two different css designs. I suppose my question is, is my method ok? And how do I make it so it looks like Groupon's way?
  4. Hi, I am designing a new web page with a navigation bar (nav.php) that is used by pages throughout the site. The "nav" is in the main directory, some other pages are in the sub-directories. The (relative) links in "nav" do not work when referenced from a "file" in a subdirectory. I suspect this is because they are being read relative from the "file" directory, rather than the directory that "nav" is in. Please confirm that this would be the case!?! Please advise is this a suitable practice of using a single "nav" across all subdirectories (I was planning on nesting to a second level so that when the about button for instance is clicked it would show something like: HOME ABOUT SHOP [level 1] RED BLUE YELLOW BLACK [level 2 about red ones] so that a second nav bar in the about folder nested under the main "nav") or is it typical to just put a different one in each directory so they all have to be updated, or do I just put all the files in one directory or is there some other way that this might better be done? I've nearly got this working [file attached]: <?php $path = $server['DOCUMENT_ROOT']; $path .= "/subpath/public"?> <html> <a href=<?php print "$path";?>/pathext/about1.php>ABOUT1</a></html> When I view the source on my browser it is right, I can even cut and paste the path/file back into the browser and it works, but it doesn't work in the code. What am I am doing wrong here?
  5. Hi, I am still learning PHP and given some HTML I am trying to extract all links and iframes from the HTML and append them to a different string. I am still learning PHP so I am not sure if how I am checking that the returned array has values (isset) or if I should be appending strings together (.) is correct The code that I have so far is function GetLinksIFrames($content) { $innerContent =''; $regex_pattern_links = "/<a href=\"(.*)\">(.*)<\/a>/"; preg_match_all($regex_pattern_links,$content,$matches); for ($i = 0; $i < count($matches); $i++) { if(isset($matches[0][$i]))// Is this correct? { $innerContent = $innerContent.$matches[0][$i]." "; // Is this how to append a result to an existing string? } } $regex_pattern_iframe = "/<iframe src=\"(.*)\">(.*)<\/iframe>/"; preg_match_all($regex_pattern_iframe,$content,$matches); for ($i = 0; $i < count($matches); $i++) { if(isset($matches[0][$i])) { $innerContent = $innerContent.$matches[0][$i]." "; } } return $innerContent; } Any help appreciated Thanks Mark
  6. is there a way we can count the number of link enter in fckeditor while form submission and if number of links exceeds 3, it shows a popup window. thanks and regards, jass.
  7. I have the following code allowing me to navigate to the previous or next record in the db. In the code below, I would like to swap 'new_date' (which is in the 000-00-00) format for the existing 'record_id' in the script. I need to navigate via the new_date because it is possible with my program to delete a record and reenter it later for that passed date causing the record_id to be out of sinc with the reord_id. Example: My record_id is auto-increment so if I find a mistake in a past record and go to fix it for that date in the past, my auto-increment would be 235, 236, 237, 568, 239, 240 etc., so I can't use record_id to navigate next and previous. When I use new_date instead of record_id, my error says either that the query was empty, or that Variable id not defined. Script terminating. I would appreciate any help you can give, Thanks! Doug This is also on a web page, so here's my code: php: $current_id = $_GET['record_id']; $record_id = $current_id; $prevquery = "SELECT * FROM daily_sales WHERE record_id < $current_id ORDER BY record_id DESC LIMIT 1"; echo $current_id; $prevresult = mysql_query($prevquery) or die(mysql_error()); while($prevrow = mysql_fetch_array($prevresult)) { $previd = $prevrow['record_id']; } $nextquery = "SELECT * FROM daily_sales WHERE record_id > $current_id ORDER BY record_id ASC LIMIT 1"; $nextresult = mysql_query($nextquery) or die(mysql_error()); while($nextrow = mysql_fetch_array($nextresult)) { $nextid = $nextrow['record_id']; } html: <a href="http://www.mywebsite.com/view.php?record_id=<?php echo $previd; ?>">Previous</a> <a href="http://www.mywebsite.com/view.php?record_id=<?php echo $nextid; ?>">next</a>
  8. Hi I'm using wordpress and I want to create a link that will use the slug of an item from the database. For example if the user clicks on view of an item, then the link must direct the user to a page that will have more information of the item. I have this <?php global $wpdb; $bras = $wpdb->get_results("SELECT * FROM bras;"); ?> [/size][/font][/color] <table> <?php foreach($bras as $bra): ?> <td><?php echo $bra->title ?><br /> <img src="<?php echo bloginfo('template_directory').'/img/'.$bra->filename; ?>" /><br /> <?php echo $bra->content ?><br /> <?php echo $bra->price ?><br /> <a href="#" />View</a> <?php endforeach; ?> </td> </table> and then the user will click view and then get directed to bras_view which will then give the information of the item,
  9. I created a folder system and this piece of code is in a column that list all the folders that have been created by the user. It then is supposed to allow the user to click on the folder name (link) and send it to a page that displays all the items that have been tagged with that folder name. My problem is that it's not clicking through to the page. You can click the link but it just sits there and does nothing. When only 1 folder is created it's fine but if you create more than one folder it just sits there. Any ideas? global $user; $username = $user->name; $listquery = mysql_query("SELECT * FROM folders WHERE username='$username'"); while ($rows = mysql_fetch_array($listquery)) { $id = $rows['ID']; $username = $rows['username']; $foldername = $rows['foldername']; $newfoldername = mysql_real_escape_string($foldername); echo " <script type='text/javascript'> function submitform() { document.myform.submit(); } </script> <form name='myform' action='viewfolder' method='post'> <input type='hidden' name='foldertoview' value='$newfoldername'/> <a href='javascript: submitform()'>$newfoldername</a> </form> <br> "; }
  10. Hey everyone, I'm working on teaching myself php/mysql by build a Content Management System I've got to a certain point which I'm quite proud of but I've hit a bit of a bump. at current my dynamic page urls are "index.php?pid=1" However I would like them to be actual words e.g. "/home-page" "/example-page". I have no idea how to even begin to do this, I've seen a lot of posts about using .htacess and url re-writes but I don't seem to be able to get these to work. Current build menu code in functions.php: // *************************************** // Start Build Menu // *************************************** $sqlCommand = "SELECT id, linklabel, seourl FROM pages WHERE showing='1' ORDER BY pageorder ASC"; $query = mysqli_query($myConnection, $sqlCommand) or die (mysqli_error()); $menuDisplay = ''; while ($row = mysqli_fetch_array($query)) { $pid = $row["id"]; $linklabel = $row["linklabel"]; $seourl = $row["seourl"]; $menuDisplay .= '<a href="index.php?id=' . $pid . '">' . $linklabel . '<a><br .>'; } mysqli_free_result($query); // *************************************** // End Build Menu // *************************************** I have added the extra seourl field into the database so when a new page is created it grabs the page title, removes the spaces and replaces them with - so a page called example page one will turn into example-page-one. However I am completely lost on how to use the seourl to load the content in the page. This is also how I currently pull the content from the database for the page info. // *************************************** // Select Page ID and Content, Keywords/Description // *************************************** if (!$_GET['id']) { $pageid = '1'; } else { $pageid = ereg_replace("[^0-9]", "", $_GET['id']); } $sqlCommand ="SELECT pagebody, description, keywords FROM pages WHERE id='$pageid' LIMIT 1"; $query = mysqli_query($myConnection, $sqlCommand) or die (mysqli_error()); while ($row = mysqli_fetch_array($query)) { $body = $row["pagebody"]; $desc = $row["description"]; $keywords = $row["keywords"]; } mysqli_free_result($query); // *************************************** // Select Page ID and Page Title // ************************************ If anyone has any advice or can point me in the right direction that would be fantastic! Thanks
  11. Hi All, Having a dilema here... I run a games server, its a crap web based game - ill not go into detail. Anyhow, the server URL changes when the server is restarted, this is automatically saved into a text file. I then have a batch file which automatically copies this file onto my web server every 10 minutes. I then have a php page which reads this text file and a couple others. The webpage looks a little like; Server Status online Server Address www.webgame.com etc.etc.... The problem is, the link doesnt display as a clickable link, this is what I am wanting. Its just displayed as plain text, you have to then copy and paste this link into your browser, I would really like the link to just be clickabe. The code I am currently using is; <p align="center" class="style1">Server Location:</p> <p align="center" class="style3"> <?php $filename = "externalurl.txt"; $filehandle = fopen($filename, "r"); $contents = fread($filehandle, filesize($filename)); fclose($filehandle); echo $contents; ?> </p> <br> I basically want the link to display as is, I did try putting the whole thing inside <a href"<CODE>"> this unsurprisingly didnt work. I have seen loads of other help websites etc, these all only show methods of displaying links that have the actual code in the text file, my text file has no code in there, just the actual link - and this cannot be changed. Any help would be greatly apreciated.
  • 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.