Search Results

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

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

  • What exactly is server and client side pagination?

    - by ggfan
    Is server side pagination where the pagination script calculates the number of entries in a database then make the links? All I know is server side is faster and better if there is alot of data and client side is using javascript? What makes a pagination script server or client side? Also, right now I am planning to use this pagination which is like digg-style. Can someone tell me if that is server-side pagination? (sorry if my terminology is off)

    Read the article

  • How do I go up a level in a doc root?

    - by ggfan
    I have a folder admin that has config.php, admin.php. I want to get navmenu.php in the includes folder. How do I go up a level from admin.php then to navmenu.php? admin config.php, admin.php includes navmenu.php easy question but I forgot what the name is so i can't seem to google it...

    Read the article

  • Are there any tutorial/guides to use firebug?

    - by ggfan
    I just got the add-on for firefox and it's awesome so far! But all I am doing is just moving the cursor around the page to get the css+html. And I know there are TONS more applications to firebug. Is there a beginner's guide to firebug since it's so popular or is it just something with practice?

    Read the article

  • How do I write this SQL statement to get the ad and posting? (PHP/MySQL)

    - by ggfan
    I am a little confused on the logic of how to write this SQL statement. When a user clicks on a tag, say HTML, it would display all the posts with HTML as its tag. (a post can have multiple tags) I have three tables: Posting--posting_id, title, detail, etc tags--tagID, tagname postingtag--posting_id, tagID I want to display all the title of the post and the date added. global $dbc; $tagID=$_GET['tagID']; //the GET is set by URL //part I need help with. I need another WHERE statment to get to the posting table $query = "SELECT p.title,p.date_added, t.tagname FROM posting as p, postingtag as pt, tags as t WHERE t.tagID=$tagID"; $data = mysqli_query($dbc, $query); echo '<table>'; echo '<tr><td><b>Title</b></td><td><b>Date Posted</b></td></tr>'; while ($row = mysqli_fetch_array($data)) { echo '<tr><td>'.$row['title'].'</td>'; echo '<td>'.$row['date_added'].'</td></tr>'; } echo '</table>'; }

    Read the article

  • How do I create a user history?

    - by ggfan
    I want to create a user history function that allows shows users what they done. ex: commented on an ad, posted an ad, voted on an ad, etc. How exactly do I do this? I was thinking about... in my site, when they log in it stores their user_id ($_SESSION['user_id']) so I guess whenever an user posts an ad(postad.php), comments(comment.php), I would just store in a database table "userhistory" what they did based on whenever or not their user_id was activate. When they comment, I store the user_id in the comment dbc table, so I'll also store it in the "userhistory" table. And then I would just queries all the rows in the dbc for the user to show it Any steps/improvements I can make? :)

    Read the article

  • how does "recent history" work on sites for php? (PHP)

    - by ggfan
    I'm not sure if there is an explanation on SO for beginners, but if so, could you provide the links. I am interested in creating a "recent viewed" function that shows what links they clicked on before. I'm not sure if this is the 'correct' way to do it, but this is what I have so far... user clicks on a link(say ad.php?posting_id=12). if the user doesn't click on the link, no cookie or session is stored for the link if the user clicks on the link, it sets a cookie for $_cookie['ad.php?posting_id=22'] Each time the user clicks, more cookies are set In the recent viewed function, it gets all the $_cookie variables and displays them. if the user wants to clear the history, just destroy all the cookies I'm not sure if this is the way to do it, but is the viable? If not, what are the steps to create a "recent viewed" function

    Read the article

  • How do I make a project in Django? Beginner

    - by ggfan
    Okay I just started with Django and it's totally different from PHP. I installed Python 2.6 and Django. Both are located in my C drive. C: Django build django docs Python26 I am doing the django site tutorial and when they say to write django-admin.py startproject mysite from my Python command line, I keep getting: Syntax error: invalid syntax >>>django-admin.py startproject mysite FILE "<stdin>", line 1 django-admin.py startproject mysite ^ My django-admin.py is in the django/bin folder. I installed Python via python setup.py. Am I suppose to use my window's CP? When I do that, I get window's can't open a .py file. I thought I was just creating a folder? How do I create a project with django? Thanks :)

    Read the article

  • Are frameworks really necessary for beginners/intermediates? (PHP)

    - by ggfan
    I have been programming for around 6months and currently learning PHP/Mysql. I can create basic functionally sites starting from a plain sheet of paper. Is it necessary I use frameworks to create sites? Currently, everything I do is from scratch. I'll borrow codes from old codes, ask people for help, etc. Are frameworks going to help me much more? Is it alright if I put a site public without using a framework? (I have not looked a lot into frameworks, so my knowledge is limited, but I'm just curious)

    Read the article

  • How do I use cookies to store users' recent site history(PHP)?

    - by ggfan
    I decided to make a recent view box that allows users to see what links they clicked on before. Whenever they click on a posting, the posting's id gets stored in a cookie and displays it in the recent view box. In my ad.php, I have a definerecentview function that stores the posting's id (so I can call it later when trying to get the posting's information such as title, price from the database) in a cookie. How do I create a cookie array for this? **EXAMPLE:** user clicks on ad.php?posting_id='200' //this is in the ad.php function definerecentview() { $posting_id=$_GET['posting_id']; //this adds 30 days to the current time $Month = 2592000 + time(); $i=1; if (isset($posting_id)){ //lost here for($i=1,$i< ???,$i++){ setcookie("recentviewitem[$i]", $posting_id, $Month); } } } function displayrecentviews() { echo "<div class='recentviews'>"; echo "Recent Views"; if (isset($_COOKIE['recentviewitem'])) { foreach ($_COOKIE['recentviewitem'] as $name => $value) { echo "$name : $value <br />\n"; //right now just shows the posting_id } } echo "</div>"; } How do I use a for loop or foreach loop to make it that whenever a user clicks on an ad, it makes an array in the cookie? So it would be like.. 1. clicks on ad.php?posting_id=200 --- setcookie("recentviewitem[1]",200,$month); 2. clicks on ad.php?posting_id=201 --- setcookie("recentviewitem[2]",201,$month); 3. clicks on ad.php?posting_id=202 --- setcookie("recentviewitem[3]",202,$month); Then in the displayrecentitem function, I just echo however many cookies were set? I'm just totally lost in creating a for loop that sets the cookies. any help would be appreciated

    Read the article

  • is there a way to show what field you updated in mysql?

    - by ggfan
    When users edit their account, I want to display a confirmation page that shows their updated information with the fields that they changed in bold. Is there a mysql statement that allows you to select the fields that a user changes? If not, how exactly can I achieve this Ex: (editaccount.php) first_name: bob last_name: builder email: [email protected] When they change say their first name to "james", the confirmation page shows their first name in bold because they changed that but the other areas are still normal text. first_name: <b>James</b> last_name: builder email: [email protected]

    Read the article

  • How do I get the Bake console for CakePHP?

    - by ggfan
    I am having trouble getting the Bake console. I am on windows running xampp. I'm doing the IBM cakphp tutorial. Here is my directory: C:\\ xampp htdocs ibm2(a test project--orginally called cakephp) app cake vendors (etc) It says to To use Bake, cd into the /webroot/app directory and launch the Cake Console: ../cake/console/cake bake. You should be presented with a screen that looks like Figure 2. So I write in my command prompt till I am at: C:\xampp\htdocs\ibm2\app Then I type ../cake/console/cake bake but I get this error: '..' is not recognized as an internal or external command, operable program or batch file. What am I doing wrong? I use the window's command prompt

    Read the article

  • Are Programmer Tutors worth the money?

    - by ggfan
    I am new to programming and I really want to improve my programming skills. As of right now, I am just reading books to learn. I can make basic sites using html,css,php,mysql. If I got a tutor, say just a experienced programmer who would like to teach me, would the money and time be worth it? The cost is around $30/hour. Or would just programming yourself and working with other like-minds(because I am in college) be the best way to learn?

    Read the article

  • Why does this sql statement keep saying it is a boolean and not a paramter? (php/Mysql)

    - by ggfan
    In this statement, I am trying to see if there if the latest posting in the database that has the exact same title, price, city, state, detail. If there is, then it would say to the user that the exact post has been already made; if not then insert the posting into the dbc. (This is one type of check so that users can't accidentally post twice. This may not be the best check, but this statement error is annoying me, so I want it to work :)) Why won't this sql work? I think it's not letting the title=$title and not getting the value in the $title... ERROR: mysqli_num_rows() expects parameter 1 to be mysqli_result, boolean given in postad.php on line 365 //there is a form that users fill out that has title, price, city, etc <form> blah blah </form> //if users click submit, then does all the checks and if all okay, insert to dbc if (isset($_POST['submit'])) { // Grab the pposting data from the POST and gets rid of any funny stuff $title = mysqli_real_escape_string($dbc, trim($_POST['title'])); $price = mysqli_real_escape_string($dbc, trim($_POST['price'])); $city = mysqli_real_escape_string($dbc, trim($_POST['city'])); $state = mysqli_real_escape_string($dbc, trim($_POST['state'])); $detail = mysqli_real_escape_string($dbc, trim($_POST['detail'])); if (!is_numeric($price) && !empty($price)) { echo "<p class='error'>The price can only be numbers. No special characters, etc</p>"; } //Error problem...won't let me set title=$title, detail=$detail, etc. //this statement after all the checks so that none of the variables are empty $query="Select * FROM posting WHERE user_id={$_SESSION['user_id']} AND title=$title AND price=$price AND city=$city AND state=$state AND detail=$detail"; $data = mysqli_query($dbc, $query); if(mysqli_num_rows($data)==1) { echo "You already posted this ad. Most likely caused by refreshing too many times."; } }

    Read the article

  • Why is only 2 of my querys working? (PHP/Mysql)

    - by ggfan
    When I remove a posting, I want it to remove the posting itself, any comments related to it, and like/dislike of the comments, and favorites that people added. So there are 4 queries that do this, but somehow only 2 of the 4 are working. When I switch say query 2 for query 3, then query 2 works and query 3 doesn't... The table names are correct and it is getting the data via $_GET. // Grab the data from the GET $posting_id = $_GET['posting_id']; // Delete the posting from the database $query = "DELETE FROM posting WHERE posting_id=$posting_id LIMIT 1"; mysqli_query($dbc, $query) or die(mysql_error()); // Delete the comments $query2 = "DELETE FROM comments WHERE posting_id=$posting_id "; mysqli_query($dbc, $query2) or die(mysql_error()); // Delete the like/dislike $query3 = "DELETE FROM comment_likedislike WHERE posting_id=$posting_id "; mysqli_query($dbc, $query3) or die(mysql_error()); // Delete the favorites $query4 = "DELETE FROM favorite WHERE posting_id=$posting_id "; mysqli_query($dbc, $query4) or die(mysql_error());

    Read the article

  • Which of the two ways should I use to insert tags into mysql?

    - by ggfan
    For each ad, I allow users to choose up to 5 tags. Right now, in my database, I have it like... Posting_id TagID 5 1 5 2 5 3 6 5 6 1 But i was thinking if I should make it like... Posting_id TagID 5 1 2 3 6 5 1 Then first option is much easier to insert and retrieve data. But if I have 100 posts with 3 tags each, that's 300 rows...so ALOT more rows The second option requires using explode() impode(), etc but it is much cleaner. Which option should I do and why? thanks!

    Read the article

  • Why is my upload-of-a-file code putting 2 sets of files into my directory? (PHP)

    - by ggfan
    When I upload a file using this code, it puts a copy of the file in the "uploads" folder(which is what I want) but it also puts a copy in my root. I only want the files going to the uploads folder. define ('GW_UPLOADPATH', 'uploads/'); $upfile= GW_UPLOADPATH . $_FILES['userfile']['name']; if(is_uploaded_file($_FILES['userfile']['tmp_name'])) { if(!move_uploaded_file($_FILES['userfile']['tmp_name'], $upfile)) //this is saying if the file isn't moved to $upfile. { echo 'Problem: could not move file to destination directory'; exit; } } else { echo 'Problem: Possible file upload attack. Filename: '; //this could be an attack b/c it might be from localhost. echo $_FILES['userfile']['name']; exit; } echo 'File uploaded successfully<br><br>';

    Read the article

  • How to transition from PHP to Python Django?

    - by ggfan
    Here's my background: Decent experience with PHP/MySql. Beginner's experience with OOP Why I want to learn Python Django? I gave in, based on many searches on SO and reading over some of the answers, Python is a great, clean, and structured language to learn. And with the framework Django, it's easier to write codes that are shorter than with PHP Questions Can i do everything in Django as in PHP? Is Django a "big" hit in web development as PHP? I know Python is a great general-purpose language but I'm focused on web development and would like to know how Django ranks in terms of web development.

    Read the article

  • A beginner's question...How do I use $_POST instead of $_GET? (PHP)

    - by ggfan
    Okay, for all my coding so far I been using GETs and only $_POST on the same script. Ex: profile.php would show all the posts an user made and under each of their post, they can edit their post. The way I been using it is through $_GETs. So.. //this is the link users click to edit their post echo '<td><a href="editad.php?posting_id='.$row3['posting_id'].' ">Edit</a>'; //on the editad.php $posting_id=$_GET['posting_id']; if (isset($posting_id)){ //show all the forms, sqls to do the editing } else{ //if the $_GET hasn't been set echo "You have not specified which ad to edit. Please go back"; } How do I do this via POST? Thanks :)

    Read the article

< Previous Page | 1 2 3  | Next Page >