TheEddy
Members-
Posts
32 -
Joined
-
Last visited
Never
Everything posted by TheEddy
-
And how does one exactly use a framework? If I am going to make an application for others to use as well, is it a good idea to develop it in a framework?
-
Recaptcha has been cracked and bots can now get past it.
-
I am leaning towards Zend but is it worth my time? Don't I also have to pay yearly to be able to use their framework on websites?
-
I am a noob, what exactly are frameworks?
-
It was better for me to use this: function curPageURL() { $pageURL = 'http'; if ($_SERVER["HTTPS"] == "on") {$pageURL .= "s";} $pageURL .= "://"; if ($_SERVER["SERVER_PORT"] != "80") { $pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"]; } else { $pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"]; } return $pageURL; } $r=curPageURL(); $_SESSION['REFERER']=$r; Because I also needed to record the direct input from the browser. Thanks for your help though!
-
How does one use the HTTP_REFERER method?
-
I want people to login and then be redirected back to the page from where they came from. I was thinking that maybe I would have to use $_GET for 3 pages but I don't know if there is any easier way.
-
Nothing will appear unless I search for email and only one result when there should be two. If I search for email, I don't get the message that there is nothing there but no results are shown.
-
That doesn't work btw.
-
What does "\n" do?
-
if (mysql_num_rows($result) != 0) { print (" <ul> "); while ($row = mysql_fetch_assoc($result)){ print (" <li><a href=\"memberprofiles.php?uid=$uid\" title\"$userName\">$userName</a></li> "); exit; } print (" </ul> "); } else { print (" There were no results based on your criteria. "); } I don't know how I made that mistake where I had that equal to 1. But I don't know how to loop the results
-
This is what I have for results: $sql = "SELECT * FROM `users` WHERE `$searchField` LIKE '%$search%'"; $result = mysql_query($sql) or die(mysql_error()); $row = mysql_fetch_array($result); $userName = $row['userName']; $uid = $row['userID']; if (mysql_num_rows($result) == 1) { print (" <ul> "); while ($row = mysql_num_rows($result)){ print (" <li><a href=\"memberprofiles.php?uid=$uid\" title\"$userName\">$userName</a></li> "); exit; } print (" </ul> "); } else { print (" There were no results based on your criteria. "); }
-
$searchField would have been "emailAddress" and $search should have been "webmaster" and should have pulled: webmaster@test.com and webmaster@testing.com
-
$sql = "SELECT * FROM `users` WHERE `$searchField` like '%$search%'"; I still have to put in the EXACT value, it can't be similar.
-
It didn't work lol.
-
I want to submit a form using ajax so that the page doesn't have to reload. How do I do this?
-
Creating a log in script, accept username OR email
TheEddy replied to TheEddy's topic in PHP Coding Help
Thanks -
$sql = "SELECT * FROM `users` WHERE `emailAddress` = '".mysql_real_escape_string($_POST['email'])."' AND `password` = '".mysql_real_escape_string(md5($_POST['password']))."'"; I currently have it accepting just the email address but I want it to be the email address OR the username. How do I do this?
-
What doesn't work? If you echo $pageTitle in header.php it will work, unless header.php has already been included/required. I am an idiot, I see the problem now haha. I had: <title>$pageTitle</title> in header.php and it displayed $pageTitle as the title.
-
<script type="text/javascript"> var $J = jQuery.noConflict(); jQuery(document).ready(function($){ $J("#featured > ul").tabs({fx:{opacity: "toggle"}}).tabs("rotate", 5000, true); }); // Use Prototype with $(...), etc. $('div').hide(); </script> Like that?
-
<?php $pageTitle='Edit Profile'; require_once ("header.php"); ?> How can I pass a variable like that through header.php? I know it doesn't work the way I have it.
-
would it work if he had <?php include ("www.website.com/cookie.php"); ?> ???
-
<?php require_once ("dbconn.php"); ?> <?php $userID = $_SESSION['userID']; $insert_query = 'UPDATE users SET aim="' . $_POST['aim'] . '", msn="' . $_POST['msn'] . '", yim="' . $_POST['yim'] . '", psnID="' . $_POST['psnID'] . '", xblGamertag="' . $_POST['xblGamertag'] . '", otherContact="' . $_POST['otherContact'] . '", WHERE userID = $userID;' mysql_query($insert_query); ?> It says I did something wrong but I can't find it
-
<?php if(!isset($_SESSION)) { session_start(); } // UNCOMMENT NEXT LINE TO PRINT THE $_SESSION ARRAY TO THE SCREEN . . . // echo '<pre>'; print_r($_SESSION); echo '</PRE>'; if(empty($_SESSION['userID']) || $_SESSION['authorized'] != true ) { header("Location: login.php"); exit; } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html lang="EN" dir="ltr" xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="content-type" content="text/xml; charset=utf-8" /> <meta http-equiv="refresh" content="5;url=editprofile.php"> <title>Saving Profile</title> </head> <body> <?php require_once ("dbconn.php"); ?> <?php $userID = $_SESSION['userID']; $insert_query = 'insert into users WHERE userID='$userID'( aim, msn, yim, psnID, xblGamertag, otherContact ) values ( "' . $_POST['aim'] . '", "' . $_POST['msn'] . '", "' . $_POST['yim'] . '", "' . $_POST['psnID'] . '", "' . $_POST['xblGamertag'] . '", "' . $_POST['otherContact'] . '" )'; mysql_query($insert_query); ?> Your profile has been saved! You will now be redirected from where you came from. <br /><a href="editprofile.php" title="Click here if you don't want to wait">Click here if you don't want to wait.</a> </body> </html> It creates a new record but I want it to update an existing one. It's an editprofile script.
-
Help with getting info from database from a session.
TheEddy replied to TheEddy's topic in PHP Coding Help
Had to also make some changes to the other code. Now it works. Thanks for the help!