-
Posts
98 -
Joined
-
Last visited
Never
Posts posted by oliverj777
-
-
I can't seem to get my head around this ... I've never done DOMs before - Sorry
-
Hummm ... I've never really done this 'DOM' thing before -- give me a minute to play around
-
Well, the thing is, is that you need to retrieve the table ID (or whatever form of ID it is using) from the website. From there, you can get PHP to connect to the HTTP and find the particular table ID with a _GET and then simply do an echo
-
When you attempt to login, what happens? Do you get an error message from your script like 'You did not submit a correct username and/or password!' or does it look like it simply refreshes the page? Or what ...
-
I'll try my best to help you - but I'm not going to spoon feed you.
First thing I need to know is that are the tables in your SQL (college) already populated? By that, I mean do they already have data in them? Am I correct in thinking that you simply want to have them being placed from your SQL onto a nice organised table in which you can view on your browser?
-
Okay, I may of solved it. Just copy and paste this code and see if it works -->
<?php require_once( "_inc/glob.php" ); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head> <meta http-equiv="Content-type" content="text/html; charset=UTF-8" /> <title>radiPanel</title> <script type="text/javascript" src="_js/prototype.js"></script> <script type="text/javascript" src="_js/scriptaculous.js"></script> <script type="text/javascript" src="_js/validation.js"></script> <script type="text/javascript" src="_js/radi.js"></script> <style type="text/css" media="screen">@import url('_img/style.css');</style> </head> <body> <?php //This is what is causing the problem .. the script is checking to see if the person is logged in --> //if( $user->loggedIn ) { ?> <div style="width: 800px; margin: auto;"> <div> <div style="float: right; width: 500px; text-align: right; padding-top: 12px;"> Welcome, <strong><?php echo $user->data['fullUsername']; ?></strong>! </div> <big>radiPanel</big> </div> <div style="float: left; width: 200px;"> <?php $url = $_GET['url'] ? $core->clean( $_GET['url'] ) : 'core.home'; $query3 = $db->query( "SELECT * FROM menu WHERE url = '{$url}'" ); $array3 = $db->assoc( $query3 ); if( !$array3['usergroup'] ) { $array3['usergroup'] = "invalid"; } $query = $db->query( "SELECT * FROM usergroups ORDER BY weight ASC" ); while( $array = $db->assoc( $query ) ) { if( in_array( $array['id'], $user->data['uGroupArray'] ) ) { ?> <div class="box"> <div class="square menu" style="background: #<?php echo $array['colour']; ?>;" onclick="Radi.menuToggle('<?php echo $array['id']; ?>');"> <img id="menutoggle_<?php echo $array['id']; ?>" class="menutoggle" src="_img/<?php echo ( $array['id'] != $array3['usergroup'] ) ? 'plus' : 'minus'; ?>_white.png" alt="Toggle" align="right" /> <strong><?php echo $array['name']; ?></strong> </div> <div class="menuitems"<?php if( $array['id'] != $array3['usergroup'] ) { ?> style="display: none;"<?php } ?> id="mitems_<?php echo $array['id']; ?>"> <?php $query2 = $db->query( "SELECT * FROM menu WHERE usergroup = '{$array['id']}' ORDER BY weight ASC" ); $i = "a"; while( $array2 = $db->assoc( $query2 ) ) { ?> <a href="<?php echo $array2['url']; ?>" class="<?php echo $i; ?>"> <?php echo $array2['text']; ?> </a> <?php $i++; if( $i == "c" ) { $i = "a"; } } ?> </div> </div><br> <?php } } ?> </div> <br> <div style="float: left; width: 590px; padding-left: 10px;"> <?php if( !in_array( $array3['usergroup'], $user->data['uGroupArray'] ) ) { echo "Permission denied."; } elseif( !@include_once( $array3['resource'] ) ) { echo "Error has occurred looking for " . $array3['resource']; } ?> </div> <br clear="all" /> </div> <?php } // Below is what a unlogged in person will see - if you want, you may want to remove the below HTML --> //else { ?> <!------------ remove all this from here -------------> <div style="width: 500px; margin: auto;"> <big> Log in </big> <form method="post" action="" id="login"> <div class="box"> <?php /* if( $_POST['submit'] ) { try { $username = $_POST['username']; $password = $_POST['password']; $user->login( $username, $password ); echo $core->redirect( "?" ); } catch( UserException $e ) { echo "<div class=\"square bad\">"; echo "<strong>Error</strong>"; echo "<br />"; echo $e->getMessage(); echo "</div>"; } } */ ?> <table width="100%" cellpadding="3" cellspacing="0"> <?php /* echo $core->buildField( "text", "required", "username", "Username", "Your username." ); echo $core->buildField( "password", "required", "password", "Password", "Your password." ); */ ?> </table> </div> <div class="box" align="right"> <input class="button" type="submit" name="submit" value="Log in" /> </div> </form> </div> </div> <!----------------------- to here ------------------------> <?php echo $core->buildFormJS("login"); } ?> </body> </html>
-
When you click logout - does it take you back to the index.php (but shows as a blank page?)
-
PHP does not show up as a source code in a browser. All you will see is your HTML language. If you can see your PHP code within an editor (dreamweaver) then trust me ... its there. But like I said, PHP is not displayed in the source code from a browser, even if you 'save as' the web page, you will still not see any of the PHP code.
On to the problem, let me get my understanding correct. Am I right in thinking that your login script is missing a load of code, causing it not to function?
-
sweet --
I used the
$_POST['website_name'] = str_replace('www.', '', $_POST['website_name']);
works fine
-
This is my code so far:
if(isset($_POST['send'])) { $website_name = str_replace('www.', '', $_POST['']); $database->updateUserField($session->username, "website_name", $_POST['website_name']);
-
I tested it - and it didn't work -- any suggestions?
It still saves the www. into my SQL table??
-
I would test this but my FTP application keeps crashing :confused: -- It looks like it would work. For future reference, would that code search any text for 'www.' For example, if some user types in 'hellowww.' will that code also remove the 'www.' no matter where it is within the text, thus saving it as 'hello'?
Thanks
-
How is it not working - are you getting any error messages when you try and submit. Your problem is a bit faint.
Help me out here, explain what you want doing, and what it is currently doing.
-
Hello,
I have a field in which when a user types something into it, it saves it into a table in my SQL. But is it possible to remove a particular phrase from the field if the user enters it.
Example:
I have a text field that says 'please enter your website domain here'. The user then enters 'www.domain.com'. Is it possible for PHP to remove the 'www.' and only save the 'domain.com' to my SQL (bearing in mind that not all users may enter www.)
Here is the code for the text field:
<input name="website_name" type="text" class="text-box" id="website_name" value="<?php echo $website_name; ?>" size="24" />
Here is the code for the _POST:
if(isset($_POST['send'])) { $database->updateUserField($session->username, "website_name", $_POST['website_name']); }
(the code so far all works fine - I just want to add an extra 'variable', if you will, to the code)
Thanks for your help!!
-
Just figured it out.
Its:
<meta http-equiv="Refresh" content="3;url=<?PHP echo"progress.php?user=$session->username";?>">
-
Okay,
I would like to redirect my page within a specific time using java script:
<meta http-equiv="Refresh" content="3;url=<?PHP echo 'progress.php?user=';$session->username?>">
Basically, I would like it to redirect to this:
progress.php?user=$session->username
.
But it redirects to: progress.php?user=
Please help, thanks ...
-
Easy One - What is the symbol for or?
Example: && = and, right?
What is 'or'?
-
Again, does not display anything ... what the heck ... ahh don't worry about it, I'll just do it the cheap way 'error with username/password'
Cheers anyway guys
-
When i say its not working I mean that no error messages are being displayed at all ...
-
Humm,
Still not working ... I really don't understand what is going wrong
:wtf: :wtf:
-
Noooo, I'm only sending an error if the user has not ENTERED anything into the fields ...
Sorry for the misunderstanding
-
class Form { var $values = array(); //Holds submitted form field values var $errors = array(); //Holds submitted form error messages var $num_errors; //The number of errors in submitted form /* Class constructor */ function Form(){ /** * Get form value and error arrays, used when there * is an error with a user-submitted form. */ if(isset($_SESSION['value_array']) && isset($_SESSION['error_array'])){ $this->values = $_SESSION['value_array']; $this->errors = $_SESSION['error_array']; $this->num_errors = count($this->errors); unset($_SESSION['value_array']); unset($_SESSION['error_array']); } else{ $this->num_errors = 0; } } /** * setValue - Records the value typed into the given * form field by the user. */ function setValue($field, $value){ $this->values[$field] = $value; } /** * setError - Records new form error given the form * field name and the error message attached to it. */ function setError($field, $errmsg){ $this->errors[$field] = $errmsg; $this->num_errors = count($this->errors); } /** * value - Returns the value attached to the given * field, if none exists, the empty string is returned. */ function value($field){ if(array_key_exists($field,$this->values)){ return htmlspecialchars(stripslashes($this->values[$field])); }else{ return ""; } } /** * error - Returns the error message attached to the * given field, if none exists, the empty string is returned. */ function error($field){ if(array_key_exists($field,$this->errors)){ return '<div class="errormsg_index">'.$this->errors[$field].'</div>'; }else{ return ""; } } /* getErrorArray - Returns the array of error messages */ function getErrorArray(){ return $this->errors; } };
-
It logs me in when I type in the correct details, but if I miss any fields ... nothing appears
-
Okay, now it doesn't display any error at all ....
Can someone translate this PHP code for me?!
in PHP Coding Help
Posted
Please translate:
Thanks