Help with php and this part of the code ?

  • PHP
  • Thread starter pattersonz
  • Start date
  • Tags
    Code Php
In summary, the person is seeking assistance in making a clickable link in their code. They have many layouts and want to add more, but it is difficult to go through 49 pages to add just one. They have already submitted the problem to a web design company but have not received a solution. The code includes an image and text with multiple links and invalid HTML, making the question ambiguous. The person is urged to provide more information for a clearer understanding.
  • #1
pattersonz
1
0
Ok here is the code below, I need to know what I need to change in this code for it to be able to be a clickable link... I have many layouts and want to add more but with so many pages, its a bit hard to go through 49 pages just to add one page. I already submitted this problem to web design company but have yet to get any solution. So here is the code. I hope someone can help me!

<img src="[PLAIN][PLAIN]http://<?php [Broken][/PLAIN] [Broken][/PLAIN] [Broken][/PLAIN] [Broken][/PLAIN] [Broken] echo $img_url . "/" . $imgpath . $file; ?>" alt="<?php echo $file; ?>" width="250" ><br>
<textarea name="textarea2" cols=23 rows=7 onClick="this.focus();this.sel...
<a href="[PLAIN][PLAIN]http://<?php [Broken][/PLAIN] [Broken][/PLAIN] [Broken][/PLAIN] [Broken][/PLAIN] [Broken] echo $site_url; ?>" target="_blank" title="<?php echo $urlpath . $file; ?>">
<img src="[PLAIN][PLAIN]http://<?php [Broken][/PLAIN] [Broken][/PLAIN] [Broken][/PLAIN] [Broken][/PLAIN] [Broken] echo $img_url . "/" . $imgpath . $file; ?>" border="0" alt="<?php echo $urlpath . $file; ?>"></a>
<?php if ($support_image != "") { ?>
<img src="[PLAIN][PLAIN]http://<?php [Broken][/PLAIN] [Broken][/PLAIN] [Broken][/PLAIN] [Broken][/PLAIN] [Broken] echo $support_image; ?>" alt="Myspace Editors" style="position:absolute; left:0px; top: 0px;" border="0"></a>
<?php } ?>
<a href="[PLAIN][PLAIN]http://<?php [Broken][/PLAIN] [Broken][/PLAIN] [Broken][/PLAIN] [Broken][/PLAIN] [Broken] echo $site_url; ?>/" target="_blank" title="Myspace Images">This image is from <?php echo $site_name; ?></a></center></textarea>
 
Last edited by a moderator:
Technology news on Phys.org
  • #2
If possible post the html generated by your php page, or a link. I see multiple links, invalid HTML (i.e. this.sel...) and only a sub portion of the HTML document, etc.
All of this makes your question fairly ambiguous. Why don't you provide as much information as you can, it's very frustrating otherwise.
 
  • #3


To make the code above into a clickable link, you will need to add the <a> tag around the <img> tag. This will create a link around the image that can be clicked on. Additionally, you will need to add the "href" attribute to the <a> tag and insert the desired URL as the value. For example:

<a href="http://www.example.com"><img src="http://<?php echo $img_url . "/" . $imgpath . $file; ?>" alt="<?php echo $file; ?>" width="250"></a>

You can also add a title attribute to the <a> tag to provide a tooltip for the link. You can use the same code as the alt attribute for the image or customize it as desired.

It's important to note that the code provided is incomplete and may require further modifications depending on the specific layout and functionality of your website. If you are not comfortable making changes to the code yourself, it would be best to reach out to a web design company or a developer for assistance.
 

1. What is PHP and why do I need it for this code?

PHP is a server-side scripting language used for creating dynamic and interactive web pages. It is necessary for this code because it allows you to process and manipulate data on the server before sending it to the client's browser.

2. How do I fix errors in my PHP code?

The first step is to carefully read the error message and identify the line of code where the error is occurring. Then, check for syntax errors or missing semicolons. You can also use online resources or consult with other developers for help in troubleshooting errors.

3. Can I use HTML and PHP together?

Yes, HTML and PHP can be used together to create dynamic web pages. You can embed PHP code within HTML tags to execute server-side scripts and generate dynamic content.

4. How can I protect my PHP code from being viewed or stolen?

You can protect your PHP code by using encryption techniques or by storing it on a secure server. You can also use obfuscation methods to make it more difficult for others to understand and copy your code.

5. Are there any resources or tutorials available for learning PHP?

Yes, there are numerous online resources, tutorials, and courses available for learning PHP. Some popular ones include W3Schools, PHP.net, and Codeacademy. You can also join online communities or forums to connect with other PHP developers and learn from their experiences.

Similar threads

  • Programming and Computer Science
Replies
6
Views
5K
  • Programming and Computer Science
Replies
7
Views
5K
  • Programming and Computer Science
Replies
6
Views
3K
Replies
2
Views
2K
  • Programming and Computer Science
Replies
7
Views
3K
  • Classical Physics
Replies
13
Views
1K
  • Programming and Computer Science
Replies
2
Views
4K
  • Calculus and Beyond Homework Help
Replies
1
Views
1K
  • Calculus and Beyond Homework Help
Replies
3
Views
1K
  • Programming and Computer Science
Replies
2
Views
4K
Back
Top