premiso
Members-
Posts
6,951 -
Joined
-
Last visited
-
Days Won
2
Everything posted by premiso
-
It is not really hardcoding it. That is how it should be done. If that variable has not been set you do want it defaulted, since HTML/FORMS can be modified/submitted from remote sites it is better to do this in the code that you know will set it and it will work properly. It is also good to set it like I showed, I know it is a major undertaking, but the security aspect alone should be worth it. I mean think if someone finds an exploit and jacks up your major files or finds a way into your DB and screws that up. It is well worth the security to do it right than to not. And if it was done right, with defined variables like I showed above, you would know where/why the value is not getting a value. As it is you are just playing a guessing game because you do not know if a COOKIE has been set for rec_access that overwrites the post data somewhere of if the user is simply passing it as a get string with their own sql injected value. In my opinion, since it obviously would help you out here, I would fix the code, even if it is just 1 page at a time. As such, if you want to update to PHP 6 in the near future (less than 2 years my bet) you will have to do the re-code as register_globals is being removed completely from PHP with no option to turn it on. /end rant/
-
Warning: Cannot modify header information - headers already sent
premiso replied to skylineview's topic in PHP Coding Help
I do not know why you are going in and out of php for an include, but try this: Change: <?php virtual('/Connections/bday.php'); ?> <?php if (!function_exists("GetSQLValueString")) { To: <?php virtual('/Connections/bday.php'); if (!function_exists("GetSQLValueString")) { And see if that gets rid of the header error. -
<?php // Get the search variable from URL $var = isset($_GET['q'])?$_GET['q']:''; // use isset instead of @ operator as @ just suppresses errors which should not be done $trimmed = trim($var); //trim whitespace from the stored variable $prevs = 0; // define $prevs since it is used later on to prevent a notice error message. It is often good practice to define your variables that may or may not be initiated but used in the script. That should remove the notice error for that variable.
-
How are you grabbing $rec_access from the form after it is submitted? Are you just calling $rec_access if so this means that you had register_globals turned on at one point and it was probably disabled due to a huge security flaw in it. Instead you need to assign $rec_access before you use it like below, assuming the form data is POST'ed: $rec_access = isset($_POST['rec_access'])?$_POST['rec_access']:null; This will check if that variables has been set if so it assigns $rec_access to that variable, if not it defaults it to null.
-
As was pointed out above: echo " <a href=\"{$_SERVER['PHP_SELF']}?s=$prevs&q=$var\"><< Prev 10</a>  "; Notice the { and } around $_SERVER['PHP_SELF']
-
And I think you meant // remove and combine below $query = mysql_query("SELECT id FROM members WHERE username = '$findit'"); // remove and combine like below $result = mysql_query($query); $result = mysql_query("SELECT id FROM members WHERE username = '$findit'"); So this is what the first part of the code should look like for it to work <?php session_start(); include "connection.php"; $findit = $_SESSION['id']; $result = mysql_query("SELECT id FROM members WHERE username = '$findit'"); $result = mysql_result($result, 0, 0); $sql = mysql_query("SELECT imgpath, item_name FROM member_trades WHERE user_id = '$result'"); echo "<table border='0' CELLPADDING=5 STYLE='font-size:16px'>"; echo "<table border=1><tr><td><H3>Image </h3></td> <td><H3>Item Name</H3></td></tr>"; while ($row = mysql_fetch_array($sql)) It was late at night when I looked at it, easily missed
-
Doesn't surprise me I always had to do that in Pre-Calc to keep my orders or operations correct or else I would screw something up. It just kept me straight. My teacher was always bugged by it, but he could not dock me cause it got the right solution. I am decent with math, I just suck at organization lol. You see, I would have written that like: $some_formula_result = (($random_number + 4) * 4); and that is what confuses corbin about my style.
-
To help elaborate nrg_alphs's point Go Here
-
So it is a loop causing issues. I would test those loops and make sure that they are as efficient as they can be. Add some debugging in there so you can see how many times the loop actually runs etc and what type of content is being pulled out. As that is your issue.
-
$query = "SELECT id FROM members WHERE username = '$findme'"; $result = mysql_query($query) or die("SQL WAS: {$query}<br />ERROR WAS: " . mysql_error()); See what the shows you. Causes there is an error in your sql.
-
http://www.usernameslist.com/products.php It will cost ya, but there ya go. It is possible.
-
What exactly does this script do? It seems like it goes into an infinite loop sometimes or loops that take too long and eat up memory. Does it deal with images at all? How about creating complex arrays, or uses a bunch of loops that are done dynamically....We do not have the insight to really help you out with this error.
-
I do not see where $y, $x or $m are being set. So of course it would not work...
-
[SOLVED] Any api to integrate with GoDaddy?
premiso replied to CarbonCopy's topic in PHP Coding Help
Godaddy API Looks like there is nothing solid set but there are a few scripts out there. You just have to find the one that works for you. -
I always do math operations inside parans. Just a habit. Even in my math classes since I have learned what the parans did and got marked for not using them I just do it. Order of Operations is how I see it. Having them in there for math operations is nice because you know what you write should be executed in the right order. But I only use it on math operations.
-
Lmao just wait till you get to college. $150-$300 per book. If that book was for a college course, it would really be considered cheap.
-
Nope.
-
Data Encryption Standard
-
Never used this function but you can look into crypt. You can also look into using Mcrypt Ciphers and see if you cannot get them to work.
-
My bad. <?php $genres = array ( 'Comedy' => array("Superbad", "Yes Man", "Anchor Man"), 'Horror' => array("Texas Chainsaw Massacre", "People Under The Stairs", "Slither"), ); foreach($genres as $genre => $movies){ echo "<p>$genre:</p>\n<p>"; $i=1; foreach ($movies as $num => $movie) { echo "{$i}: {$movie}<br />\n"; $i++; } echo "</p><br />"; } ?> Should take of it. Sorry about that.
-
<?php $genres = array ( 'Comedy' => array("Superbad", "Yes Man", "Anchor Man"), 'Horror' => array("Texas Chainsaw Massacre", "People Under The Stairs", "Slither"), ); foreach($genres as $genre){ echo "<p>$genre:</p>\n<p>"; $i=1; foreach ($genre as $num => $movie) { echo "{$i}: {$movie}<br />\n"; $i++; } echo "</p><br />"; } ?> Should do it.
-
$total = ($amount * $quantity);
-
PHP Newbie - Need Help with Registering a User form
premiso replied to mtnmchgrl's topic in PHP Coding Help
Kind of, not really. You do a strlen with $uName and $pass, but you are not checking it or using it in an If statement anywhere. strlen returns the length of the string. Also you are passing $uName and $pass as parameters, why are you setting them to get inside the function? Third, you are calling checkForNameAndPass within itself and in an if statement. It will never return a value and as such will cause an infinite loop when called. Forth the $fh is equaled to open, it should be fopen. As for the checking I would use file to read in the current file if it is allowed, as that would put each line into an array and allow you to loop through it testing if the username/password combination is there. Some advice, I think you need to pay more attention to your brackets, as the "echo "It Works" line is outside of that if, so no matter what it will echo the it works line, and no action is being done inside that if. The function, checkfornames... I do not see where the function ends (no ending bracket). Well hope that helps you a bit more. -
$message = "name: $name, \n email: $email, \n phone: $phone, \n comapny name: $companyname, \n Ideal Customer: $idealcustomer, \n Product or Services: $productservices, \n Main Competition: $maincompet, \n How You Differ From Competition: $differcompet, \n Services Needed: $needdone, \n Looking For: $lookingfor, \n Need Done By: $doneby, \n Anything Else: $anythingelse"; For the spamming, look into ReCaptcha.
-
It is, I used to have a pay site for Verizon and ATT (when texting first started out) where a user could get an MP3 Ringtone from my site sent to their phone for $1 a ringtone. It worked out well with the texting and getting the email headers right. But once texting got really big I could not keep up with it (all the different carriers some allowed ringtones others did not) etc. So I stopped it.