Search Results

Search found 21 results on 1 pages for 'jascha'.

Page 1/1 | 1 

  • Foreach loop returning null values in PHP?

    - by Jascha
    Hello, I have a pretty simple problem. Basically I have an array called $list that is a list of titles. If I do a print_r($list) I get these results: Array ( [0] => Another New Title [1] => Awesome Movies and stuff [2] => Jascha's Title ) Now, I'm running a foreach loop to retrieve their values and format them in an <ul> like so... function get_film_list(){ global $categories; $list = $categories->get_film_list(); if(count($list)==0){ echo 'No films are in this category'; }else{ echo '<ul>'; foreach($list as $title){ echo '<li>' . $title . '<li>'; } echo '</ul>'; } } The problem I'm having is my loop is returning two values per value (is it the key value?) The result of the preceding function looks like this: Another New Title   Awesome Movies and stuff   Jascha's Title   I even tried: foreach($list as $key => $title){ echo '<li>' . $title . '<li>'; } With the same results: Another New Title   Awesome Movies and stuff   Jascha's Title   What am I missing here? Thanks in advance.

    Read the article

  • Mysql Real Escape String PHP Function Adding "\" to My Field Entry

    - by Jascha
    Hello, I am submitting a form to my mySql database using PHP. I am sending the form data through the mysql_real_escape_string($content); function. When the entry shows up in my database (checking in myPhpAdmin) all of my double quotes and single quotes are escaped. I'm fairly certain this is a PHP configuration issue? so: $content = 'Hi, my name is Jascha and my "favorite" thing to do is sleep'; mysql_real_escape_string($content); $query = 'INSERT INTO DB...' comes up in my database as: Hi, my name is Jascha and my \"favorite" thing to do is sleep Who do I tell what to do? (I cannot access the php.ini). -J

    Read the article

  • Record Disappeared from Mysql Table, How Can I Find Out What Happened?

    - by Jascha
    I got the fire alarm phone call, AIM messages and email today from a client stating "The site is down!, WTF happened?!" Well, after a little digging, it turns out one of the records in a table had been wiped clean, but without removing the row itself. So, I had the representation of data, but a bunch of empty fields. (needless to day I need to write into my code a catch for this.) What my real question is, where can I figure out what happened? I've got access to phpmyadmin and that's about it. I found some access logs on in the root directory of my server, but that just tells me the client was in the admin area I built editing that record, I'd like to know specifically what they did that made all of the data go away. (what query was run etc...) is it possible without real server admin access? is there a neat little php to mysql class that returns data like this? Thanks in advance. -Jascha

    Read the article

  • POST Fail via AJAX Request?

    - by Jascha
    I can't for the life of me figure out why this is happening. This is kind of a repost (submitted to stackoverflow, but maybe a server issue?). I am running a javascript log out function called logOut() that has make a jQuery ajax call to a php script... function logOut(){ var data = new Object; data.log_out = true; $.ajax({ type: 'POST', url: 'http://www.mydomain.com/functions.php', data: data, success: function() { alert('done'); } }); } the php function it calls is here: if(isset($_POST['log_out'])){ $query = "INSERT INTO `token_manager` (`ip_address`) VALUES('logOutSuccess')"; $connection->runQuery($query); // <-- my own database class... // omitted code that clears session etc... die(); } Now, 18 hours out of the day this works, but for some reason, every once in a while, the POST data will not trigger my query. (this will last about an hour or so). I figured out the post data is not being set by adding this at the end of my script... $query = "INSERT INTO `token_manager` (`ip_address`) VALUES('POST FAIL')"; $connection->runQuery($query); So, now I know for certain my log out function is being skipped because in my database is the following data: if it were NOT being skipped, my data would show up like this: I know it is being skipped for two reasons, one the die() at the end of my first function, and two, if it were a success a "logOutSuccess" would be registered in the table. Any thoughts? One friend says it's a janky hosting company (hostgator.com). I personally like them because they are cheap and I'm a fan of cpanel. But, if that's the case??? Thanks in advance. -J

    Read the article

  • Would a Socket Connection Outperform an Intarvaled Database Sweep and Requests?

    - by Jascha
    I'm building a small chat application to add to an existing framework. There will only be 20-50 users MAX at any one time. I was wondering if I could get away with updating a cache file containing (semi) live chat data for whichever users happen to be chatting just by performing timed queries and regular AJAX refreshes for new data as opposed to learning how to open and maintain a socket connection. I'm sure there are existing chat plug-ins out there. But I just had a hell of a time installing one and I could see building the whole damn thing taking just as much time as plugging one in. Am I off to a bad start? Thanks in advance -J (p.s. this is a semi closed network behind a php login so security isn't a great concern)

    Read the article

  • CMS Preventing Bad HTML Insertion by Client?

    - by Jascha
    I'm building a small CMS in PHP for a client and something I've noticed that comes up fairly often is a client will enter a bit of HTML in a field without closing his/her tag. I'm wondering if there is some parsing technique to prevent bad HTML from rendering my whole output page in italics because the user forgot to add a closing </i> tag. I'm not worried about XSS or malicious html, just a forgotten tag here and there as it's the client who is managing the content. Forgive me if this is a duplicate question, I did some searching, but could not find an appropriate answer. -J

    Read the article

  • PHP Echo A "/" Forwardslash?

    - by Jascha
    I'm very surprised I couldn't find this question here, which makes me very sure it is here and I just didn't see it. Regardless, I'll ask again. How do I echo a forwardslash "/"? echo <?php echo $_SERVER['HTTP_HOST'] ?> . '/directory/'; Thanks -J

    Read the article

  • How Can I Detect A Data Type in AS3

    - by Jascha
    I'd like to make a call to a function and send either a string or an integer... function getImage(val:*):void{ if(val == String){ switch(val){ case'next': loadNext(); break; case'prev': loadPrev(); break } } }else{ loadImg(val); } } and vary my function accordingly... anyone know how to detect the parameter type? Thanks -J

    Read the article

  • Would a Socket Connection Outperform an Intarvaled Database Sweep and Requests?

    - by Jascha
    I'm building a small chat application to add to an existing framework. There will only be 20-50 users MAX at any one time. I was wondering if I could get away with updating a cache file containing (semi) live chat data for whichever users happen to be chatting just by performing timed queries and regular AJAX refreshes for new data as opposed to learning how to open and maintain a socket connection. I'm sure there are existing chat plug-ins out there. But I just had a hell of a time installing one and I could see building the whole damn thing taking just as much time as plugging one in. Am I off to a bad start? Thanks in advance -J (p.s. this is a semi closed network behind a php login so security isn't a great concern)

    Read the article

  • PHP Form Security With Referer

    - by Jascha
    I'm putting together a site that will make itself available for user input. I was wondering if writing a function like: if(getenv("HTTP_REFERER") != 'http://www.myURL.com/submitArea'){ die('don\'t be an jerk, ruin your own site'); }else{ // continue with form processing } is enough to prevent cross site form submissions.

    Read the article

  • jQuery Set Child CSS Attribute Problem

    - by Jascha
    I have a child element of a div named "bob" that's class is '.divTitle' <div id="bob"> <div class="divTitle"> <a href="#"> <h1>Title</h1> </a> </div> </div> I am trying to set the background color of "divTitle" to red but for the life of me can't get this to work. Right now I am trying two things... $('#bob').children('.divTitle')[0].css('background-color', '#0f0'); // assuming children is returning an array... and $('#bob').children('.divTitle').css('background-color', '#0f0'); neither with any success... can anyone tell me what I am missing here? Do I have to go deeper than ".children"?

    Read the article

  • IE Not Picking up Blur Event (jQuery)

    - by Jascha
    I did a quick search, but couldn't find a specific solution to this (I'm sure it HAS been answered) but, I need to figure this out... Anyone know why this won't work in IE? $(document).ready(function() { $(document).blur(function() { window.close(); }); }); And what to do instead? Thanks.

    Read the article

  • Textarea Adding Space To Beginning of Text?

    - by Jascha
    I'm having a strange problem in that I have php inserting text into a <textarea> and the <textarea> is adding one white space to the top of my text. I created an example page to display the problem... here it the code behind the page. <textarea style="width:600px;height:100px;"><?php get_film_info('main description'); ?></textarea> <br> <textarea id="mainDescription style="width:600px;height:100px;">Text just typed in</textarea> <br> <?php get_film_info('main description'); ?> You can see that without the <textarea> tag, the text does not include the indent. My database also reflects no indent, as well as the php output outside of the <textarea>... Any clue what could be going on? the sample page -J

    Read the article

  • AJAX Post Not Sending Data?

    - by Jascha
    I can't for the life of me figure out why this is happening. This is kind of a repost, so forgive me, but I have new data. I am running a javascript log out function called logOut() that has make a jQuery ajax call to a php script... function logOut(){ var data = new Object; data.log_out = true; $.ajax({ type: 'POST', url: 'http://www.mydomain.com/functions.php', data: data, success: function() { alert('done'); } }); } the php function it calls is here: if(isset($_POST['log_out'])){ $query = "INSERT INTO `token_manager` (`ip_address`) VALUES('logOutSuccess')"; $connection->runQuery($query); // <-- my own database class... // omitted code that clears session etc... die(); } Now, 18 hours out of the day this works, but for some reason, every once in a while, the POST data will not trigger my query. (this will last about an hour or so). I figured out the post data is not being set by adding this at the end of my script... $query = "INSERT INTO `token_manager` (`ip_address`) VALUES('POST FAIL')"; $connection->runQuery($query); So, now I know for certain my log out function is being skipped because in my database is the following data: if it were NOT being skipped, my data would show up like this: I know it is being skipped for two reasons, one the die() at the end of my first function, and two, if it were a success a "logOutSuccess" would be registered in the table. Any thoughts? One friend says it's a janky hosting company (hostgator.com). I personally like them because they are cheap and I'm a fan of cpanel. But, if that's the case??? Thanks in advance. -J

    Read the article

  • Javascript "Match" Function Not Returning Proper Results in Safari or IE (but yes in FF)

    - by Jascha
    Forgive me as this is a time sensitive issue and I will have to switch the site back in a few hours so the link will be bad... but: I am simply comparing two strings looking for a match with this function... I have an array of objects called linkArray and I need to match the .src of each object to a .src I send it (the src of the clicked image). if the the src of the image I clicked matches the src of an object in my array, I set a variable to the link string of that object and return true, letting my page know that the link is available. Now, this works great in FF. But not in any other browser and I can't figure out for the life of me why. I have set up a dialogue box to literally compare, by eye, the two strings that should at the very least throw the message "match". Can anyone see what I am missing here??? here is the link... http://7thart.com/Jewish-History-and-Culture/Jews-and-Baseball-An-American-Love-Story If you click any of the thumbnails on the left, you will activate the function. Again, I apologize as after a few hours I have to switch back to the original site and this link will be invalid. Thanks in advance for your help. (function below)... function matchLink(a){ for(var i=0;i<linkArray.length;i++){ var fixLink = '../' + linkArray[i]['src']; alert(fixLink + '\n = \n' + a); if(fixLink == a){ alert('match'); newLink = linkArray[i]['link']; return true; } } return false; } Note: The "match" will return on two of the images.. the initial image, and the first thumbnail on the left. The second thumbnail SHOULD match, and the third one SHOULD NOT match.

    Read the article

  • mysql data being inserted twice via php

    - by Jascha
    I can't for the life of me figure out why this function is causing multiple entries into my database table... When I run the function I end up with two records stacked on top of each one second apart here is the function: function generate_signup_token(){ $connection = new DB_Connect(); // <--- my database connection class $ip = mysql_real_escape_string($_SERVER['REMOTE_ADDR']); $sign_up_token = uniqid(mt_rand(), true); $_SESSION['signup_token'] = $sign_up_token; $sign_up_token = mysql_real_escape_string($sign_up_token); $query = "INSERT INTO `token_manager` (`ip_address`, `signup_token`) VALUES ('$ip', '$sign_up_token')"; mysql_query($query); } generate_signup_token();

    Read the article

  • Simple JPG/HTML Not Showing Up in iPhone

    - by Jascha
    I'm not familiar with iPhones wants and needs, nor do I have one, but a client wants a screen cap of his site to show up when an iPhone user comes around so I created an .htaccess redirect to an iPhone specific page with this bit of code... RewriteEngine on RewriteCond %{HTTP_USER_AGENT} iPhone RewriteCond %{REQUEST_URI} !^/iPhone/ RewriteRule .* /iPhone/ [R] And the html of the iPhone page... <html> <head> <title>Eatamadedia</title> </head> <body style="background-color:#858384;margin:0 auto;"> <img src="../images/iPhonePage.jpg"> </body> </html> The page redirects just fine, but the .jpg doesn't show up. I can't imagine a simpler page. Anyone know what could be preventing the image from displaying? Does the iPhone require headers? The site in question is http://eatamedida.com Thank you in advance for your input. -J

    Read the article

  • Custom PHP Framework Feedback

    - by Jascha
    I've been learning OOP programming for about a year and a half now and have developed a fairly standard framework to which I generally abide by. I'd love some feedback or input on how I might improve some functionality or if there are some things I'm overlooking. VIEW MODE 1) Essentially everything starts at the Index.php page. The first thing I do is require my "packages.php" file that is basically a config file that imports all of the classes and function lists I'll be using. 2) I have no direct communication between my index.php file and my classes, what I've done is "pretty them up" with my viewfunctions.php file which is essentially just a conduit to the classes so that in my html I can write <?php get_title('page'); ?> instead of <?php echo $pageClass->get_title('page'); ?> Plus, I can run a couple small booleans and what not in the view function script that can better tailor the output of the class. 3) Any information brought in via the database is started from it's corresponding class that has direct communication with the database class, the only class that is allowed direct to communicate with the database (allowed in the sense that I run all of my queries with custom class code). INPUT MODE 1) Any user input is sent to my userFunctions.php. 2) My security class is then instantiated where I send whatever user input that has been posted for verification and validation. 3) If the input passes my security check, I then pass it to my DB class for input into my Database. FEEDBACK I'm wondering if there are any glaringly obvious pitfalls to the general structure, or ways I can improve this. Thank you in advance for your input. I know there is real no "right" answer for this, but I imagine a couple up votes would be in order for some strong advice regarding building frameworks. -J

    Read the article

  • What's the best way to debug AJAX to PHP calls?

    - by Jascha
    I'm having a miserable time debugging one small function on my new project. Essentially I'm having a user log out via an AJAX call to my log out script on my server called "userfFunctions.php" I'm using AJAX so that I don't have the headache of writing more regex to match my mod_rewrites. Anyway, every so often, it seems as though my Post data just flat out dies and since the PHP is running behind the scenes, I feel like I have no way of finding out where the data flow is being disrupted. BTW This function works 19 hrs of the day. Here is the javascript function: function logOut(){ var data = new Object; data.log_out = true; $.ajax({ type: 'POST', url: 'http://www.mydomain.com/User_Validator', //<-- redirects to userFunctions.php data: data, success: function(data) { alert(data); // <-- a response is triggered but with no response data! } }); } the php side: if(isset($_POST['log_out'])){ echo 'alert this!'; } here is my awesome response:

    Read the article

  • Flash Overlapping HTML. CSS Problem In IE??

    - by Jascha
    HELP, this is a very unique problem and I can't for the life of me figure it out. My flash content is overlapping the HTML above it. This only happens if I've just launched IE after being restarted and goes away once I refresh the page. I even added a jQuery $(document).ready function that sets a margin between the html and the flash content to add 1px of space when the page is loaded. It's so hard to figure out, because once I refresh the page, it goes away. Any input GREATLY appreciated. Here is the site. http://www.californiaremodels.com (This only happens in IE) here is a screen shot of the problem.

    Read the article

1