Jump to content

iarp

Members
  • Posts

    326
  • Joined

  • Last visited

Everything posted by iarp

  1. The code below... what i'm after is if someone inputs [ url=http://www.google.ca][/ url] without anything in between opening and ending, to have the url http://www.google.ca show up in between there automatically. <?php function codeChanger($msg){ $replace = array ( '/(\[b\])(.*)(\[\/b\])/i', '/(\[i\])(.*)(\[\/i\])/i', '/(\[u\])(.*)(\[\/u\])/i', '/(\[img=)(.*?)(\])/i', '/(\[url=)(.*?)(\])(.*?)(\[\/url\])/i', '/(\[php\])(.*)(\[\/php\])/i', '/(\[file=)(.*?)(\])(.*?)(\[\/file\])/i' ); $replacements = array ( '<strong>$2</strong>', '<em>$2</em>', '<u>$2</u>', '<img src="$2"></img>', '<a href="$2">' . if(empty('$4')) '$4'; else '$2'; . '</a>', '<div class="codePHP">$2</div>', '<a href="/?file=$2">$4</a>', ); return(preg_replace($replace, $replacements, $msg)); } I've tried <?php '<a href="$2">' . if(empty('$4')) '$4'; else '$2'; . '</a>', ?> Followed immediatly by... As well: <?php #this will be parsed just fine through the above function [b]stuff here[/b] # but if i break the line and have: [b] stuff here [/b] # the [b] doesn't get parsed[/b]
  2. shouldn't \n\n work? <br> won't be processed in <textarea>
  3. <hr> might be what your after. Edit: i did misread that, the answers in phil88's reply.
  4. Whats the contents of header.php? And how are you including connect.php?
  5. I'm weiry about this addon. One of my scripts that only i can access as a test-bed application has 0 protection and the addon reports everythings fine. I tweaked the script so that at least 1 item should fail and trip some type of warning but it reported pass as well. So eithor its a bad addon or i unno whatelse.
  6. <?php while ($pitch = mysql_fetch_array ($pitches)) { echo "<tr valign = 'top'>\n"; $id = $pitch['pitchid']; $pitchname = htmlspecialchars($pitch['pitchname']); $pitchtext = htmlspecialchars($pitch['pitch']); $userid = ($pitch['userid']); // Removed &#160; &#160; echo "<td> $pitchname</td>\n"; echo "<td> $pitchtext</td>\n"; echo "<td>" $q1 = "SELECT firstname, email FROM users WHERE userid = '" . $userid . "'"; $r1 = mysql_query($q1); $row1 = mysql_fetch_array($r1, MYSQL_NUM); echo "<a href=\"mailto:" . $row1['1'] . "\">" . $row1['0'] . "</a>"; echo "</td>\n"; } ?>
  7. Try this change.... <?php while ($pitch = mysql_fetch_array ($pitches)) { echo "<tr valign = 'top'>\n"; $id = $pitch['pitchid']; $pitchname = htmlspecialchars($pitch['pitchname']); $pitchtext = htmlspecialchars($pitch['pitch']); $userid = ($pitch['userid']); echo "<td> $pitchname</td>\n"; echo "<td> $pitchtext</td>\n"; echo "<td> $userid</td>\n"; } ?> to <?php while ($pitch = mysql_fetch_array ($pitches)) { echo "<tr valign = 'top'>\n"; $id = $pitch['pitchid']; $pitchname = htmlspecialchars($pitch['pitchname']); $pitchtext = htmlspecialchars($pitch['pitch']); $userid = ($pitch['userid']); echo "<td> $pitchname</td>\n"; echo "<td> $pitchtext</td>\n"; echo "<td>" $q1 = "SELECT firstname, email FROM users WHERE userid = '" . $userid . "'"; $r1 = mysql_query($q1); $row1 = mysql_fetch_array($r1, MYSQL_NUM); echo "<a href=\"mailto:" . $row1['1'] . "\">" . $row1['0'] . "</a>"; echo "</td>\n"; } ?> Because i cant test it, there might an be error, sometimes i get confused with quotes and blackslashes and crap.
  8. I have IE8 on one of my machines Version: 8.0.6001.18702 Everything works and looks just fine.
  9. The username and password will have been set by your hosting provider and you'll need to get into contact with them for the info.
  10. Have you tried closing and reopening php tags? <?php // php here ?> <script language="javascript"> var WinNetwork = new ActiveXObject("WScript.Network"); var empID = WinNetwork.UserName; alert(empID) </script> <?php // more php here ?>
  11. I don't know the technical words for it. But basically you original statement was <?php $where .= " AND pitch LIKE '%searchpitch%'"; ?> and that searchs for whatevers between the % signs. The new one is: <?php $where .= " AND pitch LIKE '%" . $searchpitch . "%'"; ?> Adding the first " breaks the line and . concatenates the next item which was $searchpitch which you defined earlier another . concatenates again and then " reopens the string to finish it.
  12. It's telling you it can't find the file, and if the url used in the queyr there (http://www.theliverhearts.com/audio/02%20Local%20Lift.mp3). The link doesn't work to http://www.theliverhearts.com/audio/02%20Local%20Lift.mp3 Mybad, read that too fast and missed the error handling part.
  13. Look at my last reply, the code section has that fix.
  14. Remove the "AND pitchid=pitchid " clause (both of them) and try it again. Also: <?php $searchpitchname = $_POST['searchpitchname']; if($searchpitchname !='') { //a pitch name was entered $where .= " AND pitchname LIKE '%" . $searchpitchname . "%'"; } $searchpitch = $_POST['searchpitch']; if($searchpitch !='') { //something was entered in the pitch $where .= " AND pitch LIKE '%" . $searchpitch . "%'"; } ?>
  15. Hey there, Is there anyway to encrypt data put into a database and decrypt it when shown to the user using a key stored in another table(for that user)?
  16. SELECT * FROM names, labels WHERE names.name_id=labels.label_id .... etc to my understanding one could rewrite that like SELECT * FROM names LEFT JOIN labels ON names.name_id=labels.label_id It just seems redundant to me to bother having such a function LEFT JOIN when the first query above is shorter. Reguarding old thread: Made a mistake, wasn't thinking before i posted that this is mysql only.
  17. You could try todo that with div's but then you'd only end up with more then double the coding and trouble of changing everything, and testing. I'd say your best bet, and easiest is to stick with tables. Less coding and all browsers(to my knowledge) are fully compatible with html tables.
  18. Try <?php ini_set("display_errors", "0"); ?>
  19. >.< All because of one line <script type="text/javascript" src="/themes/flow/js/required.js"></script> <!-- Doesn't like the non-direct link -->
  20. I'm trying to get a page from my domain iarp.ca to show on a friends subdomain xabbu.net. At first i tried this code on moha.xabbu.net: <?php require_once('http://beta.iarp.ca/moha/'); ?> But that only resulted in a blank white page, and if you clicked CTRL+U to see the source code you ended up seeing the entire document source code but not the result. http://beta.iarp.ca/moha/ should be the visible result but as you can see on http://moha.xabbu.net it's completely blank and yet the source code is all there. I tried this code with the same effect as above: <?php $homepage = file_get_contents('http://beta.iarp.ca/moha/'); echo $homepage; ?> As taken from the php.net link in the first reply.
  21. I have this code in an index.php file on a friends server (http://moha.xabbu.net) <?php require_once('http://beta.iarp.ca/moha/'); # My server ?> For some reason, whenever we view the page it's completely blank. If you look at the source code the entire page(on xabbu) is there. No clue why tho, any hints?
  22. I'm trying to find out how to determine which version of php and potentially mysql later on down the road. To determine which script to use to install and use during an installation script.
  23. On the same idea, what about if you didn't know how many sub directories there were? Anyway to just scan the dir and get everything?
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.