Jump to content

zenmind

Members
  • Posts

    10
  • Joined

  • Last visited

zenmind's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Preface: I again apologize in advance earlier to the people who thought I was writing a Scam PHP page. I should have informed it was a teacher written assignment. Hi guys so Im writing these two php webpages : one is a signup page which is a mock 'dating site' : <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>NerdLuv</title> <meta http-equiv="Content-type" content="text/html; charset=utf-8" /> <link href="heart.gif" type="image/gif" rel="shortcut icon" /> <link href="nerdluv.css" type="text/css" rel="stylesheet" /> </head> <body> <div id="main"> <div id="bannerarea"> <img src="nerdluv.png" alt="banner logo" /> <br /> where meek geeks meet </div> <div id="matches"> <h1>Matches for User Name</h1> <div class="match"> <p class="name"> <img src="images/ada_lovelace.jpg" alt="Ada Lovelace" /> Ada Lovelace </p> <p class="info"> <strong>gender:</strong> F <br /> <strong>age:</strong> 96 <br /> <strong>type:</strong> ISTJ <br /> <strong>OS:</strong> Linux <br /> <strong>rating:</strong> 4 </p> </div> <!--End of first match case ada lovelace --> <div class="match"> <p class="name"> <img src="images/grace_hopper.jpg" alt="Grace Hopper" /> Grace Hopper </p> <p class="info"> <strong>gender:</strong> F <br /> <strong>age:</strong> 87 <br /> <strong>type:</strong> ISFP <br /> <strong>OS:</strong> Windows <br /> <strong>rating:</strong> 4 </p> </div> <!-- end of second match case --> </div> <!-- Div id matches--> <!--This reads the singles text file and prints them to the results page --> <!--<?php include("singles.txt"); ?> --> <p> </p> <div id="w3c"> <a href="http://validator.w3.org/check/referer"> <img src="http://www.w3.org/Icons/valid-xhtml11" alt="Valid XHTML 1.1" /></a> <a href="http://jigsaw.w3.org/css-validator/check/referer"> <img src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS" /></a> </div> </body> </html> the other is a results page which will display the appropriate match according to user input : <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR...D/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>NerdLuv</title> <meta http-equiv="Content-type" content="text/html; charset=utf-8" /> <link href="heart.gif" type="image/gif" rel="shortcut icon" /> <link href="nerdluv.css" type="text/css" rel="stylesheet" /> </head> <body> <div id="main"> <div id="bannerarea"> <img src="nerdluv.png" alt="banner logo" /> <br /> where meek geeks meet </div> <div id="matches"> <h1>Matches for User Name</h1> <div class="match"> <p class="name"> <img src="images/ada_lovelace.jpg" alt="Ada Lovelace" /> Ada Lovelace </p> <p class="info"> <strong>gender:</strong> F <br /> <strong>age:</strong> 96 <br /> <strong>type:</strong> ISTJ <br /> <strong>OS:</strong> Linux <br /> <strong>rating:</strong> 4 </p> </div> <!--End of first match case ada lovelace --> <div class="match"> <p class="name"> <img src="images/grace_hopper.jpg" alt="Grace Hopper" /> Grace Hopper </p> <p class="info"> <strong>gender:</strong> F <br /> <strong>age:</strong> 87 <br /> <strong>type:</strong> ISFP <br /> <strong>OS:</strong> Windows <br /> <strong>rating:</strong> 4 </p> </div> <!-- end of second match case --> </div> <!-- Div id matches--> <!--This reads the singles text file and prints them to the results page --> <!--<?php include("singles.txt"); ?> --> <p> </p> <div id="w3c"> <a href="http://validator.w3....check/referer"> <img src="http://www.w3.org/Ic.../valid-xhtml11" alt="Valid XHTML 1.1" /></a> <a href="http://jigsaw.w3.org...check/referer"> <img src="http://jigsaw.w3.org...or/images/vcss" alt="Valid CSS" /></a> </div> </body> </html> I was thinking ultimately to implement POST methods with a function to retrieve the data and POST but at this point Im totally lost...... If I just implement a form action post it will obviously need something on the other php page to recieve it . But thats not how its setup, ill need a way to send the user data have it check the data in a textfile(which is what results.php displays from, and also write the user data in the same file ) then once results.php processes it shows the "suitable" matches according to user input ..Im coming short in development time so any help would be great.. Thanks
  2. thanks for understanding and helping @PFMABiSmAd I will attempt what you said.
  3. @Psycho it seems the lines dont display the user information typed in the HTML page and then processed and a correct output to the PHP page. Maybe It should have been wise to explain the code... #fail
  4. Guys guys woah I am not making a scam or doing anything lol . My teacher uses a washington university CS course as the basis of her materials and the actual page I am writing is oddly created by her and it basically is a page to "buy your grades" . I understand the basis of why everyone is suspecting this the issue is the POST command would not/will not display the information entered on the html page on the PHP.
  5. I ran through all the possibilities of strings , paranthesis , basically the syntax issues but can seem to figure out whats throwing a fit. It seems lines 15, 16 , 17 are giving problems . <!DOCTYPE html > <html> <head> <title>Buy Your Way to a Better Education!</title> <link href="http://www.cs.washington.edu/education/courses/cse190m/09sp/labs/4-buyagrade/buyagrade.css" type="text/css" rel="stylesheet" /> </head> <body> <h1>Thanks, sucker!</h1> <p>Your information has been recorded.</p> <?php $name = $_POST['name']; $ccNo = $_POST['ccNo']; $ccType = $_POST['ccType']; echo "Your name ". $name . " " . "<br/>"; echo "Credit Card Type:" . $ccType . "<br />"; echo "Credit Card No: " . $ccNo; ?> </body> </html>
  6. thanks for all the help yea I just did a whole bunch of reading in the past couple hours especially on the error reporting in the php.ini file you saved a lot of headaches for me.
  7. Wow! That worked thank you so much! i love Gigi by the way and all dance and trance type of music I know in Europe its way more popular than over here in the states. So As Im going through the code so I understand it seems this is html5 code <li class="mp3item"> <audio controls="controls"> <!-- 1. play the file if the browser supports it. --> <source src="mp3/<?= htmlentities($mp3file->getFilename(), ENT_QUOTES) ?>" type="audio/mpeg"> <!-- 2. embed flash player here and let flash play the file --> <!-- 3. let them download the file and play it in their default music player --> <a href="mp3/<?= urlencode($mp3file->getFilename()) ?>" class="mp3"> <?= htmlentities($mp3file->getFilename()) ?> </a> </audio> and you have some PHP right before it : <!-- Invoked GlobIterator which iterates through a filesystem to find matching file names --> <?php $mp3files = new GlobIterator('mp3/*.mp3'); ?> <ul> <!--Foreach loop --> correct? Also if I renable the orginal foreach to go through all the songs i have in the htdocs directory in xampp the original music list still appears but also the data in the foreach is shown like this: Gigi D'Agostino - L'Amour Toujours ( Official Video ).mp3 [4] => KennedyKarate.mp3 ) Array ( [0] => . [1] => .. I also wanted to know more about this : Is it actually code which makes the files relative to the person using them or about to stream them? htdocs `- mp3/ `- index.php and for the error reporting code can I just place that in between a new set of PHP tags or can it be placed at the end of any PHP segment? Thank you ignace for all your help so far!
  8. Ok I think im getting somewhere thanks to everyone so far helping me through this. I decided not to have a loop because I dont have many items to display and I think its a waste of time to use a foreach in this small scenario since I only need links to play a file when clicked this is what I have modified so far: <?php $directory = 'C:\Users\test\Desktop\Main\xampp\htdocs\mp3'; $files = scandir($directory); // print_r($files); //Uncomment to debug /*foreach($files as $file) { /* for now dont put any code in the body of foreach loop to test songs */ //print the files in the array //print_r($files); //} ?> <li class="mp3item"> <a href= "C:\Users\test\Desktop\Main\xampp\htdocs\mp3">Gigi D'Agostino - L'Amour Toujours</a> <?= @basename($song) ?> </li> <li class="mp3item"> <a href= "C:\Users\test\Desktop\Main\xampp\htdocs\mp3">KennedyKarate</a> <?= @basename($song) ?> I'm trying to find a way which will allow me to play the file I don't know why clicking doesn't do anything even though the correct directory is given and everything is there something in php I'm missing ?
  9. hmm ok its easier or better just to print the contents of the array itself .. I tried that code and messed around with it I ran in via localhost(xampp) and this what the page returned: Gigi D'Agostino - L'Amour Toujours ( Official Video ).mp3 [4] => KennedyKarate.mp3 ) Array ( [0] => . [1] => .. . So it its printing the array but I want just the song name to show with the mp3 file logo and also when clicked it plays it within the browser
  10. Hi guys I needed some help and I found this forum so I thought I'd give it a try. I have this lab that Im doing and instructor really didnt go into detail on how to do it even the code that was demoed was not really helpful in the class . My issue is that I cant seem to get my foreach loop to read the files in the directory i specified and display the name along with being able to play the file as well . Any pointers would be great its over my head at this point . Thanks <!DOCTYPE html > <head> <title>Music Viewer</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <link href="http://www.cs.washington.edu/education/courses/cse190m/09sp/labs/3-music/viewer.css" type="text/css" rel="stylesheet" /> </head> <body> <div id="header"> <h1>190M Music Playlist Viewer</h1> <h2>Search Through Your Playlists and Music</h2> </div> <div id="listarea"> <ul id="musiclist"> <!-- *means is equivalent to windows explorer search --> <?php foreach (scandir(C:\Users\test\Desktop\Main\xampp\htdocs\mp3)("./mp3/*.mp3") as $song) { ?> <li class="mp3item"> <a href="./<?= $song ?>"> <?= basename($song) ?> </a> <!--end of href -- > </li> </ul> </div> </body> </html>
×
×
  • 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.