
creata.physics
Members-
Posts
261 -
Joined
-
Last visited
Never
About creata.physics
- Birthday 05/22/1990
Contact Methods
-
Website URL
http://zextcms.com
Profile Information
-
Gender
Male
-
Location
Arkansas
creata.physics's Achievements

Member (2/5)
0
Reputation
-
Ultimate Battle Online: Testers needed for v2.0
creata.physics replied to deth4uall's topic in Beta Test Your Stuff!
do you have a demo account set up with a demo pin? Registration page says: Before you can continue registering you will need to choose how you will continue registering an account. With no options to follow. Can't really test anything without access to the script. Okay, noticed that register link on the index page takes me here: http://testing.ultimate-battle-online.com/main/start/ Should take me here: http://testing.ultimate-battle-online.com/main/register/ Registration failure, after form was process I recieved this error: Fatal error: Call to undefined function remove_invisible_characters() in /home/uboeleme/Obsidian-Moon-Engine/classes/core_security.php on line 112 -
Showing progress bar after search query
creata.physics replied to MrXortex's topic in PHP Coding Help
I show loading images for my javascript codes that request data using the ajax function provided. This is how I'd show a progress bar on a simple click function that makes an ajax call: $(document).ready(function () { // Once the item with the id, div_id_that_triggers_function is clicked, we'll start running the function $('body').on('click','#div_id_that_triggers_function',function () { // Show the normally hidden loading bar $("#loading").fadeIn("slow"); $.ajax({ url: "index.php", // This can also be GET, depending on how your script is set up type: "POST", data: { value: 1 }, cache: false, success: function (data) { // Once the function is successfully ran, finish up by removing loading bar $("#loading").fadeOut("slow"); } }); return false; }); }); First thing I do is start showing the loading bar when the function starts. Loading is just an empty div, <div id="loading"></div>. The css has the display property set to none so it isn't shown unless I have it fadeIn() with jquery. You'll of course need to change the data values to fit your script, and load, append, prepend, etc whatever you need upon completion. Know that I'm very new to javascript so my method may not be the best or practical, but it does work as is quite simple. -
PHP Manual said this: If PHP has decided that filename specifies a local file, then it will try to open a stream on that file. The file must be accessible to PHP, so you need to ensure that the file access permissions allow this access. If you have enabled safe mode, or open_basedir further restrictions may apply. So if safe_mode or oben_basedir is enabeld then you'll have some issues and there are some workarounds, though I think if safe mode is on you'll get an error specific to that.. Also, please double check your permissions, I don't think it is likely that this issue is related to actual code. It's most likely going to have to do with permissions, just like the error states. This is of course in addition to kickens post, so start of with what he suggested.
-
Simple OOP question: best practice for site-wide constants
creata.physics replied to johnsmith153's topic in PHP Coding Help
Zend Framework uses a registry to store objects and data, which is like using globals. Here's some useful information: http://www.phppatterns.com/docs/design/the_registry -
under $check, can you add: print_r($check); underneath, copy&paste the output into something like phpmyadmin, and see what the results are. it will give you the error if any. it will also help you determine if the session club and team are set.
-
well, your php's logic is kind of weird on one spot. i removed an unnecessary redirect. i also cleaned up your code a bit so it can be read a bit easier. i commented out the redirect that doesn't make sense. if you don't understand it, feel free to ask what you don't understand. <?php session_start(); $email = $_SESSION['email']; $email = mysql_real_escape_string($_POST['email']); $password = mysql_real_escape_string($_POST['password']); if(!empty($email) && isset($email) &&!empty($password) && isset($password)) { $password = md5("$password"); require "includes/init/db_con.php"; $query = mysql_query("SELECT * FROM users WHERE email = '$email'"); $numrows = mysql_num_rows($query); if($numrows != 0) { $row = mysql_fetch_assoc($query); $dbemail = $row ['email']; $dbpassword = $row ['password']; if($dbemail === $email && $dbpassword === $password) { $_SESSION['email'] = $dbemail; header("location: http://localhost/control/home.php"); } else { // Login failed because email or password did not match header('Location: login.php?login_failed'); } } else { // Log in failed because the sessions email did not match a user record? #header('Location: login.php?login_failed'); } } require "includes/overall/header.php"; if($_GET['login_failed']){ echo "Login Box will appear with messages"; } require "includes/overall/footer.php";
-
Why add $_POST at the end of a validation function?
creata.physics replied to eldan88's topic in PHP Coding Help
Hello eldan88. Since check_required_fields() is a custom function with its own paramaters made by the creator, it will only required those paramaters unless otherwise stated. So having $_POST as the second paramater when the function is being called is pointless and does nothing, you can remove it if that's what you're getting at. -
Loading data on click with jquery.
creata.physics replied to creata.physics's topic in Javascript Help
Thats a bunch haku. I've marked the topic as solved, your method actually shows the loading image when mine didn't, so I appreciate that a bunch. I have a question if you have the time. Why did you define the function clickListener() inside of function($)? -
Loading data on click with jquery.
creata.physics replied to creata.physics's topic in Javascript Help
I went ahead and looked at jquery's .load function and it seems appropriate. I'm now using this code which does work: $(document).ready(function(){ $(".buttonLoad").click(function() { $("#loading").html('<img src="images/loader.gif" />'); $(".result").load("index.php?component=roadmap&module=ajax&action=toggle"); $("#loading").hide(); }); }); I'm just not sure if this is the best way to go about this method. It doesn't seem like it's ajax. -
Hello friends. I've recently started to learn javascript because it is quite amazing and very necessary for what I'm doing. So I'm trying to just grab some basic concepts and build small test scripts using the jquery framework. What I've started on is a script that allows users to pull data from another page and output the content. I've been able to pull all data from my database and output it when clicking the input button. My issue is that, if I click the button more than once without refreshing the page, the script will only be called once. I want to have a button, once the button is clicked, a random username is outputted in a div. Here's what I got going on right now: <script type="text/javascript"> $.ajax({ url: 'index.php?component=roadmap&module=ajax&action=toggle', success: function(data) { $(".buttonLoad").click(function() { $("#loading").html('<img src="images/loader.gif" />'); $(".result").html(data); $("#loading").hide(); }); } }); </script> Load a random user from the databse. <input type="button" class="buttonLoad" value="Load!" /> <div class="result"></div> I'm using the function ajax() because the jquery framework said it is the function that underlies all ajax requests, which is what this is, so it seemed like my best bet. I'll also post the php code just in case: $random = $this->db->fetch_row("select user_name from zxt_users order by RAND() limit 1"); @header( "Content-type: text/html;charset=utf-8" ); print $random['user_name']; exit(); Like I said, the script does work, just once. I'm guessing the issue is with the function ajax() only allowing the same request once but I'm not sure which is why I'm here for help. If anymore information is required I'll be more than happy to provide it.
-
from what you're saying, you're still getting the success message even after submitting the form. this is a generic way to process form data and not show the form if it was submitted <?php if( isset( $_POST['process'] ) ) { // here you'll have all form submitted data print_r($_POST); echo '<br/>form submitted, data needs to be checked still'; } else { ?> <form action="" method="post"> <input type="text" name="somedata" /> <input type="submit" name="process" /> </form> <?php } if that doesn't help you with your situation, then yeah, go ahead and post the full code. if the code i posted doesn't do what you want, then make sure you clarify on exactly what you need to happen.
-
definitely not enough information here. you're saying you want a message to be added along with a users bet when created. well what is your database structure like? how do bets work? why can't you add an additional field into your sql table called message and store the content there? we need more code and more information, thanks.
-
break; is in the wrong spot. You need break after you set the value to the variable you want to return. Here's an example: $arr = array('one', 'two', 'three', 'four', 'five'); foreach( $arr as $val ) { echo $val; break; } You'll only get the first result that way, or the first result that matches your condition. So your code would look like this: $fl=getsomelist(); // gives an array $userList=''; foreach ($fl as $f) { if ( strlen($f) <= (200) ) { $userList .= $f; break; } }
-
Checking if data exists before adding to table?
creata.physics replied to ncncnc's topic in PHP Coding Help
you're right, i didn't even read the entire thread and just skimmed through it, definitely my fault. i really don't understand why I even come to these forums unless i'm fully capable, motivated and willing to help others. sorry for being a douche