image src (url) not working [closed] - php

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 5 years ago.
Improve this question
I have image tag like below
<img src="www.example.com/imgs/file.jpg" />
but this is not working and when i look at page src i see
<img src="site1/std/www.example.com/imgs/file.jpg" />
i tried to escape the two dirs by adding
<img src="../../www.example.com/imgs/file.jpg" />
but this just give me :
<img src="../../site1/std/www.example.com/imgs/file.jpg" />
what's wrong with my code???

If the image is located on the server where your script is, then you can use
<img src="imgs/file.jpg" />
If its on an external site, then you need to use the full link, like so
<img src="http://www.example.com/imgs/file.jpg" />

Related

Get all uploaded files [closed]

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 7 years ago.
Improve this question
I'm uploading several files and I need to process all of them. But they have "unknown" names back in the form and simple foreach is not working.
<input type="file" name="somethingIDontKnow">
<input type="file" name="somethingIDontKnowAgain">
...
I need to know the name parameters of inputs. Can I get them somehow?
Oh, I forgot to add enctype="multipart/form-data" parameter to <form> so I didn't get any files. It's ok now.

Can not view images with spaces in its name [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed 8 years ago.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Improve this question
i cant view images with spaces in its name ex: Google Twitter.JPG is not loading and its name is changed to Google%20Twitter.JPG after the PHP echo method .
<image width=150px height = 100px src="upload/profiles/<?php echo trim($image); ?> >
You have an error in your markup.
Change <image width=150px...
to
<img width=150px...
This is a requirement in W3 Standards
From http://www.w3schools.com/tags/ref_urlencode.asp :
URLs cannot contain spaces. URL encoding normally replaces a space with a plus (+) sign or with %20.
You should rename your images, and replace the spaces with either dashes - or underscores _
As pointed out in comments, you are missing a quote, and have some errors in your line. image should be img and your height and width attributes should be in quotes with no spaces.
<img width="150px" height="100px" src="upload/profiles/<?php echo trim($image);?>" />

HTML PHP if else statement [closed]

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 8 years ago.
Improve this question
I have the following part of code inside my HTML body tag:
<?php if(1==2) { ?>
<a class="demage" href="xxxx.html">demage</a>
<a class="history" href="xxxx.html">history</a>
<?php } else { ?>
<a class="Sign In" href="login_page.html">Sign In</a>
<a class="Sign Up" href="register_page.html">Sign Up</a>
<?php } ?>
but it displays the 4 links in a row, not the last two as it is supposed to. What is wrong with the code?
Answered in comments, collective effort.
By default PHP will only evaluate/parse files containing PHP with the extension
.php
I don't see any error in the code the code is running as expected. (See the image attached.)
May be there's some problem with your php.

php tags not working. what is diference between php tags <php and <? [closed]

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 8 years ago.
Improve this question
First code is fine but textfield give back all php tag
<td><?php print($code_verification);?>
<input type="text" name="packaging_code" id="packaging_code" value="<?=$code_verification?>" />
Change:
value="<?=$code_verification?>"
to:
value="<?php echo $code_verification; ?>"
The first line would work if your server had short_open_tags enabled.
your first code will work if you enable short tags.otherwise you can try below code
<input type="text" name="packaging_code" id="packaging_code" value="<?php echo $code_verification; ?>" />

Hyperlinks appear as links but not clickable [closed]

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 5 months ago.
Improve this question
I have been trying to send out emails from my server using PHP but the hyperlinks in email are not clickable.
They appear blue just like normal links but they are not linked.
This is what I have:
$subject = "Email subject";
$l="http://www.example.com/Oa7dl";
$txt="<a href'$l' target='_blank' title='CLICK HERE TO LEARN MORE AND APPLY'><img src='http://www.example.com/pics/click_here.png' alt='CLICK HERE TO LEARN MORE AND APPLY' /></a> or FOLLOW LINK: <a href'$l' target='_blank'>http://example.com/Oa7dl</a>";
This will be sent as a body of an email message.
<a href='$l' not <a href'$l'
You missed the =
Subtituting variable for its value would result in :
href'http://www.goo.gl/Oa7dl'
This means you are missing a = after href. It should be:
href='http://www.goo.gl/Oa7dl' or href='$l'

Categories