I have change the code of my link adder as i want it to go as
* URL
* Description
* Posted By
I have change the line and change some other codes around this is the code
It comes up this error
The line goes to the line i edited:
As you can see the code is long but it goes on one line an i would like it to post and display in the same way.
Please help me
* URL
* Description
* Posted By
I have change the line and change some other codes around this is the code
| Code: |
| <?php
include "style.php"; $filename = 'link.txt'; // edit this function addlink($link_url,$des,$by) { global $filename; $html = "<table border="1" width="293" id="table4"><tr><td align="center" width="94" bgcolor="#7C9CE2">URL:</td><td width="183" bgcolor="#7C9CE2">$link_url</td></tr><tr><td align="center" width="94" bgcolor="#7C9CE2">Description:</td><td width="183" bgcolor="#7C9CE2">$des</td></tr><tr><td align="center" width="94" bgcolor="#7C9CE2">Posted By:</td><td width="183" bgcolor="#7C9CE2">$by</td></tr></table>\n"; $fp = fopen($filename, 'a+'); function logIP($link_url) { $ipLog="log.txt"; // Your logfiles name here (.txt or .html extensions ok) $register_globals = (bool) ini_get('register_gobals'); if ($register_globals) $ip = getenv(REMOTE_ADDR); else $ip = $_SERVER['REMOTE_ADDR']; $date=date ("l dS of F Y h:i:s A"); $log=fopen("$ipLog", "a+"); if (preg_match("/\bhtm\b/i", $ipLog) || preg_match("/\bhtml\b/i", $ipLog)) { fputs($log, "IP: $ip - Link added: $link_url <br>"); } else fputs($log, "IP: $ip - Link added: $link_url \n"); fclose($log); } // Place the below function call wherever you want the script to fire. logIp($link_url); fputs($fp, $html) or die("Could not open file!"); echo 'The link was added successfully.<br><br>'; } function showlinks() { global $filename; $html = implode('<br/>',array_reverse(file($filename))); echo $html; } If (!$link_url){ print "You must enter a Link Address"; } elseif (!$by){ print "You must enter your Username"; } elseif (!$des){ print "You must enter a website description"; } else { addlink($link_url,$des,$by); print "<b>Existing Links</b>:<br>"; // adds new link showlinks(); // display's list of links } ?> |
It comes up this error
| Code: |
| Parse error: parse error, unexpected T_LNUMBER in myurl.com/links/add.php on line 38 |
The line goes to the line i edited:
| Code: |
| $html = "<table border="1" width="293" id="table4"><tr><td align="center" width="94" bgcolor="#7C9CE2">URL:</td><td width="183" bgcolor="#7C9CE2">$link_url</td></tr><tr><td align="center" width="94" bgcolor="#7C9CE2">Description:</td><td width="183" bgcolor="#7C9CE2">$des</td></tr><tr><td align="center" width="94" bgcolor="#7C9CE2">Posted By:</td><td width="183" bgcolor="#7C9CE2">$by</td></tr></table>\n"; |
As you can see the code is long but it goes on one line an i would like it to post and display in the same way.
Please help me
