Jump to content

Eggzorcist

Members
  • Posts

    214
  • Joined

  • Last visited

    Never

Everything posted by Eggzorcist

  1. I added //usage before the function but I still get the same error. Warning: Invalid argument supplied for foreach() in /Users/JPFoster/Sites/Event_Profiler/scripts/functions.php on line 213 Column count doesn't match value count at row 1
  2. So using the associative array method, how would I put the function together with the $_POST? I'm currently using addeventToPending($_POST['title'], $_POST['datepicker1'], $_POST['alternative1'], $_POST['timestart'], $_POST['datepicker1'], $_POST['alternative2'], $_POST['timefinish'], $_POST['Qdescription'], $_POST['elm1']); and this isn't working... Any tips? I like to assoc idea however. Thanks!
  3. For some reason this function isn't working and I'm not quite sure why... Here's the function code, it doesn't give me any error, but it goes to the else and outputs error and doesn't add anything to the database... I'm really not sure why not. Any help would be greatly appreciated. function addeventToPending($eventTitle, $from1, $from2, $fromtime, $to1, $to2, $totime, $quickDesc, $description){ $query = "INSERT INTO events (name, fromslashes, fromdisplay, fromtime, toslashes, todisplay, totime, quickdescription, pagedescription, sameday, status) VALUES ($eventTitle, $from1, $from2, $fromtime, $to1, $to2, $totime, $quickDesc, $description)"; $insert_query = mysql_query($query); if($insert_query){ echo "Your event was put up for approval."; } else { echo "Error"; } } Thanks!
  4. Perfect, I didn't know I needed to assign a value to it, works great. Thanks a lot for a quick easy solution!
  5. Well I'm making it disabled because it's connected to an javascript form, so depending what you put in field1, it will automatically fill in field2... So I'd like to keep it disabled. I've also tried to change it without the disabled and still did not value that specific $_POST.
  6. I seems like becausing I'm using javascript to load the data in those fields it doesn't set them properly... Does anyone know what to do to fix this problem?
  7. Okay I tried changing one to an enabled form and it gives me the same results...
  8. Well when I diable the notice, it doesn't define that variable. There's nothing different than any other of my variable but the it is a disabled field. I believe this is what's causing the problem. Is there a way to use a disabled field as $_POST variable?
  9. well this is the error I get. Notice: Undefined index: alternative1 in /Users/JPFoster/Sites/Event_Profiler/addevent.php on line 6 Notice: Undefined index: alternative2 in /Users/JPFoster/Sites/Event_Profiler/addevent.php on line 6 My php is if($_POST){ addeventToPending($_POST['title'], $_POST['datepicker1'], $_POST['alternative1'], $_POST['timestart'], $_POST['datepicker1'], $_POST['alternative2'], $_POST['timefinish'], $_POST['Qdescription'], $_POST['elm1']); } everything works well until it hits that erorr. The only thing that is different about those two variables is that it's a disabled field... Do I have to make it an active field? Because I really don't want to give people the option to change it. Thanks
  10. I'm unsure why this is happening, but it seems like the form isn't defining my $_POST which are disabled form. The reason it is disabled it is because the previous field is a ajax which auto fills the next one. but it seems its not defining that post because of that... here's my forms. <form method="post" action="<?php $_SERVER['PHP_SELF']; ?>"/> <p> Event TItle:<br /> <input type="text" name="title" id="title" /> <br /> <br /> From: </p> <p> <input name="datepicker1" type="text" id="datepicker1" value="Click here to select a date."/> <input type="text" disabled="disabled" id="alternate1" size="30"/> <br /> </p> <p>Event starts at: <em> <input name="timestart" type="text" id="timestart" size="15" /> </em><br /> <br /> To:</p> <p> <input type="text" id="datepicker2" value="Click here to select a date."/> <input type="text" disabled="disabled" id="alternate2" size="30"/> <br /> </p> <p>Event finishes at: <em> <input name="timefinish" type="text" id="timefinish" size="15" /> </em><br /> <br /> Quick Event Description:<br /> <textarea name="Qdescription" cols="30" rows="4" id="Qdescription"></textarea> <br /> <br /> Event Page Description:<br /> <textarea id="elm1" name="elm1" rows="15" cols="80" style="width: 50%" class="tinymce"></textarea> <br /> <br /> <input type="submit" name="save" value="Submit" id="submit" /> <input type="reset" name="reset" value="Reset" /> </p> </p> </form>
  11. I've tried this - but it seems it doesn't work for me. Maybe it's a php.ini setting or something. I'm using MAMP Pro. And for the form I use post and <?php $_SERVER['PHP_SELF'] ?> ?
  12. What is the easiest way to submit information through a submit button to execute a function? Thanks a lot.
  13. It's all in the same document besides the actual function is include(''). My action is <form id="reg" method="post" action="<?php $_SERVER['PHP_SELF']; ?>" >
  14. the session_timeout is in php.ini? also is there any alternative which could fix this issue?
  15. I'm a bit unsure why this problem is accuring. I've always used done some of my forms like this. but when I do if(isset($_POST['post_form'])){ register_user($_POST['username'], $_POST['password1'], $_POST['password2'], $_POST['email'], $_POST['clubname'], $_POST['clubposition']); } It doesn't work properly. It executes whenever I get on that page - and doesn't execute when I press the submit button. Any alternatives? thanks a lot
  16. How long can a text or a longtext data-type be? thanks
  17. I'm currently working on an application which would need html information to be stored within the sql database. What are the best data-types in order to make a long html code easy to execute. Thanks
  18. I'm developing an application which may have have a person on the same page writting something for quite a long period of time. I was wondering as my security is set up with sessions could these sessions die by the time you'd finish the form? Thanks
  19. So basically what I want to implement is a text editor similar like we have on the most forums. Though I want it to be very easy to add pictures move them around and mess around with cool text editor functions. However, nothing to crowded. I tried tiny mce but the extensive API is confusing me and I don't have the time to learn it. Thanks a lot.
  20. You can just integrate the images with a simple html-based echo within your php, that would be by far the easiest. However, for a smooth alternative I'd use a javascript/ajax system. Also you may want to consider preloading all images or else it'll take too long to load them all.
  21. Yes, thats the correct div id. <div id="oneerror"></div>
  22. Keep in mind that my ajax skills are fairly low. I'm trying to create a ajax login which will be used mostly for the error messages and if there is no error the php script will detect the sessions and will go to the first logged in page. All it seems to be doing is putting the $_GET in the url, I can't see why it won't work. html code <div id="oneerror"></div> <div class="onecontent"> <form name="loginform"> <label>Username: <input type="text" name="username" id="username" /> </label> Password: <label> <input type="password" name="password" id="password" /> </label> <input type='submit' id="submit" onclick=" ajaxFunction()" value="Login"/> </form> </div> ajax code // JavaScript Document function ajaxFunction(){ var ajaxRequest; // The variable that makes Ajax possible! try{ // Opera 8.0+, Firefox, Safari ajaxRequest = new XMLHttpRequest(); } catch (e){ // Internet Explorer Browsers try{ ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try{ ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP"); } catch (e){ // Something went wrong alert("Your browser is not compatible, please enable javascript."); return false; } } } // Create a function that will receive data sent from the server ajaxRequest.onreadystatechange = function(){ if(ajaxRequest.readyState == 4){ var ajaxDisplay = document.getElementById('oneerror'); ajaxDisplay.innerHTML = ajaxRequest.responseText; } } var username = document.getElementById('username').value; var password = document.getElementById('password').value; var queryString = "?username=" + username + "&password=" + password; ajaxRequest.open("GET", "scripts/login.php" + queryString, true); ajaxRequest.send(null); } //--> php login function code. <?php include('../function.php'); login_user($_GET['username'], $_GET['password']); function login_user($username, $password){ $username1 = secure_var($username); $password1 = md5(secure_var($password)); if ($username != NULL and $password != NULL){ $login_query = mysql_query("SELECT * FROM user_info WHERE username = '$username1' AND password = '$password1'"); $login_status = mysql_num_rows($login_query); if($login_status == 1){ echo "working"; set_login_sessions($username, $password); } else { echo "You have entered a wrong username and/or password."; } } else { echo "Please enter a Username and Password"; } } ?> thanks for any help.
  23. Well I don't think you will be finding any robotics in a php forum, though you can talk about ecommerce applications?
×
×
  • 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.