Honestly I have no idea. Clearly some part of the process, unknown to us, is doing something odd. All I can say is double check all the code and be sure that it isn't like that in the database. Can you export/backup the db and go trough it manually?
Honestly I have no idea. Clearly some part of the process, unknown to us, is doing something odd. All I can say is double check all the code and be sure that it isn't like that in the database. Can you export/backup the db and go trough it manually?
Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum
I am Abby (08-25-2010)
It looks correct in the database.
Well thanks for your time anyway![]()
In your source code, are the backslashes present before the doublequotes (\"
)?
If something (some kind of server configuration, most likely) is automatically adding a base url to your links, it probably looks for href attributes that seem to be internal. The slashes (which shouldn't be there) might be interfering with that check...
Maybe. ( ??? )
Try running stripslashes() on the url the database returns and see if helps.
Also try adding an external url (PHP Code:
while($r = mysql_fetch_assoc($q)) {
// try it here - I think that'll catch it
stripslashes($r);
print_r($r);
}
<a href="http://www.othersite.com">external</a>
) directly into your html and see if the base url is added or not.
You could also contact your service provider and see if there is someway to turn that "feature" off.
one of my friends said because the urls in the source code has slashes
I should do a remove slashes...so I triedCode:<a href=\"http://page.com\">link</a>
and that didn't remove them.Code:// Make a MySQL Connection mysql_connect("xxx.xxx.xxx.xx", "login", "password") or die(mysql_error()); mysql_select_db("nlchdb") or die(mysql_error()); // Retrieve all the data from the "webcalendar_events" table $result = mysql_query("SELECT * FROM webcalendar_events WHERE dt >= now() AND color='ffff00' ORDER BY dt") or die(mysql_error()); while($row = mysql_fetch_array($result, MYSQL_ASSOC)) { //remove code we don't need to see for this. <snip>---</snip> list($year, $month, $day) = split('[/.-]', $row['dt']); $month = $monthnames[$month]; $str = stripslashes($row['description']; echo "<p><strong>{$month} {$day}, {$year}</strong><br />". "Decription: {$str}</p>";
So I came back here and saw your post and tried...
Again it did not take the slashes out...is there another way to do it?Code:// Make a MySQL Connection mysql_connect("xxx.xxx.xxx.xx", "login", "password") or die(mysql_error()); mysql_select_db("nlchdb") or die(mysql_error()); // Retrieve all the data from the "webcalendar_events" table $result = mysql_query("SELECT * FROM webcalendar_events WHERE dt >= now() AND color='ffff00' ORDER BY dt") or die(mysql_error()); while($row = mysql_fetch_array($result, MYSQL_ASSOC)) { stripslashes($row); //remove code we don't need to see for this. <snip>---</snip> list($year, $month, $day) = split('[/.-]', $row['dt']); $month = $monthnames[$month]; echo "<p><strong>{$month} {$day}, {$year}</strong><br />". "Decription: {$row['description']}</p>";
I not only puton the page I also placed<a href="http://www.othersite.com">external</a>
within the code tags...both worked correctly.echo "<a href=\"http://www.othersite.com\">external</a>";
Last edited by I am Abby; 08-25-2010 at 03:34 PM.
You might try stripslashes() in the individual entry that holds the link - I just noticed that $r is the entire row. Trystripslahes($r['link'])
(or whatever the column that holds the link is called).
If you write a normal external link directly in your html, do you still get this problem? or is it limited to the links this script is generating?
I am Abby (08-25-2010)
The above gave me an errorCode:<snip> list($year, $month, $day) = split('[/.-]', $row['dt']); $month = $monthnames[$month]; echo "<p><strong>{$month} {$day}, {$year}</strong><br />". "Decription: {stripslahes($row['description'])}</p>"; }
Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING
I tried that earlier and it's the reason I tried
which did not remove the slashesCode:<snip> $str = stripslashes($row['description']; echo "<p><strong>{$month} {$day}, {$year}</strong><br />". "Decription: {$str}</p>";
It worked.
Thanks Boys![]()
Bookmarks