Jump to content

dswain

Members
  • Posts

    20
  • Joined

  • Last visited

    Never

Contact Methods

  • AIM
    dswain500
  • Website URL
    http://swainnet.zapto.org

Profile Information

  • Gender
    Male
  • Location
    New Jersey

dswain's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I believe to use those variables (session and post variables) you need to change the quotations? <?php $sql = "INSERT INTO video VALUES ('0', '$_SESSION[id]', '$_POST[title]', '$_POST[video]', '$_POST[description_text]', '$_POST[category_text]', '$_POST[level_text]', NOW())"; ?> Should become: <?php $sql = "INSERT INTO video VALUES ('0', '" . $_SESSION['id'] . "', '" . $_POST['title'] . "', ..."; ?> I'm not 100% sure about that but I think that's the case. It might have to do with not specifying the columns you want to insert the data into.
  2. I'm not an expert on any mailing system, but how are you entering the addresses into the BCC line? For example, are you just dumping all of the addresses in as that variable or are you selecting ones with particular domains?
  3. No, sorry I don't believe it is. Check the ffmpeg docs maybe for that information.
  4. A templating class does sound nicer than any of the other solutions, so I'll agree with that (though I've never done it, so I don't know how involved it is). The only reason I say try to avoid the HTML within the PHP is because that's even harder to maintain, especially for other people who have to read your code. Just my experience talking at that point, but the templating system does sound good.
  5. If you have those files in the root of your directory, your code needs to point to those files all of the time. For example in your case since those files are in the root of your website (/) then you need to make sure you code points to the root of your website. If you just do an include with those files on each page, you're trying to tell PHP that the files are in the CWD and it won't be able to find them. Basically, just add the slash in front of the code (so instead of "include 'common_footer.php' make it "include '/common_footer.php'")
  6. Creating a good design and development page, as I've learned recently, is a bit of a challenge so I don't blame you. My advice would be to try and break down the code so that the hard processing (the actual upload and things) are done separated from the HTML itself as much as possible. For example, I try and make sure that my pages look something like this now: <?php Whatever PHP processing code I need to add here ... ?> <html> <head> <title>Whatever</title> Then you can add a link to a stylesheet here easily </head> <body> <form action=$_SERVER['PHP_SELF'] method=POST> Then you finish your upload form in here </form> </body> </html> Obviously there's a little more to it than that, but that's the idea. I try and break them up as much as possible now if I can. Hopefully that helps =)
  7. You should be able to do the include at the top of the file and have it display properly. To change the font, you'd have to use HTML and you should probably change it in the include file to keep it well organized. I'm assuming the menu is in HTML right?
  8. When you say "add" do you mean append the intro/outro video to the actual data of the movie or like display the video at the beginning and end of a page? If you mean append the data to the actual video, you'll have to use some command line tool and I guess you can execute it through PHP, but PHP won't do the video editing for you. If you mean display it on different pages of a web page, well then that's different.
  9. That sounds like something that the program you're executing will have to do, not really PHP. Maybe I'm mistaken, but I think that's the case.
  10. I believe you'll need to take the quotes off of the $profile_info variable within the if condition. I think you meant to put those around the level text. if ($profile_info['level'] > 0) { ... }
  11. Oh man, wow I'm sorry I'm an idiot. The thought didn't even occur to me to globalize the $counter variable. Talk about a duh moment! Thanks a lot! By the way, that was a very good explanation. I did know about globalizing variables but I wouldn't have thought to have called it the scope of the variable. Again, wow haha a real duh moment. Looks good now =)
  12. Haha yeah it happens to me also sometimes. Looks like fairly nice code otherwise though!
  13. Ah, it has to do with your form. Check this <label>Hackname: <input type="text" name="name" value="<?php echo $hackname; ?>" /></label><br /> <label>Description: <input type="text" name="name" value="<?php echo $description; ?>" /></label><br /> <label>Version: <input type="text" name="name" value="<?php echo $version; ?>" /></label><br /> See, you have each of those set to a name "name". Basically, you're setting $_POST['name'] three times over. Your variables are set up like this: $hackname = $_POST['hackname']; $description = $_POST['description']; $version = $_POST['version']; $hacksid = $_POST['hacksid']; So what you want to do is change those names in the form to match the variables. It'd be like this: <label>Hackname: <input type="text" name="hackname" value="<?php echo $hackname; ?>" /></label><br /> <label>Description: <input type="text" name="description" value="<?php echo $description; ?>" /></label><br /> <label>Version: <input type="text" name="version" value="<?php echo $version; ?>" /></label><br /> You did get the hidden value set right though for the hackid. I believe that should do it, however. Before you try that though, make sure those variables are outputting the appropriate data (so try and echo $hackname and such).
  14. What does the data in $_REQUEST['destination'] look like? I don't think you can just append the target='_blank' code to it and it would need to be inside of the <a> tag itself.
  15. I have a page which is I need to load multiple XML files in and then output certain data to. Using simplexml_load_file works fine for either of the streams (there are two in total so far) but they both cannot be used at the same time. <?php #Rewriting this Last.fm feed handler with SimpleXML. So much easier... it's asinine. include ("header.php"); #Setting up some vars. $username = 'dswain'; $total_items = 6; if (!isset($counter)) { resetCounter(); } function resetCounter() { $counter = 0; } ?> <html> <head> <title><?php echo $username . "'s last.fm data"; ?></title> </head> <body> <table width='65%' align='center'> <tr><td align='left'><h1>Top Artists</h1></td></tr> <td> <table width='50%' align='left'> <tr> <td><b>Artist</b></td> <td><b>Playcount</b></td> <td align='center'><b>URL<b></td> </tr> <?php $top_artists = simplexml_load_file("http://ws.audioscrobbler.com/1.0/user/$username/weeklyartistchart.xml"); while ($counter != $total_items) { echo "<tr>"; echo "<td>" . $top_artists->artist[$counter]->name . "</td>"; echo "<td align='center'>" . $top_artists->artist[$counter]->playcount . "</td>"; echo "<td>" . $top_artists->artist[$counter]->url . "</td>"; echo "</tr>"; $counter++; } ?> </table> </td> <td> <table width='50%' align='right'> <tr> <td><b>Artist</b></td> <td><b>Song</b></td> </tr> <?php resetCounter(); $recent_tracks = simplexml_load_file("http://ws.audioscrobbler.com/1.0/user/$username/recenttracks.xml"); while ($counter != $total_items) { echo "<tr>"; echo "<td>" . $recent_tracks->track[$counter]->artist . "</td>"; echo "<td>" . $recent_tracks->track[$counter]->name . "</td>"; echo "</tr>"; $counter++; } ?> </table> </td> </table> </body> </html> Basically, if I comment out one of the sections where it is trying to open the XML file, the other one will work fine, but not both at the same time. It seems like I would need to unload the simplexml data and then open up the new file, but I couldn't find any particular methods to do this in the PHP docs. http://swainnet.zapto.org/rss_more.php is the actual page which this code is being run from. Thanks in advanced, and sorry if this isn't very clear. Kind of awkward for me to explain.
×
×
  • 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.