Search Results

Search found 7 results on 1 pages for 's2xi'.

Page 1/1 | 1 

  • load a php page with a cron job

    - by s2xi
    I am using a cron job to reload my httpd service after a subdomain is created. I have the problem that when the reload happens the page that registers the user throws a server error. I was wondering if I could go around this by having another cron task. So my logic would be: httpd reload after a .conf file is created then take the user back to the DocumentRoot of the main page. So in usage it would be: a user registers, then is automatically taken back to domain.com

    Read the article

  • drew's autoSuggest plugin help with AJAX results not showing

    - by s2xi
    hey guys, i use drew's autoSuggest plugin for some time but up until now I have hard coded my data into my JS, I'm trying to see if I can use AJAX to return the JSON data and query data like that. I seem to have it working but no matter what I try I can't get the results to be shown in the drop down UL it creates via jquery. The JSON comes back as it should. This is my PHP code: $input = $_GET["q"]; $data = array(); // query your DataBase here looking for a match to $input $query = mysql_query("SELECT `state`, `idStates` FROM `states_list` WHERE (`state` LIKE '%{$input}%' OR `abbr` LIKE '%{$input}%')"); while ($row = mysql_fetch_assoc($query)) { $json = array(); $json['value'] = $row['idStates']; $json['name'] = $row['state']; $data[] = $json; } header("Content-type: application/json"); echo json_encode($data); and my JS: $('#state').autoSuggest('resources/ajax/suggest.php', {matchCase: true, minChars: 2, startText: '', emptyText: '', retrieveComplete: function(data){ console.log(data.value) }}); I have been trying to debug so I added the retrieveComplete parameter in there for that. the PHP returns the AJAX with the JSON content...now just to figure out how to get the JS to pick it up append it to the UL LI UPDATE: I appened the data to a test div and its returning results:[object Object],[object Object],[object Object]

    Read the article

  • is it possible to extract certain strings based off a predefined white-space count?

    - by s2xi
    So after several Advil's I think I need help I am trying to make a script that lets the user upload a .txt file, the file will look like this as an example EXT. DUNKIN' DONUTS - DAY Police vehicles remain in the parking lot. The determined female reporter from the courthouse steps, MELINDA FUENTES (32), interviews Comandante Chitt, who holds a napkin to his jaw, like he cut himself shaving. MELINDA < Comandante Chitt, how does it feel to get shot in the face? > COMANDANTE CHITT < Not too different than getting shot in the arm or leg. > MELINDA < Tell us what happened. > COMANDANTE CHITT < I parked my car. (indicates assault vehicle in donut shop) He aimed his weapon at my head. I fired seven shots. He stopped aiming his weapon at my head. > Melinda waits for more, but Chitt turns and walks away into the roped-off crime scene. Melinda is confused for a second, then resumes smiling. MELINDA < And there you have it... A man of few words. > Ok, so based off of this what I want to do is this: The PHP script looks at the file and counts 35 white spaces, since all files will have the same layout and never differ in white spaces I chose this as the best way to go. for every 35 white spaces extract character 36 until the end of line. Then tally up $character++ so in the end the output would look like ----------------------------------- It looks like you have 2 characters in your script Melinda Commandante Chitt ----------------------------------- using PHP to select distinct names, and use the strtolower() to lower case the strings and ucfirst() to make the first letter upper-case thats my project, I'm at the stage where I'm going crazy trying to figure out how to count white-spaces and everything after that white space until the first white-space after the word IS a character name

    Read the article

  • what are the best practices to prevent sql injections

    - by s2xi
    Hi, I have done some research and still confused, This is my outcome of that research. Can someone please comment and advise to how I can make these better or if there is a rock solid implementation already out there I can use? Method 1: array_map('trim', $_GET); array_map('stripslashes', $_GET); array_map('mysql_real_escape_string', $_GET); Method 2: function filter($data) { $data = trim(htmlentities(strip_tags($data))); if (get_magic_quotes_gpc()) $data = stripslashes($data); $data = mysql_real_escape_string($data); return $data; } foreach($_GET as $key => $value) { $data[$key] = filter($value); }

    Read the article

  • Help using the jQuery BBQ plug-in with forms

    - by s2xi
    Hi, I have been trying to figure out how to use the jQuery BBQ plug-in. I have been able to add it to my site by copying the code from the site but I'm seeing that if I have a form in one of my tabs, I can't post any of the results successfully. Has anyone used this plug-in and gotten used to its functionality? I need help figuring out where to input my php code for form handling and have the results returned the page loaded in the tab.

    Read the article

  • Upload .txt and keep formating

    - by s2xi
    I have been trying to upload a .txt to my server via a simple php script I made. Everything seems to uploaded correctly, if I open the .txt in Dreamweaver I can see all the formatting is still in tact with spaces and paragraph breaks. The problem I have is when I try to open that file with PHP and import the contents onto my site. I'm not using an editor right now, just a simple div where the contents are echoed. I don't have much experience with uploading/downloading using PHP. Am I not using a command to handle the file contents and keep the initial formatting? In the end I want the user to upload a file, and have PHP read the file and extract certain elements from it based on the number of spaces between paragraph breaks and such. I was able to actually echo the .txt using URLENCODE() which kept the formatting and made all my spaces +'s. Thats the closes I got, but the original file isn't uploaded in the format so I can't do a count for +'s and select x characters after the last +. Hmmm, if someone knows of a script already available that can do this or similar to with me just tweaking that would be awesome.

    Read the article

  • help to reiterate through my jquery snippet

    - by s2xi
    Code in question: $("#alpha").click(function(event) { event.preventDefault(); $("#show").slideToggle(); }); I have a list of files and its being outputted with PHP in alphabetical. I use this method in PHP: foreach(range('A','Z') as $i) { if (array_key_exists ("$i", $alpha)) { echo '<div id="alpha"><a href="#" name="'.$i.'"><h2>'.$i.'</h2></a></div><div id="show">'; foreach ($$i as $key=>$value) echo '<p>'.$value.' '.$key.'</p>'; } echo '</div>'; } What I want to do is when the user clicks on the #alpha to toggle the div #show that has the names that belong to a letter up. I can do this with the first listing, but every listing after that isn't affected. how can i tell jquery that foreach letter apply the js code so it can toggle up/down the #show. I don't want to this 26 times (one time for each letter in the alphabet), I tried to use class instead of id but that causes all the #show to toggleup heh.

    Read the article

1