PHP - Two Reloads, With Output After Input?
After inputing my email and password and clicking submit, the echo in Verify_User (in bold) doesn't show up, nor does it load the logged in form of the log in bar. If I reload the page or press submit again (even without entering any information), everything works. At first I though I might just be outputting before getting my input on the reload, but all info is obtained at the top. I also thought it might be $logoff, but it doesn't tell me "You logged off!", while still setting $logoff to true by the end in order to output the login menu. Therefore, it get's passed if($Logoff) but doesn't make it to Verify_user, so for some reason $L_Email and $L_Password aren't set after the first refresh. I'm a newbie so any help, related to the problem or not, would be greatly appreciated.
P.S. The logoff button works the first time. Code: [Select] <?php $L_Email = $_POST['l_email']; $L_Password = $_POST['l_password']; $Logoff = $_POST['logoff']; //if the page was requested with an effort to logoff if ($Logoff) { //setcookie("session_email", "", time()-3600); setcookie("session_password", "", time()-3600); } //if logging in, Email and password are already set, make them cookies else if($L_Email && $L_Password) { setcookie("session_email", $L_Email, 0); setcookie("session_password", $L_Password, 0); } $L_Email = get_email_cookie(); $L_Password = get_password_cookie(); $logbar_html = ""; if($Logoff) { $logbar_html = $logbar_html . "You logged off!<br>"; } else { //if there was a cookie or apt input if ($L_Email && $L_Password) { //if logged on if(verify_user($L_Email, $L_Password)) { $logbar_html = $logbar_html . "Hello $L_Email!<br>"; $logbar_html = $logbar_html . "<form action='index.php?at=". $_GET['at'] . "' method='post'> <input name='logoff' type='submit' value='logoff'> </form>"; $logbar_html = $logbar_html . "<a href='index.php?at=edit_account'><text size=1>Edit your account!</text></a><br>"; if ($L_Email == "scott.jaromin@gmail.com") { echo "<a href='index.php?at=admin'>Admin</a>"; } } else { $logbar_html = $logbar_html . "Login Failed<br>"; $Logoff=true; $L_Password=NULL; } } //if this, you are definitely logged off else { $Logoff = true; } } //if you are logged off if($Logoff) { $logbar_html = $logbar_html . "<a href='index.php?at=register'><text size='0'>Register!</text></a><br> <form action='index.php?at=". $_GET['at'] . "' method='post'> Email: <input name='l_email' type='text' value='$L_Email'/><br> Password: <input name='l_password' type='password' /> <br> <input type='submit' /> </form> "; } function get_email_cookie() { $email_cookie = ""; if(isset($_COOKIE["session_email"])) { $email_cookie = $_COOKIE["session_email"]; } return $email_cookie; } function get_password_cookie() { $password_cookie = ""; if(isset($_COOKIE["session_password"])) { $password_cookie = $_COOKIE["session_password"]; } return $password_cookie; } function verify_user($email_check, $pass_check) { echo "verifying $email_check $pass_check"; $con = mysql_connect("my", "info", "only"); if (!$con) { die("Could not connect: " . mysql_error()); } mysql_select_db("begood4u_barter", $con); if(!$email_check || !$pass_check) { return false; } $result = mysql_query("SELECT Password FROM Members WHERE Email='$email_check'"); $real_pass = ""; if($row = mysql_fetch_array($result)) { $real_pass = $row['Password']; } else { echo "$result"; } echo " real pass: $real_pass"; mysql_close($con); return($pass_check == $real_pass); } ?> Similar TutorialsI'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. function showCart() { global $db; $cart = $_SESSION['cart']; $output[] = '<div align="center"><table cellpadding="1" cellspacing="1" bgcolor="#666666" width="400">'; $output[] = '<tr bgcolor="#FFFFFF" valign="middle">'; $output[] = '<td width="70" align="center">Titlu</td>'; $output[] = '<td width="90" align="center">Imagine </td>'; $output[] = '<td width="60" align="center">Pret</td>'; $output[] = '<td align="center">Sterge Produs</td>'; $total += $price * $qty; $output[] = '</tr>'; $output[] = '</table>'; if ($cart) { $items = explode(',',$cart); $contents = array(); foreach ($items as $item) { $contents[$item] = (isset($contents[$item])) ? $contents[$item] + 1 : 1; } $output[] = '<form action="http://www.sprayart.info/new/sprayart.php"><div align="center" name="trimite" id="trimite"><table width="400">'; foreach ($contents as $id=>$qty) { $sql = 'SELECT * FROM com_images WHERE id = '.$id; $result = $db->query($sql); $row = $result->fetch(); extract($row); $output[] = '<tr bgcolor="#FFFFFF">'; $output[] = '<td width="70"> <input type="hidden" name="title[ ]" value="'.$title.'" size="5" maxlength="5" /> <input type="text" value="'.$title.'" size="5" maxlength="5" disabled="disabled" /></td>'; $output[] = '<td width="90" align="center" valign="middle"><img src=../../'.$thumbnail.'> </td>'; $output[] = '<td width="60" align="center">'.$price.'</td>'; $output[] = '<td ></td>'; $total += $price * $qty; $output[] = '<td width="50"><a href="cart.php?action=delete&id='.$id.'" class="r"><img src="../../media/sterge.jpg"></a></td>'; $output[] = '</tr>'; } $output[] = '</table>'; $output[] = '<hr>'; $output[] = '<p align="right">Total De plata: <strong>'.$total.' RON</strong></p></div>'; $output[] = '<table border="0" width="444" id="table29" cellspacing="0" cellpadding="0" background="#BASE_URL#media/comand_form.gif" height="322"> <form action="#BASE_URL#sprayart.php" method="post" name="trimite" id="trimite"> <tr> <td width="25"></td> <td width="71" class="text_negru_left_25"><span class="style4">*</span> Nume:</td> <td width="146"><input name="nume" type="text" class="text_negru_fild_19" /></td> <td width="170"></td> <td width="32"></td> </tr> <tr> <td width="25"></td> <td class="text_negru_left_25"><span class="style4">*</span> Adresa:</td> <td ><input name="adresa" type="text" class="text_negru_fild_19"></td> <td width="170"></td> <td width="32"></td> </tr> <tr> <td width="25"></td> <td class="text_negru_left_25"><span class="style4">*</span> E-mail:</td> <td ><input name="email" type="text" class="text_negru_fild_19" /></td> <td width="170"></td> <td width="32"></td> </tr> <tr> <td width="25"></td> <td class="text_negru_left_25"><span class="style4">*</span> Telefon:</td> <td ><input name="telefon" type="text" class="text_negru_fild_19" /></td> <td width="170"></td> <td width="32"></td> </tr> <tr> <td width="25" height="139"></td> <td colspan="3" class="text_negru_left_25"><span class="style4">*</span> <textarea name="mesaj" cols="44" rows="7" ></textarea></td> <td width="32"></td> </tr> <tr> <td width="25" height="39"></td> <td colspan="2" valign="top" class="text_negru_left_25"></td> <td valign="top" class="text_negru_left_25"><input style="BORDER-RIGHT: #3a3a3a 1px solid; BORDER-TOP: #3a3a3a 1px solid; FONT-SIZE: 8pt; FLOAT: right; BORDER-LEFT: #3a3a3a 1px solid; COLOR: #b1b1a7; BORDER-BOTTOM: #3a3a3a 1px solid; FONT-FAMILY: Verdana; BACKGROUND-COLOR: #3a3a3a" type="submit" class="buton" name="trimite" value="Trimite" /></td> <td width="32"></td> </tr></table></form>'; how can i get the "title" for all products ! if i buy one its ok it will send me in email, but if is more products i get only the last added product!! Please help thank you ! I am trying to work on a code for php where you first have a form that asks the user to input a message then input a color. When they click the submit button it takes them to the output page. It should take their message and output it into boxes in a square. And the background should turn the color that they types in. This topic has been moved to JavaScript Help. http://www.phpfreaks.com/forums/index.php?topic=349588.0 Hi, I have been trying to get the below code to work but without luck for the past couple of days. Can anyone help point out where i am going wrong. I have a webpage that has several buttons which will eventually let users search for data stored in different tables of a postgresql database ( i have simplified the code here to just two buttons). When the user clicks the Search for hostname button a form is displayed letting them type in their search criteria. Upon clicking the submit button i am able to access the users search strings with no problem but i cannot get the original search form to display above the search results additonaly including the users original search strings. Any help on this would be much appreciated as i am pulling my hair out, as you can probably guess i am very new to PHP/HTML My code is <? session_start(); ?> <form method="POST" action="<? echo $_SERVER['PHP_SELF'];?>"> <center> <button type="submit" id="green_button" name="searchhostname">Search for Hostname</button> <button type="submit" id="green_button" name="searchipaddress">Search for IP address</button> </center> </form> </body> <? // If user clicks the search hostname button display the additonal search form if ($_POST['searchhostname']) { echo "Search for Hostnames and IP Addresses:<br><br>"; echo "<form method='POST' action='".$_SERVER['PHP_SELF']."'>"; echo "Hostname: <input type='text' name='hostname' size='16' value='".$_POST['hostname']."'/>"; echo "<br>"; echo "Operating System: <input type='text' name='ostype' size='16' value='".$_POST['ostype']."'/>"; echo "<br>"; echo "<input type='submit' id='green_button' value='Search' name='runsearch'><br><br>"; echo"</form>"; } // If user has entered criteria to search on run the search but alos display the original search form above // and any data the user has entered before displaying results if ($_POST['runsearch']) { //In reality this is where the users search data will be compared to a postresql database.... echo "You want to search for hostname: ".$_POST['hostname']."<br>"; echo "You want to search for operating system: ".$_POST['ostype']."<br>"; } ?> Hello everyone. I need help with the following PHP APP. I am running on (Version PHP 7.2.10) I am trying to have a page table form on table.php pass the input variable of “5-Numbers” to another page called table_results.php I want that variable string of “5-Numbers” to be compared against 4 arrays and output any duplicates found within each of those 4 lists. If nothing is found, I still want some visual output that reads “None found”.
Lets pretend I have the following example .. On table.php, I typed inside my table form the 5-Numbers .. INPUT: 2,15,37,13,28 On table_results.php, the 4 arrays to be compared against my input numbers “ 2,15,37,13,28” are ..
$array_A = array(2,6,8,11,14,18,24); $array_B = array(1,2,9,10,13,14,25,28,); $array_C = array(1,3,7,9,13,15,20,21,24); $array_D = array(4,5,12,22,23,27,28,29);
So my output should read as follows below .. OUTPUT:
TABLE COLUMN 1 COLUMN 2 ROW 1 Matches Found Results .. ROW 2 GROUP A: 2 ROW 3 GROUP B: 2,13,28 ROW 4 GROUP ? 13,15 ROW 5 GROUP ? 28 ROW 6 5#s Input: 2,15,37,13,28
Please let me know if anyone has any suggestions on how to go about it. Thanks. Edited January 1, 2019 by Jayfromsandiego Wanted to include image example 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. I am writing a script that will parse my PHP classes and check for things like coupling, visualize my objects and connections, dependencies, check for convention usage, etc.
So, I have a simple file upload. I'm never saving the files, just get contents and dump the file and work with the string version.
I'm writing it for me, but I figure I might want to open it for others to use in the future, so I may as well write it that way to begin with -- so I need to validate user input. Problem is, the user input is supposed to be valid PHP code. I'm thinking that, as long as I'm careful, I shouldn't be executing any code contained in strings, but I'm no security expert and I want a warm fuzzy that my thought on this is correct. What kinds of things do I need to look out for? Is it possible to inject when working with strings?
My initial thought is to regex the entire file and replace key portions with known replacements. So ( and ) would become !* and !^ or $ would become @~ (combinations that -- I think -- don't make sense to php?) But that may be completely unnecessary processing time if I'm not in any danger, here. Thanks ahead of time for any help.
PS - as a side question -- what's the best way to verify a file is a php file? I know of getimagesize for images, but should I just check for <? to verify it's php? That seems like it would be too easy to fool -- then again, it might not matter much.
-Adam
I hope I can explain what is happening. I have created two forms in PHP. The first 'almost' works, i.e. it shows the data. But I have two problems - 1) the second pulldown menu is always empty and 2) $value from the first pulldown menu ALWAYS equals the last entry thus the last 'if' in the function subdomains ($domains) is always called (but still empty). The code may explain this better than me:
<!DOCTYPE html> <html> <body> <!-- processDomains.php is this file - it calls itself (for testing purposes so I can see what is happening) --> <form action="processDomains.php" method="post"> <?php // create the domains array (there are actually several entries in the array but I cut it down for testing) $domains = array (1 => 'Decommission', 'Migration'); echo "Select Domain:"; echo "<br>"; // Make the domain pull-down menu - this displays correctly echo '<select name="domain">'; foreach ($domains as $key => $value) { echo "<option value=\"$key\">$value</option>\n"; } echo '</select>'; // input doesn't matter what is 'submitted', always goes to last $value echo '<input type="submit" name="submit" value="Submit">'; // call function subdomains subdomains ($value); function subdomains ($domains) { // define values for each array - each array contains available choices for the subdomain pulldown menu $migration = array (1 => 'Application Migration', 'Application Patch', 'Application Upgrade'); $decommission = array (1 => 'Applications', 'Servers', 'Storage'); if ($domains === 'Migration') { echo "Select subdomain:"; echo "<br>"; // Make the Migration pull-down menu echo '<select name="migration">'; foreach ($migration as $key => $value) { echo "<option value=\"$key\">$value</option>\n"; } echo '</select>'; } else if ($domains === 'Decommission') { /* === * since 'Decommission' is the last entry in the 'Domains' pulldown list, $value ALWAYS equals * 'Decommission' and $domains equals $value. So this menu SHOULD work but is always * empty. Thus, two problems - the pulldown menu is always empty and $value isn't based * upon user input. */ echo "Select subdomain:"; // this prints so I know I'm in 'Decommission (I eliminated the echo "$domain" to show I'm always coming here)' echo "<br>"; // Make the 'Decommission' pull-down menu echo '<select name="decommission">'; foreach ($decommission as $key => $value) { echo "<option value=\"$key\">$value</option>\n"; } echo '</select>'; echo '<input type="submit" name="submit" value="Submit">' ) // end of 'if-else' } // end of function 'subdomain' ?> </form> </body> </html>Let me say thank you in advance and I appreciate the help! I know I'm doing something (or more than one thing) wrong and I hope someone can tell me what it is. Best Regards! Edited by mac_gyver, 19 January 2015 - 09:37 PM. code tags around posted code please I have a calendar select date function for my form that returns the date in the calendar format for USA: 02/16/2012. I need to have this appear as is for the form and in the db for the 'record_date' column, but I need to format this date in mysql DATE format (2012-02-16) and submit it at the same time with another column name 'new_date' in the database in a hidden input field. Is there a way to do this possibly with a temporary table or something? Any ideas would be welcome. Doug I have a function which is listing my directories w/ files (Images) in them. <?php function sortDirectory($path = 'images') { $ignore = array('.', '..', 'index.php'); $folder = array(); $dh = @opendir($path); while (false !== ( $file = readdir($dh) )) { if (!in_array($file, $ignore)) { if (is_dir("$path/$file")) { $folder[$file] = sortDirectory("$path/$file"); } else { $folder[$file] = "$path/$file"; } } } closedir($dh); ksort($folder); return $folder; } function getDirectory($folder = array(),$level = 0) { // Set which extensions should be approved in the XML file $extensions = array( 'jpg', 'JPG', 'png', 'PNG', 'gif', 'GIF', 'bmp', 'BMP'); $spaces = str_repeat(' ', ( $level * 4)); foreach($folder as $file=>$path) { if (is_array($path)) { echo "<strong>$spaces $file</strong><br />"; getDirectory($path, $level+1); } else { if ( in_array( substr($file, -3), $extensions ) ){ echo "$spaces <a href=\"$path\">$file</a><br />"; } } } } getDirectory(sortDirectory()); ?> Im trying to get it to write an xml file in this fashion Code: [Select] <?xml version="1.0" encoding="utf-8" standalone="yes"?> <dir1> <pic> <image>file1.jpg</image> </pic> <pic> <image>file2.jpg</image> </pic> </dir1> <dir2> <pic> <image>file1.jpg</image> </pic> <pic> <image>file2.jpg</image> </pic> </dir2>but I cannot seem to get a grasp on this simplexml for more than 1 directory - any help appreciated.? hello guys..!!! am new to this phpfreak community...i hav faced some problem while getting on floating point nos addition..if i use echo (int)((0.1+0.7))*10; i am getting output as 7. If i remove (int), i would get output as 8..which is correct... for any other possibilities like ((0.1+0.2))*10 am getting correct output as 3..pls guys help me on this wid proper reason....waiting for solution.... Hey folks, I have made a cart for buying drinks. I also made an sql database. But when I click on the email button, I receive an email but only with the id of the products. I would like to have an output with the id of the product, but also the name of the product ( the name of the column in sql is also 'name') this is my code and you can check it out on http://fhcs.be/cart-demo3/ thanks in advance cart.php <?php // Include MySQL class require_once('inc/mysql.class.php'); // Include database connection require_once('inc/global.inc.php'); // Include functions require_once('inc/functions.inc.php'); // Start the session session_start(); // Process actions $cart = $_SESSION['cart']; $action = $_GET['action']; switch ($action) { case 'add': if ($cart) { $cart .= ','.$_GET['id']; } else { $cart = $_GET['id']; } break; case 'delete': if ($cart) { $items = explode(',',$cart); $newcart = ''; foreach ($items as $item) { if ($_GET['id'] != $item) { if ($newcart != '') { $newcart .= ','.$item; } else { $newcart = $item; } } } $cart = $newcart; } break; case 'update': if ($cart) { $newcart = ''; foreach ($_POST as $key=>$value) { if (stristr($key,'qty')) { $id = str_replace('qty','',$key); $items = ($newcart != '') ? explode(',',$newcart) : explode(',',$cart); $newcart = ''; foreach ($items as $item) { if ($id != $item) { if ($newcart != '') { $newcart .= ','.$item; } else { $newcart = $item; } } } for ($i=1;$i<=$value;$i++) { if ($newcart != '') { $newcart .= ','.$id; } else { $newcart = $id; } } } } } $cart = $newcart; break; } $_SESSION['cart'] = $cart; ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title>PHP Shopping Cart Demo &#0183; Cart</title> <link rel="stylesheet" href="css/styles.css" /> </head> <body> <div id="shoppingcart"> <h1>Your Shopping Cart</h1> <?php echo writeShoppingCart(); ?> </div> <div id="contents"> <h1>Please check quantities...</h1> <?php echo showCart(); ?> <p><a href="index.php">Back to bookshop...</a></p> <form action="mail.php" method="post"> <input type="submit" name="sendemail" value="Email" /> <input type="hidden" name="cart" value="<?= $cart; ?>" /> </form> </div> </body> </html> mail.php <?php session_start(); if($_POST['sendemail'] == 'Email') { $headers = 'From: Sender <andrej13@gmail.com>'; mail('andrej13@gmail.com', 'Subject', $_SESSION["cart"] , $headers); echo 'Your mail has been sent'; } else { echo 'message not sent'; } ?> and the functions.php <?php function writeShoppingCart() { $cart = $_SESSION['cart']; if (!$cart) { return '<p>You have no items in your shopping cart</p>'; } else { // Parse the cart session variable $items = explode(',',$cart); $s = (count($items) > 1) ? 's':''; return '<p>You have <a href="cart.php">'.count($items).' item'.$s.' in your shopping cart</a></p>'; } } function showCart() { global $db; $cart = $_SESSION['cart']; if ($cart) { $items = explode(',',$cart); $contents = array(); foreach ($items as $item) { $contents[$item] = (isset($contents[$item])) ? $contents[$item] + 1 : 1; } $output[] = '<form action="cart.php?action=update" method="post" id="cart">'; $output[] = '<table>'; foreach ($contents as $id=>$qty) { $sql = 'SELECT * FROM products WHERE id = '.$id; $result = $db->query($sql); $row = $result->fetch(); extract($row); $output[] = '<tr>'; $output[] = '<td><a href="cart.php?action=delete&id='.$id.'" class="r">Remove</a></td>'; $output[] = '<td>'.$name.'</td>'; $output[] = '<td>€'.$price.'</td>'; $output[] = '<td><input type="text" name="qty'.$id.'" value="'.$qty.'" size="3" maxlength="3" /></td>'; $output[] = '<td>€'.($price * $qty).'</td>'; $total += $price * $qty; $output[] = '</tr>'; } $output[] = '</table>'; $output[] = '<p>Grand total: <strong>€'.$total.'</strong></p>'; $output[] = '<div><button type="submit">Update cart</button></div>'; $output[] = '</form>'; } else { $output[] = '<p>You shopping cart is empty.</p>'; } return join('',$output); } ?> help me. i have an index.php file in admin folder. this is the code inside the file: Code: [Select] <?php ?> Or any other code and i get output 0 , but if i echo something else then i get the string has output, help find out what is the problam please!!! Hi. I found a code online but unfortunately, the data is retrieved via variables. How can i convert this code to retrieve the data from database instead. Thank you in ADVANCE! Code: [Select] var members = [ ['Steven B. Ayres', '1911-1913', 'New York', 'Independent Democrat', '1861-1929'], ['William Augustus Ayres', '1915-1921 1923-1934', 'Kansas', 'Democratic', '1867-1952'], ['William Hanes Ayres', '1951-1971', 'Ohio', 'Republican', '1916-2000'] ]; Team I tried to create csv output ( every value in double quotes) in my php using below function
if($generate_csv){
function generateCSV($data, $filename) { I got below output with one issue (There is a blank at the end of each value)
Date,time,Device,lable,throughput_read,throughput_write
Could you please help me to resolve this issue Hello. I'm looking for some help to make a script. The script should run a .bat file, and get the output from it. (The text from the console). Regards Worqy the print_r($a)'s result is views_handle_field_node Object ( [view]=>view Object ( [db_table] => views_view [base_table] => node [args] => Array ( [0] => My entry 1 ) [use_ajax] => [result] => Array ( [0] => stdClass Object ( [nid] => 5 [node_title] => Title of a test entry [node_revisions_body] => [node_revisions_format] => 1 [node_vid] => 5 [term_data_name] => My first test term name [term_data_vid] => 1 [term_data_tid] => 1 [vocabulary_name] => Vocabulary 1 [node_revisions_vid] => 5 ) [1]=> stdClass Object ( [nid] => 8 [node_title] => Title of a test entry [node_revisions_body] => [node_revisions_format] => 1 [node_vid] => 5 [term_data_name] => My first test term name [term_data_vid] => 1 [term_data_tid] => 1 [vocabulary_name] => Vocabulary 1 [node_revisions_vid] => 5 .. [2].. .. now i want to output the [nid]=>5 and[nid]=>8.....and all the nid's value.i use this, but can't work. $views_handle_field_node->$view->$result[]->nid. what's the correct output of it. Hi, This script lists all the contents of the dir it is placed in bar itself. Perfect for what I need. However, I want to output the results as xml and being new to php I really don't know where to start. <?php foreach (new DirectoryIterator('.') as $file) { if ( (!$file->isDot()) && ($file->getFilename() != basename($_SERVER['PHP_SELF'])) ) { echo ($file->isDir()) ? "(Dir) ".$file->getFilename() : $file->getFilename(); } } ?> I'd be thankful for the help Thanks in advance. |