Jump to content

neverforget98

Members
  • Posts

    38
  • Joined

  • Last visited

neverforget98's Achievements

Member

Member (2/5)

0

Reputation

  1. Alright, well I tried this and it appears to not work due to the fact (I think) my table has data built in before the dispatcher even inputs anything. What about re-running the query (the SELECT * from uc_calls) without refreshing the page? How could I do this?
  2. I've search and searched Google but I just can't find anything. Can you point me in a direction?
  3. Hello, In the page I'm designing it is set to auto-refresh every 30 seconds using header(). However, sometimes I can get half-way through filling out the very little form and it reaches 30 seconds, refreshes the page and resets the form. Is there any way to have a prompt show up before the page refreshes IF the form has anything filled in? Thanks in advance! Brandin
  4. Hello, On one of the pages of the system I am coding there is a form to update the destination of one of the rows. Every row that has no destination has a form to update the destination. However, when you update the destination it updates it for every row that doesn't have a destination. This is the portion of the code, thanks: if($destination=='') { echo "<form method='post'> <td width='25%'><center><input type='text' name='destination_save2' placeholder='Destination Location' /><input type='submit' name='submit2' value='Update Call' /></center></td>"; if(isset($_POST['submit2'])) { $destination_save2=$_POST['destination_save2']; $result8=mysql_query("UPDATE uc_calls SET destination='$destination_save2' WHERE id=$id"); if(!$result8) { die('Failed to update call. Please contact your Technical Analyst with this error:<br />' .mysql_error()); } else { header("Location: ?"); } } echo "</form>"; } else { echo "<td width='25%'><center>$destination</center></td>"; }
  5. I'm quite obviously doing something completely wrong. It will just NOT work...here is my whole code. Please help. :/ I just wanna get it done, use it and store it as a resource...I've never felt so distructed by code in my life haha. <?php ob_start(); /* REMOVED REMOVED */ require_once("models/config.php"); if (!securePage($_SERVER['PHP_SELF'])){die();} require_once("models/header.php"); require_once("models/db.php"); echo " <header> <script type='text/Javascript'> function mySubmitFunc(f) { f.getElementById('submit_hidden).value=submit; f.submit(); } </script> </header>"; echo " <body> <div id='wrapper'> <div id='top'><div id='logo'></div></div> <div id='content'> <h1>Integrated Services</h1> <br /> <h2>Quick Lookup</h2> <div id='left-nav'>"; include("left-nav.php"); echo " </div> <div id='main'> <center> <br /><br /><br /> <form method='post'> <select name='qc2' onChange='mySubmitFunc(this.form);'> <option selected>Select a volunteer to lookup...</option> "; $result3=mysql_query("SELECT * FROM `regstaff` ORDER BY lname"); while($test = mysql_fetch_array($result3)) { $fname = $test['fname']; $lname = $test['lname']; $id = $test['id']; { echo "<option value='$id'>$lname, $fname</option>"; } } echo " </select> <input type='hidden' name='submit' id='submit_hidden'> <noscript><input type='submit' name='mySubmitButton' id='submit' value='Submit'></noscript> </form> "; if (isset($_POST['submit'])) { $qcontact=$_POST['qc2']; header("Location: quickcontact2.php?qcontact=$qcontact"); exit(); } echo "</div> <div id='bottom'></div> </div> </body> </html>"; ob_flush(); ?>
  6. I give up, I cannot get this to work. Thanks for trying though.
  7. My code is like that...you can see it on line 47... I tried this method but I must be doing something wrong. This is my code now: <form method='post'> <select name='qc2' onChange='this.form.submit()'> <option selected>Select a volunteer to lookup...</option> "; $result3=mysql_query("SELECT * FROM `regstaff` ORDER BY lname"); while($test = mysql_fetch_array($result3)) { $fname = $test['fname']; $lname = $test['lname']; $id = $test['id']; { echo "<option value='$id'>$lname, $fname</option>"; } } echo " </select> <input type='hidden' name='submit' id='submit_hidden'> <noscript><input type='submit' name='submit' value='Submit'></noscript> </form> "; document.getElementById('submit_hidden').value('submit'); if (isset($_POST['submit'])) { $qcontact=$_POST['qc2']; header("Location: quickcontact2.php?qcontact=$qcontact"); exit(); } When I go to the page it produces this error: Notice: Use of undefined constant document - assumed 'document' in /home/isoub/public_html/v4/qiucklookup.php on line 51 Fatal error: Call to undefined function getElementById() in /home/isoub/public_html/v4/quicklookup.php on line 51
  8. The submit button is clicked when users do not have Javascript enabled. What can a solution be for this?
  9. Actually, I've never ever had to use the action attribute on my form. Never had problems with that. It might be my problem, I dunno. And as you can see, I start the portion of the script you guys can analyze on line 31. My entire page (quicklookup.php) starts in PHP and ends in PHP. EDIT: I don't have to use the action attribute because the form is submitting to the same page. What do you mean by "hidden input"? Sorry, I wish I was as fancy as I think I am. :/
  10. It should usually be the server address. For example "server.domain.com" I don't believe you need to put a port unless it isn't the default port.
  11. Hey everyone, I'm trying to make everyones life easier by automating the submit function for our Dropdowns when they have Javascript enabled. But I just cannot get this script to work. You select a name from the dropdown populated from MySQL (that is $result3) but then when the name is selected (with Javascript enabled) the onChange function refreshes the page and doesn't appear to submit anything. It is supposed to submit to the same file and then the submit takes the values and pushes the individual to quickcontact2.php?qcontact=$qcontact but it won't do that. Help please, greatly appreciated! <form method='post'> <select name='qc2' onChange='this.form.submit()'> <option selected>Select a volunteer to lookup...</option> "; $result3=mysql_query("SELECT * FROM `regstaff` ORDER BY lname"); while($test = mysql_fetch_array($result3)) { $fname = $test['fname']; $lname = $test['lname']; $id = $test['id']; { echo "<option value='$id'>$lname, $fname</option>"; } } echo " </select> <noscript><input type='submit' name='submit' value='Submit'></noscript> </form> "; if (isset($_POST['submit'])) { $qcontact=$_POST['qc2']; header("Location: quickcontact2.php?qcontact=$qcontact"); exit(); } Thank ya'll!
  12. This is the error log: [Thu Feb 07 15:51:53 2013] [error] [client **.**.***.***] File does not exist: /home/isoub/public_html/sys_cpanel, referer: http://**.**.***.***/~isoub/login.php I did some reading up on the sys_cpanel thing and it is usually because the mod_userdir security feature is enabled, and it was, but I disabled it, and still am getting a 500 error, but there is nothing going into the error log now.
  13. I attempted this and I am still getting the same thing, no errors being displayed besides the request was not completed.
×
×
  • 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.