PHP - Image Coloring, Help My Fake Dogs Pass On Their Markings
I have a browser game already running that revolves around breeding dogs. Right now we use static images, and I'd like markings and colors to be traits that are inheritable through generations.
I am able to layer images based on the parents layers to create a new dog with new markings. However, this only works with precolored layers. Which means the markings and such are not really being inherited, there is no chance for uniqueness at all. What I would like to achieve is the ability to colors parts of a layer or whole image based on what the parents have colored. So lets say you are breeding two border collies, the sire has four white socks and the dam has no socks at all. It should produce puppies anywhere on that spectrum, some with half socks, some with just white feet, etc. I hope I'm explaining this correctly. In my head, I see this being possible by coloring only those certain parts of an image. So I only color the feet for example, in a somewhat random pattern based on the parents feet patterns. So this eliminates the need for precolored layers and presents the possibility of random mutations. Is this at all achieveable? Is there another way that I'm not thinking of? I have an intermediate working knowledge of php, I've coded most of the game myself, but then I hit something like this and get completely stuck. Help put me on the right track please? Similar TutorialsWhen making a fake identity in cURL, we use curl_setopt($ch, CURLOPT_USERAGENT, 'Googlebot/2.1 (http://www.googlebot.com/bot.html)'); but which is better for the referrer: curl_setopt($ch, CURLOPT_AUTOREFERER, true); or curl_setopt ($ch, CURLOPT_REFERER, "http://www.google.com/bot.html"); OK so I am working on a default response command prompt that will display X:\XOS(root)>user entered text 'user entered text' is not recognized as an internal or external command, operable program or batch file. However so far when i do this it distorts the response. See pictures. Code: [Select] <?php function stripslashes_deep($value) { $value = is_array($value) ? array_map('stripslashes_deep', $value) : stripslashes($value); return $value; } if (get_magic_quotes_gpc()) { $_GET = stripslashes_deep($_GET); } if (!isset($_GET['idx'])) { $idx = 115; $text = "XOS [Version 0.2.13]\n"; $text .= "Copyright (c) 2012 RedLine Services, LLC. All rights reserved.\n"; } else { $idx = $_GET['idx'] + 3; $input = $_GET['text']; $text = substr($input, 0, $idx); $user_input = substr($input, $idx); $text .= "\n '$user_input' is not recognized as an internal or external command,\noperable program or batch file.\n"; } $text .= "\n"; $text .= "X:\XOS(root)>"; $idx = strlen($text); //echo strlen($text); //$fn = "text.txt"; //$file = fopen($fn, "a"); //fwrite($file, "$msg2"); //fclose($file); ?> <html> <style> body{ background-color:#000000;color:#ffffff } textarea { background-color:#000000; color:#ffffff; width:100%; height:400px; } </style> <body> <form method="GET"> <textarea name="text"><?php echo $text; ?></textarea> <input type="text" name="idx" value=""> <button type="submit" name="submit">Submit</button> </form> </body> </html> Hello, I have a .htaccess file set up to create directories and files based on my PHP variables. That's how it looks anyway. It's really just some URL rewriting. I'm looking to submit a form and use the code on the same page to handle the form via isset(). The problem is, however, that $_SERVER['PHP_SELF']; redirects me back to the original base/index.php page, while nothing gets submitted. I can sort of see why, but is there any way to overcome it? I could probably use the actual file and variable names, but that isn't very practical as I intend on using this code as a basis for a much larger scale. I'm not too fond of using external pages as sources for the form action either for the same reason. My intentions were to have everything handled on a single page. Also, feel free to post constructive criticism on how to improve the code. I'm rather new to PHP and will need all the help I can get. .htaccess code Code: [Select] RewriteRule base/([a-zA-Z]+)/$ base/index.php?cat=$1 RewriteRule base/([a-zA-Z]+)/([a-zA-Z0-9]+)\.php$ base/index.php?cat=$1&subcat=$2 index.php code Code: [Select] <html> <head> <title>Index</title> </head> <body> <?php $cat=$_GET['cat']; $subcat=$_GET['subcat']; if (isset($cat)){ if ($cat=='foo'){ if (isset($subcat)){ if($subcat=='bar'){ if (isset($_POST['submit'])) { echo 'Entry Submitted Successfully'; } else{ ?> <h1>Add an Entry</h1> <div> <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post"> <div> <span>Field:</span> <span><input type="text" size="15" /></span> </div> <div> <input name="submit" type="submit" value="Submit" /> </div> </form> </div> <p> <a href="/base/">Return to Base Page</a> </p> <?php } } else { echo 'Error: Not a valid sub-category.'; } } else { ?> <h1>Select an Option</h1> <ul> <li><a href="bar.php">Add Entry</a></li> </ul> <p> <a href="/base/">Return to Base Page</a> </p> <?php } } else { echo 'Error: Not a valid Category.'; } } else{ ?> <h1>Base Page</h1> <h2><a href="foo/">Go to "Select an Option" page</a></h2> <ul> <li><a href="foo/bar.php">Go to "Add an Entry" page</a></li> </ul> <?php } ?> </div> </body></html> Is it possible for a clickable image to pass to a php page? It can lead to a linked web page, so can it be like a submit button on a form and pass to the $_POST in php?
I work with a large codebase and I have this situation come up fairly often:
the legacy class has large objects such as:
$design->motor->dimensions->a; $design->motor->dimensions->bd; $design->specifications->weight; $design->data->height; //etcWhen I create a new class, that class sometimes operates on the specific data, so say: class MyClass { public function compute($weight, $height, $a) { //stuff } } //and I call this for example as such: (new MyClass())->compute($design->specifications->weight, $design->data->height, $design->motor->dimensions->a);CONS: Potential issue: if design specs change and I need to change things parameters in "compute" function, I need to "re-key" the variables I pass to the function, and adjust things accordinly in MyClass as wel. PROS: only the exact data is being passed, and this data can come from anywhere it is viable, so in effect the function is fairly well separated, I think. Alternative option for me is to pass the entire design object, i.e class MyClass { public function compute(&$design) //can also be done via DI through a setter or constructor. { print $design->specifications->weight; print ($design->data->height + $design->motor->dimensions->a); //stuff } } (new MyClass())->compute($design);PROS: In this case when things change internally in which variables are needed and how things are computed, I only need to change the code in compute function of the class itself. CONS: MyClass now needs to be aware of how $design object is constructed. When it comes to this parameter passing, and Dependency Injection like this in general, does Computer Science advocate a preference on this issue? Do I pass the entire object, or do I pass only the bits and pieces I need? I'm trying to get a simple table to display and am not sure how to make it happen. Table will have just 2 columns. A TIME and an EVENT. What I want to have happen is for the first row to show the TIME and next to that, the EVENT. If a TIME has more than one event going I want the next row to show an empty first cell and then the second event below the first. If I set up the loop the only way I know how (so far) it would also output the TIME value again and again as many times as there were events for that same time. For example what I don't want is: 9:15 Sunday School 9:15 Nursery Available What I do want is: 9:15 Sunday School Nursery Available Thanks. Hi, i need to run this past you guy's. I need a way to effectivly check if a user has entered correct "real" details in my registeration form and check if email is already in my database to prevent the user from registering twice? I need this as some unknown person is using the form and entering there details like this: Username: 1 Password: 1 email: 1 It's really annoying as they are doing this several times so i have around 13 rows of just "1" in my table now! grr!! so far ive got: Form: <input name="upassword" type="password" class="style7" id="upassword"> <span class="style7">Email</span> <span class="style7">:</span> <input name="email" type="text" class="style7" id="email"> <span class="style7"></span> <span class="style7"></span> <input name="Submit" type="submit" class="style7" value="Register" /> </form> Script: Code: [Select] <?php if ($db_found) { $SQL = "INSERT INTO users (username, upassword, email) VALUES ('" .$username. "', '" .$upassword. "', '" .$email. "')"; $result = mysql_query($SQL); header( 'Location: http://www.removalspace.com/index.php' ); exit(); } else { print "Database NOT Found "; mysql_close($db_handle); } ?> But i need it to perform the checks aswell as drop the "real" data in to MySQL? Any ideas please? Code: [Select] $col = 0; if ($num_products_count > 0) { while (!$specials_index->EOF) { $list_box_contents[$row][$col] = array('params' =>'<a href="#">' .zen_image(..). '</a>'), $col ++; } } now i want to pass some values<img src="1.jpg">,<img src="1.jpg">,<img src="2.jpg">,<img src="3.jpg">,<img src="4.jpg">,<img src="5.jpg"> to zen_image(..). how should i do? namely, if there are five loops.i want to change zen_image(..) output result to (<img src="1.jpg">,<img src="1.jpg">,<img src="2.jpg">,<img src="3.jpg">,<img src="4.jpg">,<img src="5.jpg">) I have researched all over forums from past day. Not getting correct solution. I have 2 textboxes and a button. First box is to enter value and i will click button, i need to get the value.
Here is the code, that works without input box 1
In this code i want to modify my web address, at the end after ky= i want add my first textbox value, then click event and output in second textbox, let me know where i messed.
<script type="text/javascript"> function Assign() { <?php $html = file_get_contents("http://geoportaal.maaamet.ee/url/xgis-ky.php?ky=79401:006:0812" ); preg_match_all('(<li.*?>.*?</li>)', $html, $matches); $one=$matches[0][0]; ?> document.getElementById("OutputField").value = "<?=$one?>"; } </script> <input id="InputField" type="text" style="width:200px"/> <input type="submit" value="Assign Value" onclick="Assign()"/> <input id="OutputField" type="text" style="width:200px"/> i hav this url n whenever i click on this url i get som mssg send on my mobile i hav a form whose code is Code: [Select] <form action="formprocess.php method="post"> telephone<input type="text name="telephone> <input type="submit" name="submit"> </form> i want to send telephone as parameter to this url so whenever user enters his telephone he gets d mssg after clicking on submit.....but i hav no idea how to do tht...help me somone plssssssss http://www.abc.in/smsapi/sendsms.php?sendto=9987234123&msg=your Hello there,
I have 2 questions:
1) Look he http://www.hellastra...ooking/taxi.php
I have a form and i want to pass values from URL to fields.
So, for example to pass a value to Prefered driver ID field you write this:
http://www.hellastra...?drivercode-123 and the value 123 is passed to that field. I did this with this code:
<?php $sDriverCode = $_REQUEST['drivercode']; ?> <input style="width:100px;" name="drivercode" id="drivercode" value="<?=$sDriverCode?>" data-mini="true" />At the same form i have some radio-type fields. Its the one you see at Type of Vehicle (Standard, Premium etc). When i try to do the same, i cannot get this to work. What i am trying to do is this: I'd like to pass a value from a URL to an iframe. This would look as follows: URL: http://www.mysite.com?www.mysite2.com The value (www.mysite2.com) will be an actual web address which should then be inserted into an iframe on www.mysite.com via php. Since I know little to no php, I don't know how the URL has to be structured and what php coding I need to use to include the web address in the iframe. Any suggestions are highly appreciated Hi ! I need to pass a lot of variables using GET, and many of them are related, so I was thinking in two options: 1) Pass them as array: Code: [Select] example.php?categories[]=cat1&categories[]=cat2 2) Pass them in a single parameter, and split it in PHP (a custom and simpler serializer) Code: [Select] example.php?categories=cat1|cat2 What do you think is better? (or maybe there is a 3rd option...) The second method seems more readable and short, the first easier to construct and maybe faster because we don't need to "unserialize". But I'm looking for better reasons. I'm thinking in a possible advantage of the first method over the second for SEO, because if Google is smart enough to understand that categories[] are all the same, then can understand that: Code: [Select] example.php?categories[]=cat1&categories[]=cat2is equal to: Code: [Select] example.php?categories[]=cat2&categories[]=cat1I think that is more difficult for Google to understand that with: Code: [Select] example.php?categories=cat1|cat2and Code: [Select] example.php?categories=cat2|cat1 Regards!! Enrique. how can i do this ? i have a number of links , when i click one a pop up is displayed, i need to run a php script depending upon which link is clicked.
Or can i run a javascript function once a query string is passed in the url
Please advice.
Edited by chauhanRohit, 12 July 2014 - 04:10 AM. this is my nav menu code Code: [Select] <ul> <li><a href='fountains_page.php?id=all'>all fountains</a></li> <li><a href='fountains_page.php?id=garden'>garden fountains</a></li> <li><a href='fountains_page.php?id=wall'>wall fountains</a></li> </ul> this is my script Code: [Select] require('dbconnect.php'); $id = $_GET['id']; if($id = all){ $records = "SELECT * FROM (fountains)"; }else{ if ($id = garden){ $records = "SELECT * FROM (fountains) WHERE wall='no'"; }else{ if($id = wall){ $records = "SELECT * FROM (fountains) WHERE wall='yes'"; } } } $query_records = mysql_query($records); $num_records = mysql_num_rows($query_records); if ($num_records == 0) { echo "The menu is closed for now."; } else{ $i=1; } echo 'We have'.' '.$num_records.' '.'fountains for your consideration<br />Please visit our store to view hundreds of styles.<br />'; echo $id; $errors = array(); // initialize error array Here is the link http://www.mywebsitepaid.com/stonemans/fountains_page.php I can't get the 'id' to pass. What am I doing wrong? I did another site fine, but here I messed something up. Hello
I'm using a form to collect user data (is a Cognito form) it is displayed on vacation rental properties pages, so it collects user´s email, in date, out date, etc. in the cognito form I have one text hidden field called REF, I wonder how to do in order to use the same form and be able to identify where the info comes from. I thougt that if I could put the page url into the REF variable, the problem would be solved, but I'm not sure if that is possible and how to do it. It is? If not: is it possible to handle that ? Cant seem to figure this one out for a chained script. In the code below I need to take the value of $drop_var from function drop_1() and send it to function drop_2() So I can add it to the Where clause to limit the results of the third box a little more. But I cannot get the value to pass to the function. Any help appreciated. func.php <?php //************************************** // Page load dropdown results // //************************************** function getTierOne() { $result = mysql_query("SELECT DISTINCT branch FROM rank") or die(mysql_error()); while($tier = mysql_fetch_array( $result )) { echo '<option value="'.$tier['branch'].'">'.$tier['branch'].'</option>'; } } //************************************** // First selection results // //************************************** if($_GET['func'] == "drop_1" && isset($_GET['func'])) { drop_1($_GET['drop_var']); } function drop_1($drop_var) { include_once('db.php'); $result = mysql_query("SELECT DISTINCT type FROM rank WHERE branch='$drop_var'") or die(mysql_error()); echo '<select name="drop_2" id="drop_2"> <option value=" " disabled="disabled" selected="selected">Choose one</option>'; while($drop_2 = mysql_fetch_array( $result )) { echo '<option value="'.$drop_2['type'].'">'.$drop_2['type'].'</option>'; } echo '</select>'; echo "<script type=\"text/javascript\"> $('#wait_2').hide(); $('#drop_2').change(function(){ $('#wait_2').show(); $('#result_2').hide(); $.get(\"func.php\", { func: \"drop_2\", drop_var2: $('#drop_2').val() }, function(response){ $('#result_2').fadeOut(); setTimeout(\"finishAjax_tier_three('result_2', '\"+escape(response)+\"')\", 400); }); return false; }); </script>"; } //************************************** // Second selection results // //************************************** if($_GET['func'] == "drop_2" && isset($_GET['func'])) { drop_2($_GET['drop_var2']); } function drop_2($drop_var2) { echo "<br>($drop_var)<br>"; include_once('db.php'); $result = mysql_query("SELECT * FROM rank WHERE type='$drop_var2'") or die(mysql_error()); echo '<select name="drop_3" id="drop_3"> <option value=" " disabled="disabled" selected="selected">Choose one</option>'; while($drop_3 = mysql_fetch_array( $result )) { echo '<option value="'.$drop_3['grade'].'">'.$drop_3['grade'].'</option>'; } echo '</select>'; echo '<input type="submit" name="submit" value="Submit" />'; } ?> index.php <?php include('db.php'); include('func.php'); ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Chained Select Boxes using PHP, MySQL and jQuery</title> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js"></script> <script type="text/javascript"> $(document).ready(function() { $('#wait_1').hide(); $('#drop_1').change(function(){ $('#wait_1').show(); $('#result_1').hide(); $.get("func.php", { func: "drop_1", drop_var: $('#drop_1').val() }, function(response){ $('#result_1').fadeOut(); setTimeout("finishAjax('result_1', '"+escape(response)+"')", 400); }); return false; }); }); function finishAjax(id, response) { $('#wait_1').hide(); $('#'+id).html(unescape(response)); $('#'+id).fadeIn(); } function finishAjax_tier_three(id, response) { $('#wait_2').hide(); $('#'+id).html(unescape(response)); $('#'+id).fadeIn(); } </script> </head> <body> <p> <form action="" method="post"> <select name="drop_1" id="drop_1"> <option value="" selected="selected" disabled="disabled">Select a Category</option> <?php getTierOne(); ?> </select> <span id="wait_1" style="display: none;"> <img alt="Please Wait" src="ajax-loader.gif"/> </span> <span id="result_1" style="display: none;"></span> <span id="wait_2" style="display: none;"> <img alt="Please Wait" src="ajax-loader.gif"/> </span> <span id="result_2" style="display: none;"></span> </form> </p> <p> <?php if(isset($_POST['submit'])){ $drop = $_POST['drop_1']; $drop_2 = $_POST['drop_2']; $drop_3 = $_POST['drop_3']; echo "You selected a "; echo $drop_3." ".$drop." ".$drop_2; } ?> </body> </html> Hi guys, I need your help, I have got a problem with the if statement. When I don't insert the pass function in the url like this: Code: [Select] http://www.mysite.com/myscript.php?image=myimagelocation&strings=mystrings&user=test I will get this on my php page: Code: [Select] PASSWORD are missing Code: [Select] <?php session_start(); define('DB_HOST', 'localhost'); define('DB_USER', 'mydbusername'); define('DB_PASSWORD', 'mydbpass'); define('DB_DATABASE', 'mydbname'); $errmsg_arr = array(); $errflag = false; $link = mysql_connect(DB_HOST, DB_USER, DB_PASSWORD); if(!$link) { die('Failed to connect to server: ' . mysql_error()); } $db = mysql_select_db(DB_DATABASE); if(!$db) { die("Unable to select database"); } function clean($var){ return mysql_real_escape_string(strip_tags($var)); } $image = clean($_GET['image']); $strings = clean($_GET['strings']); $username = clean($_GET['user']); $pass = clean($_GET['pass']); if($username == '' && $pass) { $errmsg_arr[] = 'username are missing'; $errflag = true; }elseif($username && $pass =='') { $errmsg_arr[] = 'PASSWORD are missing'; $errflag = true; } if($username == '' && $pass == '') { $errmsg_arr[] = 'username or password missing'; $errflag = true; } if($errflag) { $_SESSION['ERRMSG_ARR'] = $errmsg_arr; echo implode('<br />',$errmsg_arr); } else { $insert = array(); if(isset($_GET['image'])) { $insert[] = 'image = \'' . clean($_GET['image']) . '\''; } if(isset($_GET['strings'])) { $insert[] = 'strings = \'' . clean($_GET['strings']) . '\''; } if(isset($_GET['user'])) { $insert[] = 'user = \'' . clean($_GET['user']) .'\''; } if(isset($_GET['pass'])) { $insert[] = 'pass = \'' . clean($_GET['pass']) . '\''; } if (count($insert)>0) { $names = implode(',',$insert); $required_fields = array('image', 'strings', 'user'); if($image && $strings && $username) { echo "working 1"; } elseif($username && $pass) { echo "working 2"; } } } ?> Do anyone know how to fix this? so I need some help passing these variable from this page to final.php. how do I pass these arrays? I know if it were singled....not arrayed, I could use hidden fields in a form and echo them out....but these are multiples....not singled. The form way is prefered.....but it doesn't have to be. I just need these passed to the page where I am going to process them. I am not good at working with arrays. Thanks in advance Code: [Select] <?php include_once("connect.php"); session_start(); foreach($_POST["product"] AS $key => $val) { $product = $val; $month = $_POST['month'][$key]; $day = $_POST['day'][$key]; $year = $_POST['year'][$key]; $date = $_POST['date'][$key]; $price = $_POST['price'][$key]; $qty = $_POST['qty'][$key]; $id = $_POST['id'][$key]; $total = $_POST['total'][$key]; $academy = $_POST['academy'][$key]; $priceunit = $price * $qty; } ?> hello how do i pass a value from 1 function to another i want to use this part Code: [Select] //send the list order to the navigation or list page $PHL = PhLists::by_listNo($PHGlno); foreach ($PHL as $PHLs){ $PHLlno = $PHLs->phList_No; $PHLorb = $PHLs->orderBy; $PHLord = $PHLs->orderDir; } from this very long function. Code: [Select] function include_placeHolders($position, $phNo, $pageID){ $langBS = basicSettings::find_by_id(1); $langID = $langBS->language_id; //FIND PLACEHOLDER BY ID $PH = Placeholders::find_by_pageID($pageID); foreach ($PH as $PHs){ $PHpos = $PHs->position; $PHnum = $PHs->phNumber; $PHgNo = $PHs->phGroup_No; $PHgFx = $PHs->PHGfx_id; $PHgThm = $PHs->PHGtheme_id; if($phNo == $PHnum && $position == $PHpos){ //FIND ELEMENT THEMES echo '<style type="text/css" media="screen">'; include(PAGES.DS."phGroups".DS."theme{$PHgThm}".DS."css".DS."styles.css"); echo '</style>'; echo'<div id="PHgroup">'; //FIND GROUPS BY phGroupNo $PHGodr = PhGroups::find_order($PHgNo); foreach ($PHGodr as $PHGodrs){ $PHGob = $PHGodrs->orderBy; $PHGod = $PHGodrs->orderDir; } //FIND PHGROUPS BY BY GROUPno & ORDER $PHG = PhGroups::find_by_order($PHgNo, $PHGob, $PHGod); foreach ($PHG as $PHGs){ $PHGid = $PHGs->id; $PHGname = $PHGs->name; $PHGgno = $PHGs->phGroup_No; $PHGlno = $PHGs->list_No; $PHGce = $PHGs->contElements_id; $PHGpl = $PHGs->pageLink_id; $extLink = $PHGs->extLink_id; $PHfx = $PHGs->PHfx_id; $PHthm = $PHGs->PHtheme_id; //send the list order to the navigation or list page $PHL = PhLists::by_listNo($PHGlno); foreach ($PHL as $PHLs){ $PHLlno = $PHLs->phList_No; $PHLorb = $PHLs->orderBy; $PHLord = $PHLs->orderDir; } //FIND EXTERNAL LINK $PHGeL = ExtLinks::find_link($extLink); foreach($PHGeL as $PHGeLs){ $PHGurl = $PHGeLs->url; $PHGtarget = $PHGeLs->target; } //FIND ELEMENTS $CE = ContElements::find_by_phg($PHGce); foreach ($CE as $CEs){ $CEeName = $CEs->name; $CEetype = $CEs->elementTypes_id; $CEefx = $CEs->elFx_id; $CEethm = $CEs->elTheme_id; //FIND ELEMENT TYPE NAME $CEt = ElementsTypes::find_Etype($CEetype); foreach ($CEt as $CEts){ $CEtName = $CEts->name; //FIND PLACEHOLDER THEMES echo '<style type="text/css" media="screen">'; include(PAGES.DS."placeHolders".DS."theme{$PHthm}".DS."css".DS."styles.css"); echo '</style>'; //FIND ELEMENT THEMES echo '<style type="text/css" media="screen">'; include(ELEMENTS.DS."{$CEtName}".DS."themes".DS."theme{$CEethm}".DS."css".DS."styles.css"); echo '</style>'; //FIND INTERNAL OR EXTERNAL LINK $pageLNK = (empty($PHGpl)) ? '' : '<a href="index.php?pageID='.$PHGpl.'">'; $extLNK = (empty($extLink)) ? '' : '<a href="'.$PHGurl.'" target="'.$PHGtarget.'">'; $ENDpageLNK = (empty($PHGpl)) ? '' : '</a>'; $ENDextLNK = (empty($extLink)) ? '' : '</a>'; echo $pageLNK; echo $extLNK; echo'<div id="ph"> <div id="PHelement">'; include(ELEMENTS.DS."{$CEtName}".DS."{$CEeName}.php"); echo'</div></div>'; echo $ENDpageLNK; echo $ENDextLNK; } } } echo'</div>'; } } } i want the next long function to use these values Quote $PHLlno = $PHLs->phList_No; $PHLorb = $PHLs->orderBy; $PHLord = $PHLs->orderDir; this is where i want to use them in the next function Quote $nH = PhLists::navOrder($PHLlno, $PHLorb, $PHLord); Code: [Select] function nav(&$navLink){ $nH = PhLists::navOrder($PHLlno, $PHLorb, $PHLord); foreach ($nH as $nHs){ $nav_typ = $nHs->type; $nav_lvl = $nHs->levels; $nav_pLnk = $nHs->pageLink_id; $nav_eLnk = $nHs->extLink_id; $nav_tType = $nHs->titleType; $nav_ctBid = $nHs->custTxtBridge_id; //INTERNAL LINKS if($nav_typ == "Internal"){ //USE SET TITLE if($nav_tType == "SetTitle"){ $navPage = Pages::findNav($nav_pLnk); foreach ($navPage as $navPages){ $NPbid = $navPages->PCbridge_id; } $STBhead = PCbridge::find_setTitle($NPbid, $langID); foreach ($STBhead as $STBheads){ $text = $STBheads->pageContent_id; } $navText = PageContent::find_text($text); foreach ($navText as $navTexts){ $navLink = $navTexts->title; } //USE CUSTOM TITLE }else if($nav_tType == "Custom"){ $CTBhead = PCbridge::find_customTitle($nav_ctBid, $langID); foreach ($CTBhead as $CTBheads){ $text = $CTBheads->pageContent_id; } $navText = PageContent::find_text($text); foreach ($navText as $navTexts){ $navLink = $navTexts->title; } } } //EXTERNAL LINKS if($nav_typ == "External"){ //USE SET TITLE if($nav_tType == "SetTitle"){ $navExt = ExtLinks::findNav($nav_eLnk); foreach ($navExt as $navExts){ $navLink = $navExts->name; $PHGurl = $navExts->url; $PHGtarget = $navExts->target; } //USE CUSTOM TITLE }else if($nav_tType == "Custom"){ $navExt = ExtLinks::findNav($nav_eLnk); foreach ($navExt as $navExts){ $PHGurl = $navExts->url; $PHGtarget = $navExts->target; } $CTBhead = PCbridge::find_customTitle($nav_ctBid, $langID); foreach ($CTBhead as $CTBheads){ $text = $CTBheads->pageContent_id; } $navText = PageContent::find_text($text); foreach ($navText as $navTexts){ $navLink = $navTexts->title; } } } //NO LINK if($nav_typ == "Non"){ //USE CUSTOM TITLE if($nav_tType == "Custom"){ $CTBhead = PCbridge::find_customTitle($nav_ctBid, $langID); foreach ($CTBhead as $CTBheads){ $text = $CTBheads->pageContent_id; } $navText = PageContent::find_text($text); foreach ($navText as $navTexts){ $navLink = $navTexts->title; } } } } } thanks |