Search found 38 matches

by tsm4781
Mon Feb 14, 2005 9:45 pm
Forum: PHP - Code
Topic: Pulling MySQL Data, printing and counting in PHP
Replies: 3
Views: 508

Oops.. that's my bad. Basically, this page is a list view. It pulls the title, a leadin, and the date for the blog table, and should count the number of comments that match the ID of the blog posting. If the posting is blog.id 58, then I would display the title, lead in, and date, as well as display...
by tsm4781
Mon Feb 14, 2005 9:20 pm
Forum: PHP - Code
Topic: Pulling MySQL Data, printing and counting in PHP
Replies: 3
Views: 508

Pulling MySQL Data, printing and counting in PHP

I am attempting to write my own blog software, and I am at a component which is a little confusing to me, so I am wondering if maybe someone here can assist me in finishing up this little side project. Here is my content page, which has built in pagnation. I know some of it is busted, just trying to...
by tsm4781
Sun Dec 19, 2004 10:22 pm
Forum: PHP - Code
Topic: Help with File Upload & MySQL
Replies: 13
Views: 2251

ok so I finally have it all working, but I have one question.... <?php if ($_POST['action'] == 'addfilemanager') { $table = "filemanager"; $title = $_POST['title']; $leadin = $_POST['leadin']; $userfile = $_FILES['userfile']['name']; $uploaddir = 'files/'; $uploadfile = $uploaddir . basena...
by tsm4781
Sun Dec 19, 2004 7:35 pm
Forum: PHP - Code
Topic: Help with File Upload & MySQL
Replies: 13
Views: 2251

<?php if ($_POST['action'] == 'addfilemanager') { $table = "filemanager"; $title = $_POST['title']; $leadin = $_POST['leadin']; $file = $_FILES['file']['name']; if (($_FILES['file']['type'] == 'application/pdf') && ($_FILES['file']['size'] < 100000)) { if (file_exists('files/'.$_F...
by tsm4781
Sun Dec 19, 2004 5:48 pm
Forum: PHP - Code
Topic: Help with File Upload & MySQL
Replies: 13
Views: 2251

Ok so I tried the suggestion in code above, but all I get for a return is "This site accepts .pdf files only." when I click submit. It is also not doing an insert, but that is obvious since it isn't actually executing. Thoughts?
by tsm4781
Sun Dec 19, 2004 4:00 pm
Forum: PHP - Code
Topic: Help with File Upload & MySQL
Replies: 13
Views: 2251

so no ideas why it might be failing?
by tsm4781
Sun Dec 19, 2004 3:12 pm
Forum: PHP - Code
Topic: Help with File Upload & MySQL
Replies: 13
Views: 2251

The file I attempted to upload only was about 10k, so I don't think that was it. It just seems that the actual upload script never initializes. It will most certainly take all of the info and insert it into the database, but it won't actually take the file and copy it to the remote server in the &qu...
by tsm4781
Sun Dec 19, 2004 12:54 pm
Forum: PHP - Code
Topic: Help with File Upload & MySQL
Replies: 13
Views: 2251

is it possible that maybe where my if statement is for the actual file upload is in the wrong place?
by tsm4781
Sun Dec 19, 2004 9:27 am
Forum: PHP - Code
Topic: Help with File Upload & MySQL
Replies: 13
Views: 2251

Help with File Upload & MySQL

I've written a little piece of code to upload a file to a folder on my remote server and write a title, desc, id, filename to my database. I'm running into an issue and I am wondering if you could help me. All of the data is writing to the database just file, but the file never uploads. My directory...
by tsm4781
Sun Jul 18, 2004 9:28 pm
Forum: PHP - Code
Topic: Help with username approval flag
Replies: 13
Views: 1102

Should I only use sessions on the login screen once you've logged in?
by tsm4781
Sun Jul 18, 2004 8:32 pm
Forum: PHP - Code
Topic: Help with username approval flag
Replies: 13
Views: 1102

Yup.. I am using sessions.. so that's a plus. The thing is that once you hit the web site, a session is already created. How might I use this to my advantage?
by tsm4781
Sun Jul 18, 2004 8:18 pm
Forum: PHP - Code
Topic: Help with username approval flag
Replies: 13
Views: 1102

How would I set this so that if I am not a user logged in using the table at all it would display a default message. I have to be logged in with either a value set to 1, which is approved, or 0, which is the default, but I can't get anything to display if I am not logged in at all.... thoughts? <?ph...
by tsm4781
Sun Jul 18, 2004 6:42 pm
Forum: PHP - Code
Topic: Help with username approval flag
Replies: 13
Views: 1102

<?php $query = "SELECT approved,username FROM members where username='$username'"; $result = mysql_query($query) or die(mysql_error()); if(mysql_num_rows($result)) // found a user with that name { $info = mysql_fetch_assoc($result); $approved = $info['approved']; $username = $info['userna...
by tsm4781
Sun Jul 18, 2004 4:40 pm
Forum: PHP - Code
Topic: Help with username approval flag
Replies: 13
Views: 1102

any suggestions about the right way to do this. I am trying to work with someone else's code.. and my knowledge of PHP is limited/basic.
by tsm4781
Sun Jul 18, 2004 4:36 pm
Forum: PHP - Code
Topic: Help with username approval flag
Replies: 13
Views: 1102

<?php $query = "SELECT approved,username FROM members where username=$username"; $queryapproved = $query['approved']; $queryusername = $query['username']; if ( $queryapproved > 0 ) { $queryapproved = "true" echo "welcome, you are approved to see this screen"; } else { ...