-
Posts
3,372 -
Joined
-
Last visited
-
Days Won
18
Everything posted by Muddy_Funster
-
still need a name on the <select multimple="multiple name="area" should do
-
ok, first thing you need to do is add name="sensibleName" to every one of your form elements (fyi <select> is an element, <option> is an atribute of <select>, so don't name any options) Then we're going to redisign your database, because you should have more than 1 table. Then we're going to tweek your index page (make it .php if it isn't already, and if it is let me see the code for it) and after all that we can move onto making the searches do what you want them to do. let us know when you have the elements named
-
ok, couple of questions: 1. can I get eyes on your database tables +column names and types 2. how upset would you be if I re-wrote your whole code 3. is this actualy going to be a commercial launch or just a personal project
-
Need help finding PHP form processor that works for me
Muddy_Funster replied to amlebede's topic in PHP Coding Help
Youre not looking for a PHP processor: your looking for a PHP application. The question is - are you looking for someone to point you at an existing php application that can do what you are asking? in which case you should have posted this in the php Applications section. OR Are you looking for someone to write you an application to do this? in which case you should have posted this in the freelance section. Leading on from that: Your actualy looking for a lot more than you are saying. When you are tending for some development be as verbose in your description of the end product as you can. Things that seem too obvious to mention to you may never even cross the mind of the developer. There is no such thing as too much communication during the initial stages of developing an app. The following are just the first few questions that come to my mind after reading your post(likely they are badly worded, but they all address valid points where information is lacking) : What DB do you want/need it to work with? If exporting to excel, what version compatability do you want/need? How should the interface look? Where will the application be hosted? How secure is the environment around the application (is it a LAN / MPLS for example) and as such how secure does the application need to be? What's the expected compitence of the end user and how much time/money is going to be invested in training? How many users/admins are likely to be using the app on a daily basis? -
this is lifted from the manual page: //Jay 11-Sep-2007 05:10 //As stated, some of the code listed below will have trouble with multiple equal weights, such as if you query gmail.com. The following code will prevent that by switching the key/values. <?php // Get the records getmxrr("gmail.com", $mx_records, $mx_weight); // Put the records together in a array we can sort for($i=0;$i<count($mx_records);$i++){ $mxs[$mx_records[$i]] = $mx_weight[$i]; } // Sort them asort ($mxs); // Since the keys actually hold the data we want, just put those in an array, called records $records = array_keys($mxs); // Simply echoes all the stuff in the records array for($i = 0; $i < count($records); $i++){ echo $records[$i]; echo '<br>'; } ?> If you wanted to get the weight, you would use "array_values($mxs);" instead of "array_keys($mxs);". Hope this helps some people. it shows how to get the info you want., I still think using the get_dns_record() would be easier. and using fsock_open() seems to be the preffered method to varify an actual domain as having a mail server.
-
I think what you are looking for is http://uk3.php.net/manual/en/function.dns-get-record.php (assuming you don't have an array of MX records to work from at this point)
-
Logout script not clearing $_session variables
Muddy_Funster replied to Aaron4osu's topic in PHP Coding Help
also you may want to check any included files that are possably attached to the page you are working on. -
Not much to mess up really, but here ya go : <?php if(isset($_POST['submit'])){ $fname = mysql_real_escape_string($_POST['fname']); // these changes $lname = mysql_real_escape_string($_POST['lname']); // are important $skill = mysql_real_escape_string($_POST['skill']); // please find out why! //connect to the database $db=mysql_connect ("127.0.0.1", "root", "") or die ('I cannot connect to the database because: ' . mysql_error()); //select the database to use $mydb=mysql_select_db("resource matrix"); //build condition for WHERE: if (!empty($skill)) { $skillQry = " OR Skill_Name LIKE '%$skill%'"; } else{ $skillQry = ''; } //query the database table $sql="SELECT DISTINCT First_Name, Last_Name, l.Resource_ID FROM ((resource l inner join resource_skill ln on l.Resource_ID = ln.Resource_ID) inner join skill n on ln.Skill_ID = n.Skill_ID) WHERE First_Name LIKE '{$fname}' OR Last_Name LIKE '{$lname}' $skillQry";
-
change it to = pizza you see: it's not checking what you think it is, even though you know it's not.
-
Logout script not clearing $_session variables
Muddy_Funster replied to Aaron4osu's topic in PHP Coding Help
I was atempting to inspire curiosity fuled research -
Logout script not clearing $_session variables
Muddy_Funster replied to Aaron4osu's topic in PHP Coding Help
ahh, now see if you hadn't used SELECT * on your user table I would have tried to help you... nah, just kidding, just use unset($_SESSION); there are other session variables in there that keep the session unique. you need to unset the should array, not just the ones you are using. -
but your query is looking for every shop type that isn't pizza : AND s.shop_type <> 'pizza'
-
a little something like this: if (!empty($skill)) { $skillQry = " OR Skill_Name LIKE '%$skill%'"; } else{ $skillQry = ''; } $sql="SELECT DISTINCT First_Name, Last_Name, l.Resource_ID FROM ((resource l inner join resource_skill ln on l.Resource_ID = ln.Resource_ID) inner join skill n on ln.Skill_ID = n.Skill_ID) WHERE First_Name LIKE '{$fname}' OR Last_Name LIKE '{$lname}' $skillQry";
-
you can either use it conditionaly through php, or use an SQL CASE statement
-
you need to have a WHERE condition in your query : $result = mysql_query("SELECT * FROM properties WHERE field1='$type' AND field2='$area' AND......");
-
what's that got to do with the price of oil?
-
I always find it best to have a stab it it myself first. pop back and start another thread if your having any more problems. good luck
-
CPD! You didn't just use a SELECT *
-
is this enough? : function custOut($val){ //declare function to check values, take in any variable passed to it and assign it to $val while it's inside the function if (is_array($val)){ // check if the variable that was passed in is an array, if it is foreach($val as $k=> $v){ //run through the array, assigning the keys as $k and the vaules as $v if(trim($v) == '' || empty($v) || !isset($v)){ //if the value (once all empty space has been removed) is an empty string, or if the value is false, or if the value is not set $v = 'N/A'; //make the value = to the string 'N/A' }//close if value check }//close for each } //cloase if array else{ // if the value passed in is not an array if(trim($val) == '' || empty($val) || !isset($val)){ //perform the same check directly to the value that was passed into the function $val = 'N/A'; // and applt the string value of 'N/A' if it matches the check }//close if check }//close else return $val; //now that we are done we can return the value of $val back to the main code, only changed if it met with the checks and exactly as it was if it didn't } // end of function. nb. If we didn't return anything the rest of the code would have no access any changes made in the function
-
Let's step it up, throw away the foreach that's causing the problem, we can do the N/A thing by writing a tiny little custom function, then applying that to the output: add this code neer the top of the page: function custOut($val){ if (is_array($val)){ foreach($val as $k=> $v){ if(trim($v) == '' || empty($v) || !isset($v)){ $v = 'N/A'; } } } else{ if(trim($val) == '' || empty($val) || !isset($val)){ $val = 'N/A'; } } return $val; } then we change up the code for the display: echo custOut($row['doc_id'])."<br />". custOut($row['doc_title'])."<br />". custOut($row['doc_number'])."<br />". custOut($row['doc_type'])."<br />". custOut($row['revision'])."<br />". custOut($row['cdm_link'])."<br />". custOut($row['mars_link'])."<br />". custOut($row['checklist_link'])."<br />". custOut($row['link_internal_1_3'])."<br />". custOut($row['impacted_products'])."<br />". custOut($row['scope'])."<br />". custOut($row['impacted_products_2'])."<br />". custOut($row['review_class'])."<br />". custOut($row['full_or_simplified'])."<br />". custOut($row['earliest_date'])."<br />". custOut($row['latest_date'])."<br />". custOut($row['previous_tc_reviews'])."<br />". custOut($row['proj_name'])."<br />". custOut($row['author_name'])."<br />". custOut($row['req_list'])."<br />". custOut($row['optional_list'])."<br />". custOut($row['information_only'])."<br />". custOut($row['chairperson'])."<br />". custOut($row['reviewers_required'])."<br />". custOut($row['review_duration'])."<br />". custOut($row['document_abstract'])."<br />" That should do it.
-
so what exactly is the problem? what are you geting back V's what are you expecting back?
-
I did try the (!isset()) idea, but as they all start null it was having a bad time of it all. property_exists() is what I was looking for, and I'll be using that from now on. thanks kicken
-
what are you actualy doing?
-
I dont see any code therre that would bear any relevance to that error message
-
this looks to be the offending line from PFM's info: $f_price = number_format ($typeProperty['price',2);