Jump to content

kernelgpf

Members
  • Posts

    227
  • Joined

  • Last visited

Everything posted by kernelgpf

  1. Okay I found the problem but am still unsure how to fix it - the string in the database has odd question mark black symbols - how can I remove them/unformat the string? "�1�4�0�0� �W� �W�E�S�T� �L�P� �S� �7�0�0� �P�O�S�T� �O�A�K� �B�L�V�D��"
  2. I trimmed both values first, thanks anyway =/ nothing in the table will match properly - I'm actually writing a script to check against the incidentID and I started testing on the intersection field as well, something is wrong with the table I feel.
  3. I am trying to run queries against a table and running into very confusing problems. I keep returning "0" rows for obvious matches - attached is a screenshot of an example (query+"no results" and picture of table with value being searched for (perfect match). I've been pulling my hair out on this for hours - help and TIA!
  4. That was exactly it, and I pulled out so much hair over it. Thanks!
  5. I've tried all 3 functions and I can't get it to return true when I clearly see what I'm looking for in the string. $string='<div class="lupin lumi1" style="background:url(\'/images/grey_pins2.png\') no-repeat 0 -70px;height:35px;overflow:hidden;width:19px"><a href="http://maps.google.com/maps?hl=en-US&gl=US&safe=0&client=firefox&rls=org.mozilla:en-US:official&num=10&filter=1&complete=0&pws=0&um=1&ie=UTF-8&q=back+pain+austin&fb=1&gl=us&hq=back+pain&am'; if (strpos($string, "/images/grey_pins" !== FALSE)) print 'found'; else print 'not found';
  6. I'm trying to grab all names (in: LNAME, FNAME, POSSIBLE INITIAL) in a bunch of text, I have this set of rules: /[^OWNER NAME].*([^0-9+][A-Z]{1}[^0-9+][a-z]+[^0-9+]\, [A-Z]{1}[^0-9+][a-z]+[^0-9+])/' What I'm trying to do is some names have "OWNER NAME" very recently in the last line or two before the name, and I -do not- want those. Only if that string isn't found in in the last line or two do I want it. Example of a name I would -not- want to collect: OWNER NAME (IF SAME, WRITE “SAMEâ€) ADDRESS (STREET, CITY, STATE, ZIP CODE) 5 Wu, Isabella [code] Example of returned strings matching current rules: Array ( [1] => Okulich, Kathern, [2] => Broadus, Raymond, Avery ) [EDIT: the reasons I account for no numbers is because it was pulling back home addresses. also, the pattern above simply doesn't work.]
  7. Figured it out, in the source code it showed tons of spacing and newlines which was throwing it off.
  8. Neither of those work for me, possibly because the dates I am searching for are in a large text blob, it's not just verifying an entire string is a date. if (preg_match_all('~(0?[1-9]|1[012])\s[- /.]\s(0?[1-9]|[12][0-9]|3[01])\s[- /.]\s(19|20)[0-9][0-9]~', $contents, $out, PREG_SET_ORDER)) { echo "found a date<p>"; foreach($out as $val){ if(empty($val[0])) continue; print "found: $val[0]<br>"; } }
  9. I have this strip of regex that matches: MM/DD/YYYY and I just need to make it require spaces before each slash (/), as in: MM / DD / YYYY. I've tried "\\s", "\s", "[ ]", "\ " and maybe a few more, new to regex. (0?[1-9]|1[012])[- /.](0?[1-9]|[12][0-9]|3[01])[- /.](19|20)[0-9][0-9] TIA! -Alyssa
  10. That's exactly what my code up there does, the number and email appendage is passed in through a database entry. I'm trying to send HTML in a text message.
  11. I find this hard to believe seeing as I get texts from companies with links that I click on in the same fashion?
  12. I have been Googling for hours and cannot find a solution. My code: $from_name = 'Alacrity'; $from_email = 'support@alacritysim.com'; // From Phone Number $sendto = $urow[phone].$urow[phone_email]; $headers .= "From: ".$from_email."\r\n"; $headers .= "Reply-To: ".$from_name." <".$from_email.">\r\n"; //$headers .= "MIME-Version: 1.0\r\n"; $headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n"; $subj = "Alacrity Alert"; $body = "<a href='userprofiles.php?id=$sid'>Player #$sid</a> scribbled on <a href='userprofiles.php'>your profile</a>!"; mail($sendto, $subj, $body, $headers); I've tried mlutiple charsets I've found online, and all I know is when I add the MIME line it simply erases all HTML. I'm trying to have this sent as a text message that contains clickable links to the pages specified in the HTML. Help?
  13. I need the variable to have the $i loop variable in it. =/ I changed it to "$puppyplace$i" in case it was interpreting "$iplace" as the variable, still doesn't work. Any ideas?
  14. So the error I'm getting is unexpected T_VARIABLE on line 28. Not only is there no problem before line 28, if I cut out the rest of the script, lines 28 and above work perfectly. My entire script: <?php include "config.php"; session_start(); include "header.html"; $v=$_SERVER["DOCUMENT_ROOT"]; $loggedin=$_SESSION["loggedin"]; if($_GET['action'] == "login"){ $username=$_POST['username']; $password=$_POST['password']; if($username == "admin" && $password == "admin"){ $_SESSION["loggedin"]="yes"; $loggedin=$_SESSION["loggedin"]; print "Successfully logged in! <a href='images.php?'>Manage images?</a>"; include "footer.html"; exit; } else{ print "Incorrect login info."; include "footer.html"; exit; } } if(empty($loggedin)){ print "<p><form method=post action=images.php?action=login> Username: <input type=text name=username><br> Password: <input type=password name=password><br> <input type=submit name=submit value='Login'></form>"; include "footer.html"; exit; } //right here is lin 28 if($_GET['action'] == "managelitters"){ //upload new current litter if($_GET['upload'] == "yes"){ $bitch=$_FILES["bitch"]["name"]; $stud=$_FILES["stud"]["name"]; $puppy1=$_FILES["puppy1"]["name"]; $puppy2=$_FILES["puppy2"]["name"]; $puppy3=$_FILES["puppy3"]["name"]; $puppy4=$_FILES["puppy4"]["name"]; $puppy5=$_FILES["puppy5"]["name"]; $puppy6=$_FILES["puppy6"]["name"]; $puppy7=$_FILES["puppy7"]["name"]; $puppy8=$_FILES["puppy8"]["name"]; $puppy1c=mysql_real_escape_string($_POST['puppy1caption']); $puppy2c=mysql_real_escape_string($_POST['puppy2caption']); $puppy3c=mysql_real_escape_string($_POST['puppy3caption']); $puppy4c=mysql_real_escape_string($_POST['puppy4caption']); $puppy5c=mysql_real_escape_string($_POST['puppy5caption']); $puppy6c=mysql_real_escape_string($_POST['puppy6caption']); $puppy7c=mysql_real_escape_string($_POST['puppy7caption']); $puppy8c=mysql_real_escape_string($_POST['puppy8caption']); $litterc=mysql_real_escape_string($_POST['littercaption']); $place="$v/new_images/"; if(empty($bitch) || empty($stud)){ print "You must have a bitch and a stud to enter a litter."; include "footer.html"; exit; } $bitchplace="$place"."$bitch"; if(move_uploaded_file($_FILES["filetest"]["tmp_name"],$bitchplace)){ //uploaded bitch image, can fail if bitch already uploaded } $studplace="$place"."$stud"; if(move_uploaded_file($_FILES["filetest"]["tmp_name"],$studplace)){ //uploaded bitch image, can fail if stud already uploaded } $puppy1place="$place"."$puppy1"; if(move_uploaded_file($_FILES["filetest"]["tmp_name"],$puppy1place)){ //uploaded bitch image, can fail if puppy already uploaded } for($i=1;$i<8;$i++){ $puppyplace="$place"."$puppy$i"; $puppy$iplace="$place"."$puppy$i"; if(!empty($puppyplace)){ if(move_uploaded_file($_FILES["filetest"]["tmp_name"],$puppyplace)){ //uploaded bitch image, can fail if puppy already uploaded } } } mysql_query("insert into current(bitch,stud,puppy1,puppy2c,puppy2,puppy2c,puppy3,puppy3c,puppy4,puppy4c,puppy5,puppy5c,puppy6,puppy6c,puppy7,puppy7c,puppy8,puppy8c,litterc)values('$bitchplace','$studplace','$puppy1place','$puppy1c','$puppy2place','$puppy2','$puppy3','$puppy3palce','$puppy4','$puppy4place','$puppy5','$puppy5place','$puppy6','$puppy6place','$puppy7','$puppy7place','$puppy8','$puppy8place','$litterc'"); $litterID=mysql_insert_id(); print "Successfully added a litter. Click <a href='currentlitters.php'>here</a> to see it."; include "footer.html"; exit; } $query=mysql_query("select bitch,stud,text from current ORDER BY ID DESC"); print "<form method=post action=images.php?action=managelitters&upload=yes enctype=multipart/form-data> Upload a new litter<p> Bitch: <input type=file name=bitch><br> Stud: <input type=file name=stud><br> Puppy 1: <input type=file name=puppy1><br> Puppy Caption: <input type=text name=puppy1caption><br> Puppy 2: <input type=file name=puppy2><br> Puppy Caption: <input type=text name=puppy2caption><br> Puppy 3: <input type=file name=puppy3><br> Puppy Caption: <input type=text name=puppy3caption><br> Puppy 4: <input type=file name=puppy4><br> Puppy Caption: <input type=text name=puppy4caption><br> Puppy 5: <input type=file name=puppy5><br> Puppy Caption: <input type=text name=puppy5caption><br> Puppy 6: <input type=file name=puppy6><br> Puppy Caption: <input type=text name=puppy6caption><br> Puppy 7: <input type=file name=puppy7><br> Puppy Caption: <input type=text name=puppy7caption><br> Puppy 8: <input type=file name=puppy8><br> Puppy Caption: <input type=text name=puppy8caption><p> Litter Caption/Text: <input type=text name=littercaption><br> <input type=submit name=submit value='Add Current Litter'></form><p>"; print "Edit an existing current litter:<br>"; while($row=mysql_fetch_array($query)){ print "<a href='images.php?action=managelitters&edit=ID'>$row[bitch] x $row[stud]</a><br>"; } print "<hr noshade>"; } print "<a href='images.php?action=managelitters'>Manage Current Litters</a><br> <a href='images.php?action=manageupcoming'>Manage Upcoming Litters</a><p>"; include "footer.html"; ?> I can't find any problems with the rest of it either.
  15. This is a really weird problem. I copy and paste the query into phpmyadmin and it works, the mysql_error on the end of the query is not activated though I get the "Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/arobyn7/public_html/agility/crons76021/30minutes.php on line 5" error. As I said, the query copied+pasted not only works in phpmyadmin but also returns rows. $query=mysql_query("select d.owner,d.energy,d.id,o.loggedintoday,d.hunger,d.age,d.accident from dogs as d,users as o where d.owner=o.id and o.loggedintoday='yes'")or die(mysql_error()); while($row=mysql_fetch_array($query)){ //stuff }
  16. My code: <script type="text/javascript" src="prototype.js"></script> <script type="text/javascript"> function sendRequest() { var showtype = document.test.showtype.options; var chosen_showtype = showtype[showtype.selectedIndex].value; var horse_id = document.test.horse_id.options; var chosen_horseid = horse_id[horse_id.selectedIndex].value; new Ajax.Request("ajaxshowsearch.php", { method: 'post', postBody: 'showtype='+chosen_showtype+'&horse_id='+chosen_horseid, onComplete: showResponse }); } function showResponse(req){ $('foofighters').innerHTML= req.responseText; } function replaceshow(show_id,horse_id,showtype) { new Ajax.Request("ajaxentershow.php", { method: 'post', postBody: 'show_id='+show_id+'&horse_id='+horse_id+'&showtype='+showtype, onComplete: function(req){showResponse2(req,show_id,horse_id,showtype);} }); } function showResponse2(req,show_id,horse_id,showtype){ $('show'+show_id).innerHTML= req.responseText; } </script> My form code with pre-filled out information. <form name=test id=test onsubmit="return false;"> Horse: <select name=horse_id id=horse_id><option value=10533>Name Me! (500 classes left to enter)</option></select><br>Show Type: <select name='showtype' id='showtype'><option>experience<option>event</option> </select></select><br><input type=submit name=submit value='Search Shows' onClick=sendRequest()></form> <div id="foofighters"></div> The form shows up in IE and when I click the button it pops down, like some empty space is showing up in the foofighters DIV, but no information comes up. I've researched and it looks like typically simple errors in syntax cause this, but Firebug shows nothing, so I'm lost.
  17. There was a space before "Caught Ya Kissin", figured it out.
  18. The query: SELECT * FROM `horses` ORDER BY `horses`.`name` ASC The results: Caught Ya Kissin A Lacey Prescription pic coming soon test test All are ordered correctly but the first first name, which refuses to budge.
  19. Because: $row[location] is ONE city, always. "cityname" is a list, so I need to check if $row[location] is in "cityname" somewhere.
  20. and cities.name IN (city_buildings.cityname) That's the problem, not the first part.
  21. Yeah. $keywords=$_POST['keywords']; $query=mysql_query("select column from table where name IN ('$keywords') OR description in ('$keywords')"); 'keywords' should be a list separated by commas. "fun, name, gone"
  22. $query=mysql_query("select cities.description,cities.name,city_buildings.building_title,city_buildings.building_type,city_buildings.ID from cities,city_buildings where cities.name='$row[location]' and cities.name IN (city_buildings.cityname)")or die(mysql_error()); "cityname" is either one city or a list of cities (city1, city2, etc.), but how do I make it work with this query? This query only brings back the buildings with individual city names in "cityname".
  23. At this point, I'm just trying to show an alert of which dropdown item is selected each time it's selected. It.. doesn't work. Firebug doesn't show any errors. Prototype.js is included in the header.php. <?php $pagename="My Pod Page"; include "header.php"; ?> <script language="javascript" type="text/javascript"> function item(){ var itemID = document.form1.lifedropdown.options; var chosen_itemID = itemID[itemID.selectedIndex].value; alert(chosen_itemID); new Ajax.Request("item_action_process.php", { method: 'post', postBody: 'itemID='+$F(chosen_itemID), onComplete: showResponse }); } function showResponse(req){ $('show').innerHTML= req.responseText; } </script> <div id="show"></div> <?php $query=mysql_query("select middlename,age,gender,height,weight,shoesize,mother,father,strength,ethnicity,eyecolor,haircolor,location,marriedtopod,intelligence from pods where podID='$podID' LIMIT 1"); $row=mysql_fetch_array($query); $itemquery=mysql_query("select items.name,items.itemID,items_main.display from items,items_main where items.name=items_main.name and items.podID='$podID' and items_main.category='life'"); if(mysql_num_rows($itemquery) != "0"){ print "Life: <form id=form1 method=post name=form1 action=pod.php?><select id=lifedropdown name=lifedropdown onchange=item()>"; while($itemrow=mysql_fetch_array($itemquery)){ print "<option value=$itemrow[itemID]>$itemrow[display]</option>"; } print "</select></form>"; } ?>
×
×
  • 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.