premiso
Members-
Posts
6,951 -
Joined
-
Last visited
-
Days Won
2
Everything posted by premiso
-
echo "I'm using {$array['key']} for my searches."; // or echo "I'm using " . $array['key'] . " for my searches."; You need to properly use it when echoing, either by concatenation (2nd item) or by using { } to evaluate the array since it has single quotes inside of it.
-
Do you do any checking before running that statement? If not, there is your answer. You need to do a check before you run the insert statement.
-
Post the full path to the image here. Also post the full path to your script. Alternatively you can try this: $file = $_SERVER['DOCUMENT_ROOT'] . '/images/image_1.jpg'; And see if that works. That will give the correct absolute path to the image using the server variable.
-
Then the image does not exist, bad name or you still have the incorrect path. Simple as that. We, sadly, do not know how your server is setup and cannot help you further, you will have to take steps to debug this on your own.
-
checkdnsrr They validate if the MX record is valid for the email or not. Technically the email could still not exist.
-
[quote author=nrg_alpha link=topic=106377.msg1153553#msg1153553 date=1239080402] Which Rainbow Six game did you play? (more curious than anything else. I worked on Rainbow Six: Vegas as a modeler for the first level.. Mexico) [/quote] The first one. Back in 1998 on MLagger...err MPlayer along with Aliens Vs Predator. Good ol' days hacking MPlayer and taking "Sage" powers :)
-
[SOLVED] Problems with count and if staements!
premiso replied to andrew_biggart's topic in PHP Coding Help
Each time you post code you revert or change something completely. I do not know where you are getting your logic but it seems as though you keep disregarding any changes made. This is my last attempt to help. <?php include("config_contact.php"); $username=$_SESSION['myusername']; // Retrieve data from database $sql = "SELECT count(Blog_username) as blogcount FROM User_blogT WHERE Blog_username='$username' "; $result = mysql_query($sql); $row = mysql_fetch_assoc($result); // You have to have this for it to even work at all. // if($row['blogcount'] = 3) { // Single equals always amounts to true: if ($row['blogcount'] == 3) { // the double euqal is the comparison and should be used instead. echo "You are only allowed to Have 3 entries to your blog at any one time. If you would like to update your blog please delete one of the older entries."; } else{ echo" <form method='post' action='my_profile_blog_submit.php'> <table class='myprofile_blog'> <tr><td class='myprofile_subtext'>Subject :</td><td class='myprofile_blogsub'> <input name='Blog_subject' type='text' style='width: 413px' /></td></tr> <tr><td class='myprofile_subtext' style='width: 120px' valign='top'>Message :</td><td> <textarea name='Blog_message' style='width: 505px; height: 152px'></textarea></td></tr> </table> <br /> <br /> <br /> <table> <tr><td class='myprofile_changesh'>Add a new entry to your Blog ...</td><td class='myprofile_changesh'> </td></tr> <tr><td class='myprofile_subsub'>Add another entry to your blog. Please delete the older entries that are outdated and try and get it to a limit of 3 or 4 entries.</td></tr> <tr><td colspan='2'></td></tr> </table> <br /> <table class='myprofile_change'> <tr><td><input class='submit_blog' name='addblog' type='submit' value='Post that shit' /></td></tr> </table> </form> "; } ?> -
Call a function with parameters stored within a variable as a String.
premiso replied to tmh766's topic in PHP Coding Help
I am having a hard time understanding what the user is getting at. But why not use the call_user_func method? That is what it was intended for, from what I gathered on the OP. -
You have two ORDER BY's in your sql query. Alternatively, using mysql_query would have pointed this out. $result = mysql_query("SELECT * FROM TableName ORDER BY employee_id, date_created ASC") or die(mysql_error());
-
[SOLVED] Problems with count and if staements!
premiso replied to andrew_biggart's topic in PHP Coding Help
<?php include("config_contact.php"); $username=$_SESSION['myusername']; // Retrieve data from database $sql = "SELECT count(Blog_username) as blogcount FROM User_blogT WHERE Blog_username='$username' "; $result = mysql_query($sql); $row = mysql_fetch_assoc($result); if($row['blogcount'] > 3){ ... -
No errors here. Looks good, but could use something extra. Why not offer different types of citations with a radio button? MLA APA etc... Other than that, yea it is kind of just plain, like "nothing to see here...move along sir."
-
SQL Injection is the biggest one you want to watch out for: Read here Cross-site Scripting (XSS) Exploit is another issue: Read here For file uploading you really need to filter the names, as on some operating system a / is allowed but renders that file like a folder and is un-deletable or a ' can cause a file issue. So filtering that as well will save you some major headaches.
-
You should store it in the database in it's raw format (not as <br>) meaning the "\n" then use the function wildteen pointed out when retrieving the data from the database for displaying. Reason for this, you may want to use that data in something other than html output (xml, csv, text) etc. This way you can easily do what you want with the data as necessary.
-
[SOLVED] Problems with count and if staements!
premiso replied to andrew_biggart's topic in PHP Coding Help
$result = mysql_query($sql); $row = mysql_fetch_assoc($result); You never set $row to the result before you use it in the if statement. -
Trying to accsess String as an array in loop.
premiso replied to rkaganda's topic in PHP Coding Help
If I am not mistaken you would also need to use str_split to make the string an array. -
The best thing that helped me by far is the first 1-2 programming classes in college. They help you grasp the syntax and basic if/looping concepts. As far as no classes goes, I would just download code that I wanted to do on my own and look at how it runs, then re-design it and code it on my own. But as stated, tutorials help, actually writing code helps. But you need to understand the basic syntax, logic, conditions, operators, etc before you can really actually program/code. And do not jump into a major project, start simple (KISS Keep It Simple Stupid). If you want to make a forum, first learn how to store an entry posted in the database and displaying it. Then learn the user registration system...etc and keep building it a piece at a time.
-
Yea, I need to get to 7,000 just to beat out redarrow...but man is that tough! Time to start expanding the forums I post in! EDIT: I should also say, that I will not just post random stuff to get that milestone. My posts will still matter and be meaningful (for the most part )
-
IE 8 is supposedly going to be close to standards than any other. It may not fully comply, but that is where they are headed. Alternatively you can define statements in your code for different spreadsheets for IE 6 and 7 since they both display separately from each other and IE 8. But yes, IE 8 is suppose to comply with standards.
-
Found this figured I would post. I was playing a game online, Rainbow 6 I think and needed a user name. I looked up the greek definition of miso which means hate. Pre which means before. so premiso, before hate. Corny, but yea :)
-
assigning a value in if statement is not working
premiso replied to jeff5656's topic in PHP Coding Help
if (!empty($pt_name)){ $came = "This came from consult list"; } Use empty instead. -
if($find !== false) { Would be the correct way of doing it. Cause if size was 2, it would have returned a 0, which without the extra = is technically false. This was explained by Maq. Your code is never entering into the first if.
-
<td colspan='3' class='textm'><b>Message</b>:<br><br>".wordwrap(nl2br($row['msgtext']), 100, "\n", 1)." Would be where you would add it.
-
On displaying it in the 2nd page us nl2br on the data. That will solve the issue. As such, what you have posted really does not have much to do with how/where the data is displayed. That would have been better code to post.
-
<td width='85%' colspan='3'><textarea name='msgtext' cols='53' rows='7'><?php echo ($_GET['reply'] != "") ? "\r\n \r\n".$worked2['msgtext'] : ""; ?></textarea></td> Give that a try and see what comes of it. (Granted \n\n should have worked unless you are not making it clear on exactly what you want).
-
parse_url $url = "www.asdf.com"; $siteName = parse_url("http://{$url}"); $siteName = $siteName['host']; echo $siteName;