MYSQL Php parsing error [closed] - php

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I am unable to figure out the parsing error on this piece of code.
Any help would be greatly appreciated.
echo "<li>";
echo "<a href=\"http://online.somewebsite.com/" . $info['path'] . >" . $info['value'] . "</a>";
echo "</li>";

echo '<li>' . $info['value'] . '</li>';

You forget " before > in second line
echo "<li>";
echo "" . $info['value'] . "";
echo "</li>";

Related

php mysql / link not producing results [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
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.
Closed 7 years ago.
Improve this question
the link within the string is producing the results page just fine. However, no content is being displayed. Here is the string:
echo '<td>' . substr($row['DESCR'], 0, 40) . '</td>';
What could I do in order to get the content to display on the results page? thank You
I've added the new code, and unfortunately now, its not echoing out the string itself
echo '' . substr($row[\'DESCR\'], 0, 40) . '';
is producing a blank page.
You have space issue in the link,
Change
echo '<td>' . substr($row['DESCR'], 0, 40) . '</td>';
To
echo '<td>' . substr($row['DESCR'], 0, 40) . '</td>';

php string two echo statements together [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question appears to be off-topic because it lacks sufficient information to diagnose the problem. Describe your problem in more detail or include a minimal example in the question itself.
Closed 9 years ago.
Improve this question
this string is breaking my code and I am not sure why. If anyone can help me correct it I would appreciate it.
if ($p == $url) { echo '<li><a class="active" href="index.php?p=' . $url . '">'
. $label . '</a></li>'; } else { echo '<li>' . $label . '</li>'; }
htmlspecialchars(urlencode($url)) and htmlspecialchars($label). The rest seems fine.

PHP Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
Could someone correct this code:
echo "<div style="float:right;"><a href='index.php?img1=$img1_id&img2=$img2_id'><img src='$img1_url' /></a></br>Asd: $img1_asd</div>";
echo "<div style="float:right;"><a href='index.php?img1=$img2_id&img2=$img1_id'><img src='$img2_url' /></a></br>Asd: $img1_asd</div>";
I'm getting the error which is specified in the title
Learn Escape Sequence .
echo "<div style=\"float:right;\"><a href='index.php?img1=$img1_id&img2=$img2_id'><img src='$img1_url' /></a></br>Asd: $img1_asd</div>";
echo "<div style=\"float:right;\"><a href='index.php?img1=$img2_id&img2=$img1_id'><img src='$img2_url' /></a></br>Asd: $img1_asd</div>"
echo '<div style="float:right;"><a href="index.php?img1='.$img1_id.'&img2='.$img2_id.'><img src='.$img1_url.' /></a></br>Asd: '.$img1_asd.'</div>';
echo '<div style="float:right;"><a href="index.php?img1='.$img2_id.'&img2='.$img1_id.'><img src='.$img2_url.' /></a></br>Asd: '.$img1_asd.'</div>';
Come on you can do better...
echo "<div style='float:right;'>",
"<a href='index.php?img1=", $img1_id, "&img2=", $img2_id, "'>",
"<img src='", $img1_url, "' />",
"</a><br />",
"Asd: ", $img1_asd",
"</div>";
This even has & correctly escaped to &
Remember, closing void tags is only neccessary for XHTML: <br />
not in HTML4 and HTML5.
This is even wrong³: </br>

add inline style to div tag in php [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
The following code has no problem, I just need to add an inline style as
<div id="nav-menu" style="width:65px;"> to it. I need your help to include that style.
<?php
$pages = array('health.php' => 'Health',
'weightloss.php' => 'Weight Loss',
'fitness.php' => 'Fitness',
'sex.php' => 'Sex',
'mindbody.php' => 'Mind-Body',
'food.php' => 'Food',
'beauty.php' => 'Beauty',
'more.php' => 'More');
echo "<div id=\"nav-menu\">\n";
// let's create a unordered list to display the items
echo "<ul>";
// here's where all the items get printed
foreach ($pages as $Listing) {
echo "<li>$Listing</li>\n";
}
// closing the unordered list
echo "</ul>";
echo "</div>\n";
?>
Do you mean this?
echo "<div id=\"nav-menu\" style=\"width:65px;\">\n";
OR
echo "<div id='nav-menu' style='width:65px;'>\n";
OR
echo '<div id="nav-menu" style="width:65px;">' . "\n";
echo "<div id=\"nav-menu\" style=\"width:65px;\">\n";
echo '<div id="nav-menu" style="width:65px;">';
By default you cannot set a width for a block element like <div>; it takes up the full width of its container.
try: echo "<div id=\"nav-menu\" style=\"width:65px;display:inline-block;\">\n";

Load HTML <select> options while loading the page in php/javascript [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
How to load option dynamically,when we have to load options like eg: 1-500. as the values in select list.
Loding can be either done in php or javascript.
plz can someone provide eg/simple snippet or helpfull links? Thanks!
I tried: Javascript
for(var i=1;i<=500;i++)
{
//create new option
var option = new Option(i, "Value" + i);
//Add the new option it to the select
sel.options[i] = option;
}
Iterate over the values with a foreach, for or while loop, and just ouput whatever you need:
<?php
$html = '<select>';
for ($i=0; $i<500; $i++) {
$html .= '<option value="' . $i . '">Option ' . $i . '</option>';
}
$html .= '</select>';
echo $html;
?>

Categories