Jump to content

alwaysinit

Members
  • Posts

    60
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

alwaysinit's Achievements

Member

Member (2/5)

0

Reputation

  1. Just curious if anyone here knows if it's possible to change BG color, font color, size, etc.... in the email that my site's members receive upon registering. I know of PHPmailer, but I would like to code the color customizations into my mail function in php. My registration script is based off of the one here in the tutorials section. :)Thanks for any input
  2. Just found xml.sendandload, gonna give that a shot, then I won't have to use sessions at all.
  3. Hi, I'm looking for an example of how to name or store a session along with all of it's data when a user logs in to my site. Then log them out while I run a certain xml.php script, and at the end of it log them back in. Using the previously named session to log them back in automatically to re-register all of their global session variables.(I checked all of the session sections at php.net, they did'nt show how to do this) I'm trying to make a songlist.xml.php for use inside of an AS XML object in flash. The trick is I need to use sessions inside of the xml.php to have it play many different user's MP3s when they are logged into their profile, and also when they use my site's search script. I'm pretty sure I can't "sendandload" within flash's "soundObject" to post variables to the xml.php, so I must use session data to dynamically render the xml.php. So I register new global variables when you look at a member's profile from my search script to have his songs rendered in the xml.php. So at the end of xml.php I plan to destroy the "SESSION(search)" and replace it with "SESSION(originallyloggeduser)". It's the only way I can figure out how to make the xml.php work correctly for thousands of people's profiles and a search script. Thanks if you can help me
  4. OK, I had a couple of bad variables set in my login script. But when i set it all up like you said and fixed my variables, works beautifully. Thank you inztinkt
  5. yep sorry just posted it up there, teehee And 'infoparse.php" and "parse.php" are one and the same, my bad. it all works
  6. yessiree it does, and quite fine I may add  :D [code] <?php // At the very bottom I have the output fields for showing users their mysql data session_start(); header("Cache-Control: no-cache, must-revalidate"); if (!$_SESSION['id']) {     echo "You're not logged in!";     include("doh.html");     exit(); } ?> <html><head> <title>Change Profile Info</title> </head><body> <h1>Change Profile Info</h1> <p>Fill out only the fields you'd like to change:</p> <form action="parse.php" method="post"> Artist Name: <input type="text" name="artname" size="20"><br /> Country: <input type="text" name="country" size="20"><br /> Province/State: <input type="text" name="province" size="20"><br /> city: <input type="text" name="city" size="20"><br /> Bio: <textarea rows="5" cols="40" name="bio"></textarea><br /> Influences: <textarea rows="5" cols="40" name="infl"></textarea><br /> <input type="submit" value="Update Profile" name="submit"><input type="reset" value="Reset Entries" name="reset"></form> <br> <br> <br> <? print '<textarea rows="1" cols="40" name="bio" >' . $_SESSION['name'] . '</textarea><br>'; ?> <? print '<textarea rows="1" cols="40" name="bio" >' . $_SESSION['country'] . '</textarea><br>'; ?> <? print '<textarea rows="1" cols="40" name="bio" >' . $_SESSION['province'] . '</textarea><br>'; ?> <? print '<textarea rows="1" cols="40" name="bio" >' . $_SESSION['city'] . '</textarea><br>'; ?> <? print '<textarea rows="12" cols="40" name="bio" >' . $_SESSION['bio'] . '</textarea><br>'; ?> <? print '<textarea rows="12" cols="40" name="bio" >' . $_SESSION['infl'] . '</textarea><br>'; ?> </body></html> [/code]
  7. [quote author=inztinkt link=topic=123382.msg509853#msg509853 date=1169398645] alwaysinit, why not replace the session variables instead of unsetting and resetting them?? and redirect them to the form, not send them back. [/quote] thanks inztinkt, I'm still wet behind the ears, could you help me code the replace and redirect. here is my "infoparse.php"(form.php" is where the data gets displayed in this case): [code] <?php session_start(); header("Cache-Control: no-cache, must-revalidate"); if (!$_SESSION['id']) {     echo "You're not logged in!";     include("doh.html");     exit(); } $id = $_SESSION['id']; // Connect to Mysql include ("mysql_conn.php"); if ($_POST['artname'] != "") {     $artname = htmlspecialchars($_POST['artname']);     mysql_query("UPDATE users SET name='$artname' WHERE id='$id'") or die (mysql_error());     $_SESSION['artname'] = $artname;     $cartname = "<li>artname</li>"; } if ($_POST['country'] != "") {     $country = htmlspecialchars($_POST['country']);     mysql_query("UPDATE users SET country='$country' WHERE id='$id'") or die (mysql_error());     $_SESSION['country'] = $country;     $ccountry = "<li>country</li>"; } if ($_POST['province'] != "") {     $province = htmlspecialchars($_POST['province']);     mysql_query("UPDATE users SET province='$province' WHERE id='$id'") or die (mysql_error());     $_SESSION['province'] = $province;     $cprovince = "<li>province</li>"; } if ($_POST['city'] != "") {     $city = htmlspecialchars($_POST['city']);     mysql_query("UPDATE users SET city='$city' WHERE id='$id'") or die (mysql_error());     $_SESSION['city'] = $city;     $ccity = "<li>city</li>"; } if ($_POST['bio'] != "") {     $bio = nl2br(htmlspecialchars($_POST['bio']));     mysql_query("UPDATE users SET bio='$bio' WHERE id='$id'") or die (mysql_error());     $_SESSION['bio'] = $bio;     $cbio = "<li>bio</li>"; } if ($_POST['infl'] != "") {     $infl = nl2br(htmlspecialchars($_POST['infl']));     mysql_query("UPDATE users SET infl='$infl' WHERE id='$id'") or die (mysql_error());     $_SESSION['infl'] = $infl;     $cinfl = "<li>influences</li>"; } ?> <html><head><title>Change Profile Results</title></head><body> <h1>Change Profile Results:</h1> <? if (($cartname) || ($ccountry) || ($cprovince) || ($ccity) || ($cbio) || ($cinfl)) {     echo "The following items have been updated in your profile:<br /><ul>";     if ($cartname) {         echo $cartname;     }     if ($ccountry) {         echo $ccountry;     }     if ($cprovince) {         echo $cprovince;     }     if ($ccity) {         echo $ccity;     } if ($cbio) {         echo $cbio;     }     if ($cinfl) {         echo $cinfl;     } echo "</ul><br />To go back to Info Management, <a href=\"form.php\">click here</a>."; } else { echo "Nothing has been changed<a href=\"form.php\">Click here</a> To go back to Info Management."; } ?> </body></html> [/code]
  8. Hi again masterminds, I would like to see if someone can make this work for me. I got it from the "session_destroy" function at PHP.net(I need this function terribly) If you need any information from me, just let me know. I'm trying to clear out some Mysql variables that were previously defined in the user's session. So when they navigate back to the form from the parse, their information shows their changes without having them shut down their browser. Basically looking for a way to 'log them out', 'then back in' in the same script. Without that, their MySQL info won't show change back in the form page. [code] <?php session_start(); // Some simple code etc etc $requested_logout = true; if ($requested_logout) {    session_restart(); } // Now the session_id will be different every browser refresh print(session_id()); function session_restart() {    if (session_name()=='') {        // Session not started yet        session_start();    }    else {        // Session was started, so destroy        session_destroy();        // But we do want a session started for the next request        session_start();        session_regenerate_id();        // PHP < 4.3.3, since it does not put        setcookie(session_name(), session_id());    } } ?> [/code]
  9. Hi, I'm using (mysql 4.0.27 with PHP 4.3.11) my issue: I have a site that allows members to upload data to be used in their profiles. The images and the MP3s are copied to the site file system(no Mysql). The text data I store in Mysql then display where needed(forms, profile) The problem is that the data coming out of Mysql does not does not show the changes that the user made until he/she shuts down their browser. Yet the image and MP3 files show their changes just by hitting refresh. Upon opening the browser and going back to site, all of the user's changes from mysql now show. Only thing that I can find that will reflect changes is shutting down the browser. I've tried setting a Random number variable to the url link to make the page a different name each time it is viewed, no dice. I tried all of the PRAGMA NOCACHE methods. Can anyone think of a reason why this might be a thorn in my side? Bad PHP or HTML/CSS coding? Bad Mysql settings? Bad php.ini settings? Could .htaccess fix? I've run out of things to try to remedy this, please lend advice. thanks
  10. OK, here is the solution I created for finding MP3 file sizes(tried a few different file types, and they all worked txt,php,html) [code] <?php // this line puts the file into variable($filename) from it's url location $filename = '../../user_files/song3/' . $_SESSION['song_3'] . ''; //  XML rendering echo "<song artist='" . $_SESSION['username'] . "' title='" . $_SESSION['songtitle_1'] . "' duration='" . $_SESSION['song1time'] . "' filesize='" . filesize($filename) . "' url='../user_files/song1/" . $_SESSION['song_1'] . "' />\n"; ?> [/code] Now that that's out of the way, does anybody know how to determine MP3 "duration" or "playtime"? It is the last bit of coding I need for the player. Would it work in the same fashion as filesize? I'll go lookin'
  11. So I need to $filepath = "../user_files/song1/" . $_SESSION['song_1']"; before starting the XML creation for that to work right? Any thoughts on the song duration aspect?
  12. :oCan't see your code, oh no! lol nevermind, just looked in firefox, I see your code. I'll try it out thanks
  13. Thanks Like this? [code] echo "<song artist='" . $_SESSION['username'] . "' title='" . $_SESSION['songtitle_1'] . "' duration='" . $_SESSION['????????'] . "' filesize='" . $_SESSION['filesize($filename)'] . "' url='../user_files/song1/" . $_SESSION['song_1'] . "' />\n"; [/code]
  14. I'm constructing an Mp3 player for my site that is fed it's songlist dynamically through the xml.php. All I need in the script is a way to get the 'filesize' and 'duration' from the songs, and output them in the XML rendering section of the PHP file. I was just wondering if it is possible to do this with a few lines of code, rather than implement a whole ID3 class into my script. I don't yet know enough to rip the classes apart and take the functions that I need out. So if anyone here may have a no nonsense, lightweight approach for me, I would love to see it and try it out. The urls where the physical MP3 files reside are listed in the script here. I placed ?????? in the XML area for the 'filesize'&'duration' variables. Many thanks to responders.  xml.php [code] <?php session_start(); header("Cache-control: private"); if (!$_SESSION['email']) {     echo "You aren't logged in.";    exit(); } echo "<?xml version=\"1.0\"?>\n"; echo "<songs>\n"; echo "<song artist='" . $_SESSION['username'] . "' title='" . $_SESSION['songtitle_1'] . "' duration='" . $_SESSION['????????'] . "' filesize='" . $_SESSION['????????'] . "' url='../user_files/song1/" . $_SESSION['song_1'] . "' />\n"; echo "<song artist='" . $_SESSION['username'] . "' title='" . $_SESSION['songtitle_2'] . "' duration='" . $_SESSION['????????'] . "' filesize='" . $_SESSION['????????'] . "' url='../user_files/song2/" . $_SESSION['song_2'] . "' />\n"; echo "<song artist='" . $_SESSION['username'] . "' title='" . $_SESSION['songtitle_3'] . "' duration='" . $_SESSION['????????'] . "' filesize='" . $_SESSION['????????'] . "' url='../user_files/song3/" . $_SESSION['song_3'] . "' />\n"; echo "<song artist='" . $_SESSION['username'] . "' title='" . $_SESSION['songtitle_4'] . "' duration='" . $_SESSION['????????'] . "' filesize='" . $_SESSION['????????'] . "' url='../user_files/song4/" . $_SESSION['song_4'] . "' />\n"; echo "<song artist='" . $_SESSION['username'] . "' title='" . $_SESSION['songtitle_5'] . "' duration='" . $_SESSION['????????'] . "' filesize='" . $_SESSION['????????'] . "' url='../user_files/song5/" . $_SESSION['song_5'] . "' />\n"; echo "</songs>\n"; ?> [/code] And this is the XML it renders: [code]   <?xml version="1.0" ?> - <songs>   <song artist="Allison" title="Midnight Ride" duration="???????" filesize="???????" url="../user_files/song1/16.mp3" />   <song artist="Allison" title="Almost Me Again" duration="???????" filesize="???????" url="../user_files/song2/16.mp3" />   <song artist="Allison" title="Hope you Live" duration="???????" filesize="???????" url="../user_files/song3/16.mp3" />   <song artist="Allison" title="Midnight Ride" duration="???????" filesize="???????" url="../user_files/song4/16.mp3" />   <song artist="Allison" title="punched a hole in it" duration="???????" filesize="???????" url="../user_files/song5/16.mp3" />   </songs> [/code] The member's various mp3s all have the same name, just spread to 5 different folders. Thanks
×
×
  • 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.