Jump to content

shane85

Members
  • Posts

    128
  • Joined

  • Last visited

    Never

Everything posted by shane85

  1. hey guys so I have an old mp3 upload script from a previous website of mine and it works fine. However before all it would do is upload the mp3, then from my page I could just link to the db record, have the link, and download the song. What I want to do now is is have a similar player to that of supernova.com - where users can click the songs, it plays through the player and doesnt allow downloads. It still tracks how many plays, requests, etc so can keep a record for charts, etc etc. Now clearly theres alot of javascript involved in something like that - my question is. a) can something like this be created through php? b) if I want to create something similar, would javascript be my best bet? It almost seems like a player such as this was done in flash. c) for my database, im assuming I would create a table mp3 where I would have my artist_id, song_title, lyrics, plays etc. Sorry this post is very vague but basically im trying to learn how to create something similar to that player.
  2. hey guys just wondering what u think the best way to do this.....on my form registration for users....I have a drop down for countrys....but I dont want to have 2 drop downs 1 for state and 1 for province if they choose canada/usa....I have seen alot of java scrit on such sites where if you choose Canada for country, then it switches to a drop down for just provinces, not states. Same for zip code/postal code...american zip code would be like 90210 where as a postal code would be like n5j2S1. Is there a script or something already I can use with all the countrys/provinces/states etc already entered so im not re-inventing the wheel here? If someone can point me in right directon id appreciate it. Thanks
  3. hey guys. Right now upon form submission, I do an error check that puts all the errors into an array, then will display them at the top of the form. What I want to do though is break up the array, and be able to give each error msg in its indivdual table row in the html. Right now, my coding is if($lname == '') { $errmsg_arr[] = 'You must enter your last name'; $errflag = true; } if($email == '') { $errmsg_arr[] = 'You must enter your email address'; $errflag = true; } if($city == '') { $errmsg_arr[] = 'You must enter your city'; $errflag = true; } if($errflag) { $_SESSION['ERRMSG_ARR'] = $errmsg_arr; session_write_close(); header("location: signup_artist.php"); exit(); } thats in form2.php form 1.php has the following snipet of code <?php if( isset($_SESSION['ERRMSG_ARR']) && is_array($_SESSION['ERRMSG_ARR']) && count($_SESSION['ERRMSG_ARR']) >0 ) { echo '<ul class="err">'; foreach($_SESSION['ERRMSG_ARR'] as $msg) { echo '<li>',$msg,'</li>'; } echo '</ul>'; unset($_SESSION['ERRMSG_ARR']); } ?> so basically would I would like to be able to do is identify each error as for instane $fname_error $lname_error etc and then load them into my html appropriately, as opposed to just an array listing them
  4. hey guys sorry for the newb question... way back I had a site developed for me and ive since shut it down but thinking of re-creating a similar one. im looking over all of the old code files I have and I remember when logging in the developer had always set a session id....it I guess is a social networking site (mine was up years before facebooK!) lol. Anyway, what would be the benefit to setting a session_id on this even in the url have website.com/page.php?sid=328483248324 or some number or whatever it was. Just trying to educate myself. I was looking on php.net but didnt really get any answers that helped. thanks
  5. thanks guys.... XAMPP was the one I used before now I remember. Ive tried it twice...the first time I had problems installing it, then 2nd time no problem. Now im having trbles installing it again. I did, but when I try to load mysql and it loads a web browser I get "internet explorer cannot display the web page" I cant get it installed properly...I think last time I had to modify the php.ini or something for it to work....is this a familiar problem?
  6. hey guys. sorry if this is posted in the wrong section. I am gonna attempt to start a project and wondering what the best web server is I should run on my pc. I have used ones in the past I liked and were good but to be honest its probably been 5 years+ and I dont remember the name of it. Also, I am looking to create a db, so how can I run phpmyadmin on this so I can make my databases?? Thanks
  7. hmm ok so really I would only need 2 tables?? 1 "jobs" and 1 "job_types" where job_types would have say 15 different categories, numbered properly with ids, then like you said I would pick the row of job_type and insert that into jobs? sorry for the basic questions just trying to design the db properly so I dont have to redo it 100x! I also want to make it so people can add job listings...so information that would be stored in "jobs" would be their info, etc etc, and then for the job_type, transfer that from the job_types table? sorry I hope im making sence.
  8. sorry guys its been a long day and this is an extreme newbie question but for whatever reason right now I cant wrap my head around the concept right now... say for instance one wanted to make a db for job postings, where one could go and see many different categories etc etc. Would you create a table "jobs" and then create rows for the types ie) Accounting, Business, Customer Service, etc. - or would those be all seperate tables as well? Cause im just thinking of the INSERT INTO query, and say I wanted to add a job but I only wanted to add one to the Customer service portion of the jobs table...thats why im curious if everything should be different tables so you could just do INSERT INTO customer_service etc etc and then have all of the persons names/creditials there? OR is it possible to create a table within a table? or am I simply going nuts here? lol. thanks
  9. hey guys sorry im mad at using ' or " ... still learning.... in my html, I use <li class="active"> to show an active link now im trying to use php so only if the month is right it shows it as an active link, so im trying to use <li <?php if ($_GET['month']=='01') { echo class="active"; } ?> > however I get this error Parse error: syntax error, unexpected T_CLASS how do I echo class="active" correctly??? Thanks
  10. hmm ok im making progress...I think the reason its displaying nothing is: its the main page, where im trying to show ALL news postings. Then on the side, I have the links for months, if they wish to view by month. Queston is, how do I make it show all when news2.php loads, but then when they click on say may, june, july, execute a different query?
  11. I added the following links on the page just for testing purposes <a href="news2.php?month=01">Jan</a> <a href="news2.php?month=02">Feb</a> <a href="news2.php?month=03">Mar</a> <a href="news2.php?month=04">Apr</a> <a href="news2.php?month=05">May</a> <a href="news2.php?month=06">Jun</a> <a href="news2.php?month=07">Jul</a> <a href="news2.php?month=08">Aug</a> <a href="news2.php?month=09">Sep</a> <a href="news2.php?month=10">Oct</a> <a href="news2.php?month=11">Nov</a> <a href="news2.php?month=12">Dec</a> but when I click on any of them nothing shows up....and in my db there are mosts from may, sept, a fwe others as well
  12. hmmm ok thank you I will try that. I do have them like that, however, could it be its not working correctly because its not hardcoded in this file, rather linked to an include?? Also, im assuming the year thing would work the same? If I wanted to do the year, I would just do <a href="page.php?year=2010&month=02">Feb</a> ?? Thanks again
  13. duh sorry....should have explained myself a bit better it doesnt display any results at all. most of the code im using is as follows <?php // Create function to display the news entries function print_newsEntry($arrEntry) { // convert \n linebreaks to HTML formatted <br> breaks $arrEntry['message'] = str_replace("\n", '<br>', $arrEntry['message']); ?> <h3 class="meta_news"><a href="article.php?id=<?php echo $arrEntry['id']; ?>"><?php echo $arrEntry['subject']; ?></a></h3> <span class="date"><strong><?php echo date('M, d - Y', $arrEntry['tstamp']); ?></strong></span> <p> <?php $arrEntry['message'] = substr($arrEntry['message'], 0, 350); // Display only 350 Characters echo str_replace("\n", '<br>', $arrEntry['message']); ?>...</p> <p><a href="article.php?id=<?php echo $arrEntry['id']; ?>">Click Here</a> to read more.</p> <p></p> <?php } // Get all news entries mysql_connect(DB_HOST, DB_USER, DB_PASSWORD) or trigger_error(mysql_error()); mysql_select_db(DB_DATABASE) or trigger_error(mysql_error()); $month = (int)$_GET['month']; $newsEntries = mysql_query('SELECT *, UNIX_TIMESTAMP(tstamp) AS tstamp FROM news WHERE month(tstamp) = "$month" ORDER BY tstamp DESC') or trigger_error(mysql_error()); // my old query I use to display all results // $newsEntries = mysql_query('SELECT *, UNIX_TIMESTAMP(tstamp) AS tstamp FROM news ORDER BY tstamp DESC') or trigger_error(mysql_error()); // Display news Entries while ($newsEntry = mysql_fetch_array($newsEntries)) { print_newsEntry($newsEntry); } ?>
  14. I used that code....but it doesnt work...does php know $month is the 2nd line in the timestamp or does that have to somehow be defined??? sorry for newbie question
  15. hmm ok good to know ty im curious how jcbones code is going to work $month = (int)$_GET['month']; $sql = "SELECT * FROM `news` WHERE month(tstamp) = '$month'"; because on the news page currently, im showing all results from the db. Where does $month get defined???
  16. trying to do some experimenting here finally... sql('SELECT * FROM news WHERE month(tstamp) ='$month' ORDER BY tstamp DESC') or trigger_error(mysql_error()); gives me the following error Parse error: syntax error, unexpected T_VARIABLE in news2.php on line 69
  17. nope not a date column, its a timestamp column. It stores the date like 2010-05-25 20:42:08 for example
  18. hey guys I made a post about this a week or so ago but have been so busy havent had time to experiment and try to get to the bottom of this. Basically I have a news section on my site, which pulls all the info from a mysql db and displays the subject of the msg, the msg, and the timestamp of when it was posted. Now, I have a side table on the side of my site with months, Jan, Feb, Mar, Apr, etc. What I would like to do is so when someone clicks on one of those links, it just shows posts from that month. Someone recomended I do the following $sql = "SELECT * FROM `news` WHERE tstamp >= '2010-".$month."-01' AND tstamp <= '2010-".$month."-30'; however, where do I define $month? Wouldnt it be better for may, for example, if rather then $month I just put 05 ? any other thoughts on this?? Thanks
  19. hey guys so im trying to make a news system...in my database table news, I have id(int10) tstamp(timestamp) subject(text) message(text) so basically, I write a message, it records the date that I write it, etc etc etc. What I want to do is have side links so that I can view articles I have posted by month. So. January would be like <a href="news.php?month=01">January</a> etc or something like that....being that tstamp stores as 2010-05-25 20:41:16 for example, how can I make my links for jan./feb/mar etc link to the correct months??
  20. hmm yes and no... I basically need to somehow specify on startup, load program 1 on screen 1, and program 2 & 3 on screen 2 program 1 is like a windows media type player program 2 is a flash ap program 3 is a webcam pretty much...argh - this is annoying
  21. BUMP is this possible guys???
  22. hey guys...sorry this is OFF TOPIC for php I know but everyone here always replied so fast and is always extemely helpful so hopefully you wont mind me posting this. Basically I have a dual monitor setup, and upon startup I need to automatically load 3 applicatons, so naturally I put those in my startup folder. However, I need to assign 2 of these programs to my second monitor, and can only have the 1 application load on the first monitor. How can I achieve this?? Sorry again hope this is ok but thanks in advance for the help
  23. hey guys...this is kind of OFF TOPIC but hope someone can help me - I have dual monitors, and am trying to load 3 applications upon start up in windows xp pro...HOW can I assign 2 of these applications to 1 screen, and the other application to my main screen??? is this possible?
  24. hey guys so ive been doing alot of testing and I tried adding some javascript to one of my pages to have a "ticker" and it works perfectly in IE, but in firefox for whatever reason it doesnt scroll properly and I have figured it out by removing bits and pieces of code and narrowing down the problem...the line of code that causes it is the <html> code and I have it as follows <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> I took it out, but then in internet explorer then the page doesnt display corretly....when its not there, the "ticker" scrolls properly in firefox...what is the solution to this?? oops..I should be more clear I still have an html tag when I take out that piece of code..under neath that I have <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  25. awesome thank you very much, I will look into it
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.