PHP - Need To Grab Value From Array Output
Hi,I
I'm trying to setup Paypal Pro on a website - have everything working - but need to grab the 4th & 6th key values from the results given from the Paypal response and having difficulty with the task.
See the code that prints the response and the response sent from Paypal below - I need to grab the values for [TRXRESULT] and [TRXRESPMSG]
echo('<pre>'); print_r($PayFlow->getResponse()); echo('</pre>');and here's the response I get from Paypal on script execution - this is an example of a failed transaction: Paypal Response Array ( [RESULT] => 36 [RPREF] => RPC5B24581A2 [RESPMSG] => Transaction failed: Fail to obtain approval for the online transaction [TRXRESULT] => 23 [TRXPNREF] => EUJPC36F2092 [TRXRESPMSG] => Invalid account number: Unsupported Credit Card type )Again, I want to grab the values from [TRXRESULT] and [TRXRESPMSG] and assign them to local variables so i can work with them within the local php script. Example: $trxresult and $trxrespmsg Here's part of the class (file name is Class.Payflow.php find on Github) that pertains to this snippet of code in question: Class.Payflow.php /** * @uses Gets the response from Paypal. * @access Public * @param None. * @return Array/String - Returns an array of Paypal's response or empty string if not return. * @example $PayFlow->getResponse(); */ public function getResponse() { if($this->response) { return $this->response; } else { return ''; } }Thanks in advance for help w/this one! Similar TutorialsHi Everyone I am looking to just grab the first element of an array and do something to it but i only want this extra bit off code on the first value off the array. Here is my array echo "<pre>"; print_r($_SESSION); echo "</pre>"; Array ( [attach] => Array ( ) [backups-2] => true [dnb] => true [house] => true [tech-house] => true [uk-garage] => true [uk-grime] => true [uk-hip-hop] => true [uncategorized] => true [warehouse] => true [value] => Array ( [0] => Array ( [tune_name] => Music/dnb/Abort_Delta Heavy_192.mp3 [tune] => http://isdmusic.s3.amazonaws.com/Music/dnb/Abort_Delta Heavy_192.mp3 [submit] => Listen ) [1] => Array ( [tune_name] => Music/dnb/Acid Bath (Northern Lights remix)_Twisted Individual_192.mp3 [tune] => http://isdmusic.s3.amazonaws.com/Music/dnb/Acid Bath (Northern Lights remix)_Twisted Individual_192.mp3 [submit] => Listen ) [2] => Array ( [tune_name] => Music/dnb/Awkward_Inside Info_192.mp3 [tune] => http://isdmusic.s3.amazonaws.com/Music/dnb/Awkward_Inside Info_192.mp3 [submit] => Listen ) [3] => Array ( [tune_name] => Music/dnb/Awkward_Inside Info_192.mp3 [tune] => http://isdmusic.s3.amazonaws.com/Music/dnb/Awkward_Inside Info_192.mp3 [submit] => Listen ) ) ) so i just what to effect the first value what to and autostart to it??? Here is my code. session_start(); header("Content-type: text/xml"); $xml_output = "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n"; $xml_output .= '<playlist version="1" xmlns="http://xspf.org/ns/0/">\n'; $xml_output .= "<trackList>\n"; $xml_output .= "\t<track>\n"; $xml_output .= "\t\t<location>" . $_SESSION['value'][0]['tune_name'] . "</location>\n"; $xml_output .= "\t\t<creator>sdf</creator>\n"; $xml_output .= "\t\t<album>sdf</album>\n"; $xml_output .= "\t\t<title>" . $_SESSION['value'][0]['tune_name'] . "</title>\n"; $xml_output .= "\t\t<annotation>I love this song</annotation>\n"; $xml_output .= "\t\t<duration>32000</duration>\n"; $xml_output .= "\t\t<image>covers/smetana.jpg</image>\n"; $xml_output .= "\t\t<info></info>\n"; $xml_output .= "\t\t<link>" . $furl . "</link>\n"; $xml_output .= "\t</track>\n"; foreach ($_SESSION['value'] as $value) { $furl = "http://isdmusic.s3.amazonaws.com/".urlencode($value['tune_name']); if(preg_match("/\.mp3$/i", $furl)) { $xml_output .= "\t<track>\n"; $xml_output .= "\t\t<location>" . $furl . "</location>\n"; $xml_output .= "\t\t<creator>" . $value['tune_name'] . "</creator>\n"; $xml_output .= "\t\t<album>" . $value['tune_name'] . "</album>\n"; $xml_output .= "\t\t<title>" . $value['tune_name'] . "</title>\n"; $xml_output .= "\t\t<annotation>I love this song</annotation>\n"; $xml_output .= "\t\t<duration>32000</duration>\n"; $xml_output .= "\t\t<image>covers/smetana.jpg</image>\n"; $xml_output .= "\t\t<info></info>\n"; $xml_output .= "\t\t<link>" . $furl . "</link>\n"; $xml_output .= "\t</track>\n"; } } $xml_output .= "</trackList>"; echo $xml_output; Thanks Hello all, I have yet again trouble finding a logical solution to my problem. I'm fetching an array which can hold 1 or more values. The problem is, I want these values to ouput in my json_encode function, but this also needs to happen dynamically depending on the amount of values. I can't explain it further, so here's the code so far: Code: (php) [Select] $files = mysql_fetch_array($get_files); $a = count($files); $i = 1; while ($files) { $variablename = 'fileName' . $i; $$variablename = $files['fileName']; $i++; } $output = array( OTHER VALUES , 'fileName1' => $fileName1, 'fileName2' => $fileName2, 'fileName3' => $fileName3, ............); // How do I add the fileNames dynamically depending on how many there are? This got me thinking, I also need to dynamically GET the values with jQuery. How would I do that, when the above eventually works? Thank you. Hi all I am having massive problems comparing the out put of array, basically my end result is to choose a selected option on a drop down in a form. I am trying to compare the output of ['allow-nether'] which is either true or false in my file. Here is what I have tried //code to get file contents Code: [Select] $file_handle = fopen("saves/server.properties", "rb"); $vars = array(); while (!feof($file_handle) ) { $line_of_text = fgets($file_handle); $parts = explode('=', $line_of_text); //if date not required if ( !isset($parts[1]) ) { continue; } $vars[$parts[0]] = $parts[1]; } Code: [Select] <?php //allow nether =false in file echo "1 " .$vars['allow-nether']; if ( $vars['allow-nether'] == true ) { echo '<br>2 selected="selected"';} if ( $vars['allow-nether'] == false ) { echo '<br>3 selected="selected"';} if ( $vars['allow-nether'] == "true" ) { echo '<br>4 selected="selected"';} if ( $vars['allow-nether'] == "false" ) { echo '<br>5 selected="selected"';} if ( $vars['allow-nether'] === true ) { echo '<br>6 selected="selected"';} if ( $vars['allow-nether'] === false ) { echo '<br>7 selected="selected"';} if ( $vars['allow-nether'] === "true" ) { echo '<br>8 selected="selected"';} if ( $vars['allow-nether'] === "false" ) { echo '<br>9 selected="selected"';} ?> which outputs: Code: [Select] 1 false 2 selected="selected" and if I set the file to allow-nether=true Code: [Select] <?php //allow nether =true in file echo "1 " .$vars['allow-nether']; if ( $vars['allow-nether'] == true ) { echo '<br>2 selected="selected"';} if ( $vars['allow-nether'] == false ) { echo '<br>3 selected="selected"';} if ( $vars['allow-nether'] == "true" ) { echo '<br>4 selected="selected"';} if ( $vars['allow-nether'] == "false" ) { echo '<br>5 selected="selected"';} if ( $vars['allow-nether'] === true ) { echo '<br>6 selected="selected"';} if ( $vars['allow-nether'] === false ) { echo '<br>7 selected="selected"';} if ( $vars['allow-nether'] === "true" ) { echo '<br>8 selected="selected"';} if ( $vars['allow-nether'] === "false" ) { echo '<br>9 selected="selected"';} ?> Gives: Code: [Select] 1 true 2 selected="selected" What am I doing wrong? I have an array and I would like to insert commas and the word 'and' to make a sentence using an array. For example... $sports = array(baseball, soccer, tennis); Ted played baseball, soccer and tennis or Ted played baseball, soccer, boxing and tennis What's the best way to do this? I'm kind of a beginner, but I really need this script and I'm not sure how quite to do it as needed... With some html forms I need it so you can type a name in then click submit, then (with php) it will save that text into a text file or something. Later, when I hit a different button it will randomly display one of those texts/names from before. Hi all What I am trying to achieve is a for each loop for the following output Code: [Select] Array ( [result] => success [source] => getDirectory [success] => Array ( [0] => /root/mc/world/data/ [1] => /root/mc/world/level.dat [2] => /root/mc/world/level.dat_old [3] => /root/mc/world/players/ [4] => /root/mc/world/players/herghost.dat [5] => /root/mc/world/region/ [6] => /root/mc/world/region/r.-1.0.mcr [7] => /root/mc/world/region/r.0.0.mcr [8] => /root/mc/world/session.lock [9] => /root/mc/world/uid.dat ) ) How would I go about saving each path from the [success] output? Basically I wish to loop through the array and delete the files. Many Thanks The below is outputting: Array Fatal error: Unsupported operand types in /home/zyquo/public_html/area51entertainment.co/maintenance/home.php on line 28 So clearly $project_row_num is coming out as an array, and the multiplication is failing because its got a string not a number. I just don't see why it's getting an array out of $project_row_num. <?php $num_projects=15; $scroller_projects=""; require_once 'db_select.php'; $project_query_num="SELECT COUNT(*) FROM $tbl_name"; $project_result_num=mysql_query($project_query_num); $project_row_num=mysql_fetch_assoc($project_result_num); echo $project_row_num; //if($project_row_num <= $num_projects){ $project_query="SELECT * FROM $tbl_name"; $project_result=mysql_query($project_query); /*} else{ $project_query="SELECT * FROM $tbl_name WHERE project_release_date BETWEEN $start_date AND $end_date LIMIT 0,$num_projects"; $project_result=mysql_query($project_query); }*/ $i=1; while($project_row=mysql_fetch_array($project_result)){ extract($project_row); $scroller_projects.='<div class="project_entry" tabindex="'.$i.'" onclick="sndReq(\''.$project_id.'\');">Test</div>'; $i++; } if($project_row_num==""){ $films_row_num=$num_projects; } $scroller_width=$project_row_num*114; $content=' <div class="video_scroller_wrapper"> <div class="video" id="tabs"> </div> <div class="recentfilms_wrapper"> <div class="left_arrow"><img src="arrow_left.png" alt="Left" title="" class="arrow_left" onclick="jumpLeft(\'recentfilms\')" onmouseover="startScrollLeft(\'recentfilms\')" onmouseout="stopScroll()" /></div> <div id="recentfilms"> <div id="scroller" style="width: '.$scroller_width.'px;"> '.$scroller_projects.' </div> </div> <div class="right_arrow"><img src="arrow_right.png" alt="Left" title="" class="arrow_right" onclick="jumpRight(\'recentfilms\')" onmouseover="startScrollRight(\'recentfilms\')" onmouseout="stopScroll()" /></div> </div> </div> <div class="news_wrapper"> <div class="news"> <div class="news_title"><span class="category_title_text">Latest News</span></div> <div class="news_text"> <iframe src="http://www.indiegogo.com/project/widget/75876?a=9030" style="width: 224px; height: 429px; position: relative; left: 3px; top: 15px; border: 0px; overflow: hidden;"></iframe> </div> </div> </div> '; ?> I have a function which finds a list of companies associated with a country from a custom taxonomy. It finds their logo and creates an output which is all logos associated with a country, and the logo has a href to link to a company page. The code for this is: function countryCompanies(){ global $post;
$echo = f_print(array(
The f_print function finds the logos, and their sizes. So the 'mainlogo' type is a pull down of the thumbnail at 200px size.
What I need to do is write CSS and PHP which will display these results in a grid, 4 colums across, and as many down as results from the array. At the moment all I can get is all the results in one column. What tutorials would I need to write appropriate CSS to create this, and then is it as simple as adding the div prior to the echo of the $echo variable? Thanks I came up with this but it outputs the value 3 times... (because there are 3 variables) ie mathsmathsmaths How do I fix this or do it the correct way? Thanks Code: [Select] $subject = "maths"; $phone = "1235"; $colour = "red"; $all_vars = compact("subject", "phone", "colour"); get_value($subject); function get_value($variable){ global $all_vars; foreach($all_vars as $key=>$value){ if ($key = $variable) { echo $key; } } } Hi, got a problem with my arrays, every string gets duplicated 11 times instead of just one time. How to fix this? Here is my function which almost works as expected: <?php function find_value($array,$value) { for($i=1;$i<sizeof($array);$i++) { if($array[$i] == $value) { echo "$i . $array[$i]<br />"; return; } } } ?> And I call the function like so: <?php $names = array('Jason','Mike','Joe'); $name = 'Joe'; find_value($names,$name); ?> And the output is: 2 . Joe According to my understanding of Arrays, Joe would be index 3 BECAUSE my counter starts at 1 in my for loop??? Why is the result like this? What am I not understanding here? Hi the above title explains it all.How to output a post array which has been given input using forms.I know you can do it my echo but what about print() Thanks I have this code Code: [Select] $nArr = array('A', 'B', 'C', 'D', 'E', 'F'); $counter = 3; while ($counter > 0) { $chunkedValues[$counter][0] = 1; for ($j = 0 ; $j < $counter ; $j++) { $chunkedValues[$counter][$j + 1] = $nArr[$j]; } $nArr = array_slice($nArr, $counter--); } var_dump($chunkedValues); that outputs: Code: [Select] array 3 => array 0 => int 1 1 => string 'A' (length=1) 2 => string 'B' (length=1) 3 => string 'C' (length=1) 2 => array 0 => int 1 1 => string 'D' (length=1) 2 => string 'E' (length=1) 1 => array 0 => int 1 1 => string 'F' (length=1) But i need this index structu Code: [Select] array 0 => array 0 => int 1 1 => string 'A' (length=1) 2 => string 'B' (length=1) 3 => string 'C' (length=1) 1 => array 1 => int 1 2 => string 'D' (length=1) 3 => string 'E' (length=1) 2 => array 2 => int 1 3 => string 'F' (length=1) I want to avoid loops with ceil. Any idea? thanks for your time. I'm trying to create a website, that echo's out a bunch of groups, where each group contains a group of checkboxes, containing A value, and a label for the checkbox, the way it is created right now, is foreach that echo's out a bunch of php arrays, which was easier than the static way before - But still, it's static in some way, or not very user friendly at the moment.. My problem is that I really want to write it in a database when I have the option. Is there anyone that can give some tips how to do? At the moment, my foreach looks like this: Code: [Select] echo '<form method="post" action="'.$_SERVER['PHP_SELF'].'">'; /* NEXT WE CREATE OUR FOREACH LOOPS TO ECHO THE HTML FOR LOOKS AND CHECKBOXES */ $totalID=0; // this is a counter we use to build our check box names foreach ($items as $list){ $totalID++; // add one to the checkbox name counter echo "<h2>{$list['title']}</h2>\n"; // and echo out our section header foreach ($list['items'] as $cbox){ // now for each item in the list, call it $cbox // $cbox now holds the item name, and point value echo "<label class='checkbox'><input type='checkbox' name='totals[$totalID][]' value='{$cbox[1]}'> {$cbox[0]}</label>\n"; } } echo "</form>"; And my array is something like this: Code: [Select] $items['computers']['title']='Computer Brand'; $items['computers']['items'][]=array('Apple iMac',1); $items['computers']['items'][]=array('Apple Macbook',.5); $items['phones']['title']='Phone Brand'; $items['phones']['items'][]=array('iPhone',1); $items['phones']['items'][]=array('HTC',1); As said, I can write this, but takes time. I want to get it into a database, that data above, but I'm having problems about echo'ing it out, I really can't see how I should do. My current database looks like this: Thank you! Trying to do something that I think should be very simple. Let's assume that I have an array populated with the numbers 1 to 24 for this example. I need to output these items in 4 columns to accomodate my CSS layout but still have them read from left to right, top to bottom. I also want this to be somewhat dynamic - I'm okay hardcoding it to split into 4 columns, but need it to handle any number of items in the array. I'm not sure if the best way to do this would be to split the original array into an array for each of the 4 columns, or to loop through the original array 4 times and output items 1+4, 2+4, and so on. Or maybe I should be using array_filter with some custom callback functions. I'm fine with any solution. The end result is echoing the array in the following groupings so I can surround each column with the appropriate column HTML for layout (in this case the array actually contains IMG urls): Column 1: 1, 5, 9, 13, 17, 21 Column 2: 2, 6, 10, 14, 18, 22 Column 3: 3, 7, 11, 15, 19, 23 Column 4: 4, 8, 12, 16, 20, 24 Any help would be appreciated! This one is driving me nuts and I know it should be relatively easier. Guess I should stick to HTML + CSS. I have a problem with the below code: Code: [Select] <?php $sql_ranks = ("SELECT vtp_members.id, vtp_members.name, vtp_members.teamleader, teams.team_name, count(vtp_tracking.id) surfs FROM vtp_members, vtp_tracking, teams WHERE vtp_members.team_id=".$_GET['t']." AND vtp_tracking.credit_members_id=vtp_members.id AND vtp_tracking.action_date > '$last_sunday' AND vtp_tracking.action_date < '$next_sunday' GROUP BY teams.team_name ORDER BY surfs DESC"); $rsranks = mysql_query($sql_ranks); echo "<br><table align='center' valign='top' border='0' width='300px'> <tr><td colspan='2' align='center'><font size='2px'><b>Team Rankings (Current Week)</b></font></td></tr> <tr><td><font size='2px'><b>Team</font></td><td align='right'><font size='2px'>Total Surfs</font></td></tr>"; while ($row = mysql_fetch_array($rsranks)) { echo "<tr><td><font size='2px'><b>".$row[team_name]."</font></td><td align='right'><font size='2px'>".$row[surfs]."</font></td></tr>";} echo "</table>"; ?> Problem is that the last output (".$row[surfs].") is the same for all teams. It seems it is not making a total of all id's and not per team_name. anyone can see what I am doing wrong. I need to sort by team_name and the surfs should display the total of the members with team_id is ".$_GET['t']." Hi I am trying to search an array that comes from a power shell script, the array of strings that returns is ever changing as it receives variables from the script. Therefore I need to use preg_grep to search for the word "not" I am also using another array which inverts this I then need to compare these new two arrays to the original and separate the results $working and not working into a table. I would be most grateful for any advice/solutions. The preg_grep aren't displaying anything.
<?php
//phpinfo();
ini_set('display_errors', 'On');
error_reporting(0);//E_ALL
echo '<html>
<style>
body
{
font-family:Calibri,Helvetica,sans-serif;
font-size:100%;
}
</style>
<head>
<link rel="stylesheet" type="text/css" href="style.css">
<script type="text/javascript">
function uploadJS(){
String.prototype.trim = function() { return this.replace(/^\s+|\s+$/g, ""); };
var textAreaValue=document.getElementById(\'ServerList\').value;
var trimmedTextAreaValue=textAreaValue.trim();
if(trimmedTextAreaValue!="") {
document.myForm.submit();
} else{
alert("Server List Text Area is Empty");
}
};
var input=document.getElementById(\'fileSelect\').value;
if(input!="") {
document.myForm.submit();
} else{
alert("You have not selected a file, please select one to proceed.");
}
var handleFileSelect = function(e) {
var files = e.target.files;
if(files.length === 1) {
document.forms.myForm.filecsv.value = files[0].name;
}
}
};
</script>
</head>';
#Upload Code
$target = "D:\Web\Upload/";
$target = $target . basename( $_FILES['uploaded']['name']) ;
$ok=1;
if(move_uploaded_file($_FILES['uploaded']['tmp_name'], $target))
{
echo "The file ". basename( $_FILES['uploadedfile']['name']). "
has been uploaded";
}
else {
}
if ($uploaded_size > 150000)
{ echo "Your file is too large.<br>";
$ok=0;
}
if ($uploaded_type =="text/php")
{
echo "No PHP files<br>";
$ok=0;
}
if (!($uploaded_type=="text/csv")) { echo "<br>";
$ok=0;
}
$target = "upload/"; $target = $target . basename( $_FILES['uploaded']['name']) ; $ok=1; //This is our size condition
if ($uploaded_size > 350000)
{
echo "Your file is too large.<br>";
$ok=0;
}
//This is our limit file type condition
if ($uploaded_type =="text/php")
{ echo "No PHP files<br>";
$ok=0;
}
//Here we check that $ok was not set to 0 by an error
if ($ok==0)
{
}
//If everything is ok we try to upload it
else {
if(move_uploaded_file($_FILES['uploaded']['tmp_name'], $target))
{
echo "The file ". basename( $_FILES['uploadedfile']['name']). " has been uploaded";
} else
{
}
}
#Start of scripts to check Servers in textbox
if(isset($_POST['ServerList']))
{
//$arry=explode( "\r\n", $_POST['ServerList'] );
$txttrim = trim($_POST['ServerList']);
//$textAr = explode("\n", $text);
//$textAr1 = array_filter($text, 'trim'); // remove any extra \r characters left behind
$txtarea = explode("\n",$txttrim);
$txtarea = array_filter($txtarea,'trim');
foreach ($txtarea as $line => $servername)
{
//$line => $servername;
##check if querying itself....
}
echo '<pre>';
$target="D:/Web/Upload/"; $target= $target . basename( $_FILES['uploaded']['name']) ;
$csv = $target;
//$filename= $_FILES['uploaded']['name'];
$output=shell_exec("powershell -Command D:/Web/scripts/PHPfwrules.ps1 $csv < NUL");
echo '<h6>';
print_r($output);
$nomatch=preg_grep('/^not/i',$output);
echo $nomatch;
$match=preg_grep("/not/",$output,PREG_GREP_INVERT);
echo $match;
if ($working1= array_intersect($output,$match))
{
echo"<link rel=stylesheet type=text/css href=style.css>
<table class=results>
<tr>
<th>Server Name</th>
<th>Working</th>
</tr>
<tr>
<td>".$servername."</td>
<td>".$working1."</td>
</tr></table>
";
}
else if ($notworking1= array_intersect($output,$nomatch))
{
echo"<link rel=stylesheet type=text/css href=style.css>
<table class=results>
<tr>
<th>Server Name</th>
<th>Not Working</th>
</tr>
<tr>
<td>".$servername."</td>
<td>".$notworking1."</td>
</tr></table>
";
}
}
echo' <link rel=stylesheet href=dhtmlwindow.css type=text/css />
<link rel=stylesheet type=text/css href=style.css>
<script src=js/dhtmlwindow.js></script>
<hr />
<table class=results>
<tr>
<th>Server Name</th>
<th>Working</th>
<th> Not Working</th>
</tr>
<tr>
<td>'.$servername.'</td>
<td>'.$working1.'</td>
<td>'.$notworking1.'</td>
<td></td>
';
echo '</pre>';
echo '
<h3>Firewall Implementation </h3>
<h4>Please enter the server below, you can only select one server at a time. </h4>
<!--The form-->
<form action="fw2.php" method="post" name="myForm" id="myForm" enctype="multipart/form-data">
<textarea name=ServerList id=ServerList>
</textarea>
<h5>Please select a CSV file.</h5>
<input name="uploaded" type="file" /><br />
<input type="submit" value="Submit" />
<br>
</html> '
;
?>
Well I have a script that executes a scan on a system set to run infinitely, and I need it to echo out a message each time it loops through, but I don't want it to echo out the message with the next loop message below it, and the next one below that etc... I've tried using the flush(); function and been messing around with that with no luck. For security reasons I don't want to release any of the processing code, but here is the basic construction of the script: <?PHP ***PROCESSING AND SCAN CODE*** ***PROCESSING AND SCAN CODE*** ***PROCESSING AND SCAN CODE*** ***PROCESSING AND SCAN CODE*** $RepeatIt = -1; for($g=1; $g!=$RepeatIt+1; $g++) { ***PROCESSING AND SCAN CODE*** ***PROCESSING AND SCAN CODE*** ***PROCESSING AND SCAN CODE*** ***PROCESSING AND SCAN CODE*** $ScanMessage = ":.:.: SCANNING THE HITLIST FOR MOBSTER: ".$MobName." (SCAN #$g) :.:.:"."<br/><br/>"; echo $ScanMessage; ***PROCESSING AND SCAN CODE*** ***PROCESSING AND SCAN CODE*** ***PROCESSING AND SCAN CODE*** ***PROCESSING AND SCAN CODE*** } ?> At the moment it's returning: :.:.: SCANNING THE HITLIST FOR MOBSTER: DEUS EX DESTROYER (SCAN #1) :.:.: :.:.: SCANNING THE HITLIST FOR MOBSTER: DEUS EX DESTROYER (SCAN #2) :.:.: :.:.: SCANNING THE HITLIST FOR MOBSTER: DEUS EX DESTROYER (SCAN #3) :.:.: :.:.: SCANNING THE HITLIST FOR MOBSTER: DEUS EX DESTROYER (SCAN #4) :.:.: So what I want it to do is just delete the scanning message and replace it with the next scan message so while running this script you would see just the number increment on the same line. Any suggestions? Thanks. Ok, so basically I have every column in the link below to work right and have the data for each column displayed....except for "Person" column. http://trigamer.com/forums/newest.php?fid=1 If you check there, you can see the posts, but not the poster. I'm thinking the 7th line from the bottom is the issue? Below is the PHP code for that section: Code: [Select] <!-- list threads--> <?php if($threads) {?> <tbody> <?php while($thread = mysql_fetch_array($threads) ){ #get last user to post $last_user = fetch("SELECT user FROM posts WHERE tid = ".$thread["tid"]." ORDER BY dateline DESC LIMIT 1"); if(!$last_user) $last_user = array(); ?> <tr bgcolor="#202025"> <td class="threadIcon"><img src="/images/posticon.png" /></td> <td class="threadTitle"><a href="replythread.php?tid=<?php echo $thread["tid"];?>"><?php echo $thread["title"];?></a></td> <td class="threadReplies"><font color=white><?php echo $thread["replies"];?></font></td> <td><font color=white><?php echo $last_user[0];?></font></td> <td><font color=white><?php echo date("m-d-Y",$thread["dateline"]);?></font></td> </tr> <?php } ?> </tbody> <?php }?> <!-- //end list threads--> I am using this to get links from a page: preg_match_all("/href=(\"|')(.+?)(\"|')/", $opt, $matches); $links = $matches[2]; Once in a while I get a link that may look like this: site.com/"><span What can I do to make my regexp better so it doesn't get the html? |