-
Posts
2,965 -
Joined
-
Last visited
Everything posted by mikesta707
-
I think this is a simple fix, but I can't find it
mikesta707 replied to GloryHorse's topic in PHP Coding Help
I can't see much wrong. it looks like you have an extra endif at the end of the page (maybe, but maybe not). I didn't really even see anythign wrong with the links... they looked exactly the same. What is the problem you are having exactly? -
I think this is a simple fix, but I can't find it
mikesta707 replied to GloryHorse's topic in PHP Coding Help
I see no difference... post the code maybe -
tabs for sure. ctrl+T ftw, but i've always prefered keyboard shortcuts over everything
-
Ok, I kind of understand what they are. Cross site scripting attacks, and they involve malicious code and yada yada yada But at the same time, I have no clue what XSS attacks are. Anyone willing to explain them? or show me a site that explains them pretty well? you can't yada yada sex...
-
I made a very simple Image board from scratch once. Kinda copied the wakaba format, but it was actually a lot easier than I thought it would be. Like Nightslyr said, start simple, but I would suggest that you code this as smartly as you can, so when you want to add new features, you don't have to rewrite a bunch of different stuff. good luck with the admin control panel =P
-
I would go with mod rewrite, but anyone can just view source the page, and see the source of the iframe
-
I see nothing glaringly terrible, except that you are using short php tags. Also, you should sanitize your input.
-
[SOLVED] Newbie looking for help before I pull out my hair
mikesta707 replied to deadline's topic in PHP Coding Help
if you want the IP address of the client just use $ip = $_SERVER['REMOTE_ADDR']; -
whats the if...else thing for variable usage?
mikesta707 replied to Jarod's topic in PHP Coding Help
ternary operator $var = (boolean expression) ? value if true : value if false; -
[SOLVED] How To Write 2 options for an if statement
mikesta707 replied to refiking's topic in PHP Coding Help
if ($pos !== false || $pos2 !== false){ -
you need to tell us what Database class you are using. or at least show the searchquery method. Without that information, any advice we could give would be shots in the dark. by the way you only need to use backticks when you are using reserved words in mysql
-
[SOLVED] PHP, Arrays & A Lot Of Confusion
mikesta707 replied to EternalSorrow's topic in PHP Coding Help
using include? -
How would you, create a timed survey or quiz.
mikesta707 replied to k21chrono's topic in PHP Coding Help
you can get a timestamp with the time() function. $timeStart = time(); When you submit the form on the processing page you could have $timeEnd = time(); obviously you will need to sent the start time to the next page (through a hidden field, a session, save it to a DB, etc.) -
i believe that it won't be sent. (IE you can check if its set via isset and that will tell you if it was sent or not) but I could be wrong.
-
If you are going to use cookies, be careful, because cookies are trivial to change. For a log in, I would suggest sessions, but for their login expiring, you could use a cookie (and obviously just refresh the cookie every time they go to a new page, or do something)
-
its been deprecated as of php 5.3.0 i believe. I don't think there is a stable release of PHP 6.0 besides the snapshot
-
[SOLVED] how do i display data on a page from mysql
mikesta707 replied to chris_s_22's topic in PHP Coding Help
don't you want a non encrypted id? and you never define $encrypted_id you can probably just do this $query = mysql_query("SELECT * FROM members WHERE id = '".$_SESSION['username']."'") and you cant do this $query = mysql_query("SELECT * FROM members WHERE id = '". $encrypted_id ."'"); $result= mysql_query ($query) or die ('id and session data dont match.'); you are trying to do a mysql_query with a mysql_query resource. either do this $query = ("SELECT * FROM members WHERE id = '". $encrypted_id ."'"; $result= mysql_query ($query) or die ('id and session data dont match.'); or this $query = mysql_query("SELECT * FROM members WHERE id = '". $encrypted_id ."'") or die("error message"); -
Implementing a twitter feed on my website.
mikesta707 replied to JonathanV's topic in PHP Coding Help
Twitter has an API for this specifically. check that out -
well you send the score or rank via ajax, and store it into a database. something like $score = $_GET['score']; $query = mysql_query("INSERT INTO score (rank) VALUES ($score)"); But i don't know you table structure so I can't be of much more help
-
[SOLVED] Simple validation function makes PHP to stop respond
mikesta707 replied to nvee's topic in PHP Coding Help
if you are taking the current() next() method, doing the following should work while($value = current($errors)) { // Specifically with the following line, how would I complete the $value within a while, or must I just do it like $value["0"]; which will then self populate the rest as the while is running? if(empty($value) { echo "do something ..."; } next($errors); } this is because you store the current value of the array into the variable $value. Basically, all that current does is return whichever element the internal array pointer is pointing at (read the php manual for more info on how this works) and next changes the internal pointer to the next element -
Help me with this wwarning "Warning:session_start()"
mikesta707 replied to co.ador's topic in PHP Coding Help
well more like <?php session_start(); ?> but yes -
Help me with this wwarning "Warning:session_start()"
mikesta707 replied to co.ador's topic in PHP Coding Help
Neither of those... put session_start() at the top of your page -
firstly, you should put quotes around the flag. Not required, but that is probably drawing a Notice message. secondly, look at what the error says "fopen cannot open directory" what do you think that means? you will need to make that directory before you add files to it. are you sure that directory exists?
-
Help me with this wwarning "Warning:session_start()"
mikesta707 replied to co.ador's topic in PHP Coding Help
you can't send headers before any output. the error shows where the output starts (in your case line 7) Cannot send session cookie - headers already sent by (output started at /home3/nyhungry/public_html/includes/header.php:7) put your php code that sends the header at the top of the page -
the enctype has to be multipart/form-data for file uploads to work. I don't quite get what your problem is though. do you have any code that is giving you problems? you said you are using Curl. Why are you trying to use Curl. is the upload happening on your server or someone else's