Search Results

Search found 72 results on 3 pages for 'ggfan'.

Page 1/3 | 1 2 3  | Next Page >

  • What is the general process of web hosting?

    - by ggfan
    I want to upload my site public so people can use it. I am currently using a free PHP webhosting company that supports up to a certian amount. When sites that say they offer unlimited upload, data, etc for like $10/month, is that all you need to run a big site? Or how do I host a big site, if it gets popular?

    Read the article

  • Stuck on the logic of creating tags for posts (like SO tags)? (PHP)

    - by ggfan
    I am stuck on how to create tags for each post on my site. I am not sure how to add the tags into database. Currently... I have 3 tables: +---------------------+ +--------------------+ +---------------------+ | Tags | | Posting | | PostingTags | +---------------------+ +--------------------+ +---------------------+ | + TagID | | + posting_id | | + posting_id | +---------------------+ +--------------------+ +---------------------+ | + TagName | | + title | | + tagid | +---------------------+ +--------------------+ +---------------------+ The Tags table is just the name of the tags(ex: 1 PHP, 2 MySQL,3 HTML) The posting (ex: 1 What is PHP?, 2 What is CSS?, 3 What is HTML?) The postingtags shows the relation between posting and tags. When users type a posting, I insert the data into the "posting" table. It automatically inserts the posting_id for each post(posting_id is a primary key). $title = mysqli_real_escape_string($dbc, trim($_POST['title'])); $query4 = "INSERT INTO posting (title) VALUES ('$title')"; mysqli_query($dbc, $query4); HOWEVER, how do I insert the tags for each post? When users are filling out the form, there is a checkbox area for all the tags available and they check off whatever tags they want. (I am not doing where users type in the tags they want just yet) This shows each tag with a checkbox. When users check off each tag, it gets stored in an array called "postingtag[]". <label class="styled">Select Tags:</label> <?php $dbc = mysqli_connect(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME); $query5 = "SELECT * FROM tags ORDER BY tagname"; $data5 = mysqli_query($dbc, $query5); while ($row5 = mysqli_fetch_array($data5)) { echo '<li><input type="checkbox" name="postingtag[]" value="'.$row5['tagname'].'" ">'.$row5['tagname'].'</li>'; } ?> My question is how do I insert the tags in the array ("postingtag") into my "postingtags" table? Should I... $postingtag = $_POST["postingtag"]; foreach($postingtag as $value){ $query5 = "INSERT INTO postingtags (posting_id, tagID) VALUES (____, $value)"; mysqli_query($dbc, $query5); } 1.In this query, how do I get the posting_id value of the post? I am stuck on the logic here, so if someone can help me explain the next step, I would appreciate it! Is there an easier way to insert tags?

    Read the article

  • How do I prevent duplicate entrys to mySQL?

    - by ggfan
    On my site, I have a form that users fill out to become a member. They fill out name, bday, email, etc. Then when they click submit, the data gets into mySQL. But sometimes when a user clicks submit many times or refreshes the page, the data gets inputted to the database more than once. How can I prevent this? Is there a code I can use to only let one set of data get into the database? This is also a problem in my comment section. I allow uses to put comments on people's profiles. But when they abuse the refresh button or submit button, I get like 10 of the same comments. Thanks.

    Read the article

  • can I make this select follower/following script more organized? (PHP/Mysql)

    - by ggfan
    In this script, it gets the followers of a user and the people the user is following. Is there a better relationship/database structure to get a user's followers and who they are following? All I have right now is 2 columns to determine their relationship. I feel this is "too simple"? (MYSQL) USER | FRIEND avian gary cend gary gary avian mike gary (PHP) $followers = array(); $followings = array(); $view = $_SESSION['user']; //view is the person logged in $query = "SELECT * FROM friends WHERE user='$view'"; $result = $db->query($query); while($row=$result->fetch_array()) { $follower=$row['friend']; $followers[] = $follower; } print_r($followers); echo "<br/>"; $query2 = "SELECT * FROM friends WHERE friend='$view'"; $result2 = $db->query($query2); while($row2=$result2->fetch_array()) { $following=$row2['user']; $followings[] = $following; } print_r($followings); echo "<br/>"; $mutual = array_intersect($followers, $followings); print_r($mutual); **DISPLAY** Your mutual friends avian Your followers avian You are following avian cen mike (I know avian is in all 3 displays, but I want to keep it that way)

    Read the article

  • How does this Switch statement know which case to execute? (PHP/MySQL)

    - by ggfan
    Here is a code form a PHP+MySQL book I am reading and I am having trouble understanding this code. This code is about checking a file uploaded into a database. (Please excuse any spelling errors if any, I was typing it in) Q1: How does it know which case to echo? In the whole code, there is no mention of each case. Q2: Why do they skip case 5?! Or does it not matter which numbers you use(so I can have case 1, case 18, case 2?) if($_FILES['userfile']['error']>0) { echo 'Problem: '; switch($_FILES['userfile']['error']) { case 1: echo 'File exceeded upload_max_filesize'; break; case 2: echo 'File exceeded max_file_size'; break; case 3: echo 'File only partially uploaded'; break; case 4: echo 'No file uploaded'; break; case 6: echo 'Cannot upload file: no temp directory specified'; break; case 7: echo 'Upload failed: Cannot write to disk'; break; } exit; }

    Read the article

  • What is the general process of web hosting?

    - by ggfan
    I want to upload my site public so people can use it. I am currently using a free PHP webhosting company that supports up to a certian amount. When sites that say they offer unlimited upload, data, etc for like $10/month, is that all you need to run a big site? Or how do I host a big site, if it gets popular?

    Read the article

  • Can you do RSS feeds on a local server? (PHP)

    - by ggfan
    I am using XAMPP and was wondering if I can code my site to include RSS feeds. Would the codes work and can I test it if I am working on a local server? I am practicing using the OReily head First PHP/Mysql book and I'm on the chapter on RSS and getting RSS videos from youtube.

    Read the article

  • How do you write "Select (all) From (table) Where posting=$posting except this posting? (Mysql)

    - by ggfan
    I want to write a Mysql statement that selects all from a table(posting) where title is like $title except for the title of $title. Basically I want to display all related posting of a certain posting. I want the query to select all the postings in the table that has the title name in the title and detail. But I don't want the posting to display in the related postings. $query="Select * From posting Where title,detail, like %$title% except $title"; how do I write the except part?

    Read the article

  • How should I go about creating a point system for users like SO and yahoo answers?(PHP)

    - by ggfan
    I am creating a voting system for a Q&A site project in which if a user asks a question, he/she losses -5 points; answer a question +5, vote a question +1, etc. (kind of like SO and yahoo answers) --To create the basic arithmetic, I have a "users_points" table that relates the user_id and their total points. +---+---------+ | 1 | 100 | +---+---------+ | 2 | 54 | +---+---------+ --Basically if the users does certain task, it would + or - the points. How do I prevent users from say voting an answer up 100 times. ex: I want a user to be only able to vote once per question, etc.

    Read the article

  • What's the best way to transition to MVC coding?

    - by ggfan
    It's been around 5 months since I picked up a PHP book and started coding in PHP. At first, I created all my sites without any organizational plan or MVC. I soon found out that was a pain.. Then I started to read on stackoverflow on how to separate php and html and that's what I have been doing ever since. Ex: profile.php <--this file is HTML,css. I just echo the functions here. profile_functions.php <--this file is mostly PHP. has the functions. This is how I have been separating all my coding so far and now I feel I should move on and start MVC. But the problem is, I never used classes before and suck with them. And since MVC (such as cakephp and codeigniter) is all classes, that can't be good. My question: Is there any good books/sites/articles that teaches you how to code in MVC? I am looking for beginner beginner books :) I just started reading the codeigniter manuel and I think I am going to use that. When I looked at the example MVC, they use different PHP coding. When I start coding in MVC, would I have to learn a "new" way to code? Because right now I am coding in pure basic PHP.

    Read the article

  • What's the easiest/fast way to get my website up and running on the web?

    - by ggfan
    This is probably a really really beginner's question, but I would like to know what's the fastest way to get my site on the web so that people can start using it. I'm learning everything about programming out of books and at home so I don't have much experience. --Before I go to like godaddy.com or such site to get a domain name, is there any free sites that would allow me to upload my site so users can use it? I have html,css,php,mysql,javascipt in my scripts so I don't think many sites allow free uploads with such languages. --If I can't find a free site, is there any good places to get a domain name and web hosting that supports most languages at a low price? (doesn't have to be professional hosting because I am still a beginner) --If I go to say godaddy.com and get their webhosting and domain name, would I be allowed to run php,mysql,python,java on it? (I looked at some hosting sites and most only allow php/mysql)

    Read the article

  • How can I hide a $_GET variable to be more secured in PHP?

    - by ggfan
    So far all my sites use mostly $_GET's to get the data for a page. Ex: editad.php?posting_id=131 editaccount.php?user_id=2 --is there a way to hide or be more secured about what the user can see? I don't want them to be just able to say type "editad.php?posting_id=40" in the URL. I know I can use POSTS, but is there a way for GETs or not? --How can I be more more secured?

    Read the article

  • Is Programming or web designing a site harder? [closed]

    - by ggfan
    Given that someone has almost an equal understanding of coding(java, php, etc) and web designing(css, xml, photoshop) and wants to create a functional site. Which generally would be more time-consuming. There is obviously lots of considerations...but in general Just curious, because i am learning everything from books and now putting coding and design into practice and the css is kicking my *.

    Read the article

  • How do I impliment a hidden field in a post form so users can't accidentally double post? (PHP/Mysql

    - by ggfan
    When users submit a form, they will sometimes click refresh or backspace then resubmit which causes multiple entries in mysql. How can i prevent mysql from allowing more than 1 of the same entry? People suggested a hidden field with a value, but how do I use that? <label for="state" class="styled">State:</label> <input type="text" id="state" name="state" value="<?php if (!empty($state)) echo $state; ?>" size="30" /><br /> //a hidden field of a certain value? ________________________________________ <input type="submit" value="Post Ad!" name="submit" /> //php to insert to mysql $query4 = "INSERT INTO posting (state) VALUES ('$state')"; mysqli_query($dbc, $query4);

    Read the article

  • What some good PHP jobs?

    - by ggfan
    I am no professional PHP coder or anything, in fact I am fairly new. I can develop sites but nothing too crazy or fancy with PHP,Mysql,CSS,HTML,javascript. Up to now, all I have been doing is practice coding from books and websites. I am now looking for a 'real-life' experience. Besides going to a company and getting an interview, are there any other options in which I can get paid to code? I have posted some ads on craiglists but that's about it. And because this is my first time going to the 'real-word' and can make mistakes, am I liable if...a site I made for someone gets hacked and that person losses information?

    Read the article

  • Do all header("Location: member.php?id=$username") have to be the first thing in a script? (PHP)

    - by ggfan
    I know in the Manuel it says that the header has to be the first thing in a script, but how come I see some codes where header("Location: member.php?id=$username") is in a if-statement? Ex: //a bunch of codes above if($result!="0"){ // authenication correct lets login $_SESSION["password"] = $password;; $_SESSION["username"] = $username; header("Location: member.php?id=$username"); } else { echo "Wrong username or password. Please try again!"; } But when I do this, it sometimes would/won't throw an error. How do I allow the header (); to be used in a script without any errors? I want to redirect the user back to the login if they click "no" and to the homepage if they click "yes".

    Read the article

1 2 3  | Next Page >