Jump to content

jnerotrix

Members
  • Posts

    208
  • Joined

  • Last visited

    Never

Everything posted by jnerotrix

  1. This Stuff is soo confusing do you guys see anything wrong with my codes >.<
  2. I just get an errors thing and i dont know what to put for numbers on the 5,0,0 Please help thanks
  3. hello I have a script that takes ip's and puts them into a text file php gets the ip checks if its already in the file ip.txt if it is not in the file it adds the ip to ip.txt on a new line then another script counts the number of lines. I need the Number of Lines Counted to show up on the image heres all the codes so far ------------ Files: visits.php track.php ip.txt index.php and heres the image i need the text to show up on I need the Text to Show up Next to Total Visits but i dont know how Visit.php <?php include('track.php'); $file = "ip.txt"; $users = count(file($file)); $string = $users; $im = imagecreatefrompng('./track.png'); $textColor = imagecolorallocate ($im, 255, 255, 255); imagestring($im, 5, 0, 0, "$string", $textColor); header ("Content-type: image/png"); imagepng($im); ?> track.php <?php $ip = $_SERVER['REMOTE_ADDR']; $myFile = "ip.txt"; $lines = file($myFile); $lines = array_map('trim',$lines); if(!in_array($ip,$lines)){ $fh = fopen($myFile, 'a') or die("can't open file"); $stringData = "$ip\r\n"; fwrite($fh, $stringData); fclose($fh); } ?> then theres ip.txt and index.php <center> <br><br><br> <h1> Numbmer Of Visited Users Test <br> <?php include ('visits.php'); ?> </center> All I see on the page is The Image "http://joeyelectric.comuf.com/search/index.php" Could Not Be Displayed Because it Contains Errors Please Help Thanks, jnerotrix
  4. is it possible to make a page like this INDEX.php <?php session_start(); ?> <title> View it </title> <center> <table border="1"> <form action="./build.php" method="post"> <tr> <td>Video Url:<input type="text" readonly="1" value="http://www.youtube.com/watch?v=" size="30"><input type="Text" name="url"></td> </tr> <tr> <td>(Number)<input type="text" name="times" value="10"> of Times to Display Video in <input type="text" name="reloadtime" value="5">(Seconds)</td> </tr> <tr> <td>Set Width <input type="text" name="setwidth" value="425"> Set Height <input type="text" name="setheight" value="344"> </tr> <tr> <td align="center" valign="center"><input type="submit" name="action" value="Submit"> <input type="hidden" name="submitted" value="yes"> </td> </tr> </form </table> Build.php <?php session_start(); ?> <title> View it </title> <center> <?php $_SESSION['numtimes'] = (isset($_POST['times']) && is_numeric($_POST['times']))?$_POST['times']:10; $_SESSION['url'] = $_POST['url']; $_SESSION['reload'] = $_POST['reloadtime']; $_SESSION['w'] = $_POST['setwidth']; $_SESSION['h'] = $_POST['setheight']; $autoplay = "&autoplay=1"; if ($HTTP_POST_VARS["submitted"] == "yes"){ echo "<meta http-equiv='refresh' content='{$_SESSION['reload']}'>"; } for ($i=0; $i < $_SESSION['numtimes']; $i++) { echo "<object width='{$_SESSION['w']}' height='{$_SESSION['h']}'><param name='movie' value='http://www.youtube.com/v/{$_SESSION['url']}&hl=en&fs=1'></param><param name='allowFullScreen' value='false'></param><param name='allowscriptaccess' value='always'></param><embed src='http://www.youtube.com/v/{$_SESSION['url']}&hl=en&fs=1$autoplay' type='application/x-shockwave-flash' allowscriptaccess='always' allowfullscreen='false' width='{$_SESSION['w']}' height='{$_SESSION['h']}'></embed></object>"; } ?> and then go to another page automatically after 30 seconds without losing the sessions data?
  5. ok thats fixed but now i have a sessions problem i get this session error Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /www/rack111.com/p/o/p/popcornpetz/htdocs/header.php:7) in /www/rack111.com/p/o/p/popcornpetz/htdocs/index.php on line 11 Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /www/rack111.com/p/o/p/popcornpetz/htdocs/header.php:7) in /www/rack111.com/p/o/p/popcornpetz/htdocs/index.php on line 11 and heres the page code <?php include('header.php'); ?> <title> View it </title> <center> <?php if (isset($_POST['action'])) { session_start(); $_SESSION['numtimes'] = (isset($_POST['times']) && is_numeric($_POST['times']))?$_POST['times']:10; $_SESSION['url'] = $_POST['url']; $_SESSION['reload'] = $_POST['reloadtime']; $_SESSION['w'] = $_POST['setwidth']; $_SESSION['h'] = $_POST['setheight']; $autoplay = "&autoplay=1"; if ($HTTP_POST_VARS["submitted"] == "yes"){ echo "<meta http-equiv='refresh' content='{$_SESSION['reload']}'>"; } for ($i=0; $i < $_SESSION['numtimes']; $i++) { echo "<object width='{$_SESSION['w']}' height='{$_SESSION['h']}'><param name='movie' value='http://www.youtube.com/v/{$_SESSION['url']}&hl=en&fs=1'></param><param name='allowFullScreen' value='false'></param><param name='allowscriptaccess' value='always'></param><embed src='http://www.youtube.com/v/{$_SESSION['url']}&hl=en&fs=1$autoplay' type='application/x-shockwave-flash' allowscriptaccess='always' allowfullscreen='false' width='{$_SESSION['w']}' height='{$_SESSION['h']}'></embed></object>"; } } ?> <table border="1"> <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post"> <tr> <td>Video Url:<input type="text" readonly="1" value="http://www.youtube.com/watch?v=" size="30"><input type="Text" name="url"></td> </tr> <tr> <td>(Number)<input type="text" name="times" value="10"> of Times to Display Video in <input type="text" name="reloadtime" value="5">(Seconds)</td> </tr> <tr> <td>Set Width <input type="text" name="setwidth" value="425"> Set Height <input type="text" name="setheight" value="344"> </tr> <tr> <td align="center" valign="center"><input type="submit" name="action" value="Submit"> <input type="hidden" name="submitted" value="yes"> </td> </tr> </form </table>
  6. Here is the error i get: Parse error: syntax error, unexpected T_VARIABLE, expecting ',' or ';' in /www/rack111.com/p/o/p/popcornpetz/htdocs/index.php on line 21 In this code <?php include('header.php'); ?> <title> View it </title> <center> <?php if (isset($_POST['action'])) { session_start(); $_SESSION['numtimes'] = (isset($_POST['times']) && is_numeric($_POST['times']))?$_POST['times']:10; $_SESSION['url'] = $_POST['url']; $_SESSION['reload'] = $_POST['reloadtime']; $_SESSION['w'] = $_POST['setwidth']; $_SESSION['h'] = $_POST['setheight']; $autoplay = "&autoplay=1"; if ($HTTP_POST_VARS["submitted"] == "yes"){ echo "<meta http-equiv='refresh' content=/"$_SESSION['reload'];">"; } for ($i=0; $i < $_SESSION['numtimes']; $i++) { echo '<object width="' . $_SESSION['w']; . '" height="' . $_SESSION['h']; . '"><param name="movie" value="http://www.youtube.com/v/' . $_SESSION['url'] . '&hl=en&fs=1"></param><param name="allowFullScreen" value="false"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/' . $_SESSION['url'] . '&hl=en&fs=1$autoplay" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="false" width="' . $_SESSION['w'] . '" height="' . $_SESSION['h'] . '"></embed></object>'; } } ?> <table border="1"> <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post"> <tr> <td>Video Url:<input type="text" readonly="1" value="http://www.youtube.com/watch?v=" size="30"><input type="Text" name="url"></td> </tr> <tr> <td>(Number)<input type="text" name="times" value="10"> of Times to Display Video in <input type="text" name="reloadtime" value="5">(Seconds)</td> </tr> <tr> <td>Set Width <input type="text" name="setwidth" value="425"> Set Height <input type="text" name="setheight" value="344"> </tr> <tr> <td align="center" valign="center"><input type="submit" name="action" value="Submit"> <input type="hidden" name="submitted" value="yes"> </td> </tr> </form </table>
  7. i have a website but and a form they input the data but i need the data they input into the form into a session so the variable is not forgotten so lets say it was like this <?php <form action="2.php" method="post"> NAME: <input type="text" name="1"><br> <input type="submit" value="go"> </form> ?> NEXT PAGE <?php session_start(); $name = $_POST['1']; echo "hello $name"; ?> <a href="./3.php">GOTO THE NEXT PAGE</a> 3d PAGE <?php session_start(); $name = $_POST['1']; echo "hello $name"; ?> Bassicaly i need it to save the inputed data into a session thats rememberd over a series of pages
  8. ok now i just need to make the login page This is login.php <form action="login2.php" method="post"> UserName: <input type="text" name="user"><br> Password: <input type="password" name="pass"><br> <input type="submit" value="LOGIN"> </form> What Woulf i put on the login2.php page to check if the login info was correct then put them into a session
  9. I have an administration page i have a mysql database popcornpetz_main TABLE: admin (3) Fields username password id (auto Increment) ------------------- I need it so that user must be logged in to view the admin page but i am unsure of how to do this there is no register page needed i just need the page to show if the user is logged in and to show something else if they are not maybe with a session or something but i dont know how also i need a logout button. so it would be like this if admin is logged in { show this } else { show this } thanks for any help jnerotrix
  10. Heres The Code I Have <?php $ip = $_SERVER['REMOTE_ADDR']; //Checks Ip $myFile = "ip.txt"; $lines = file($myFile); $lines = array_map('trim',$lines); if(!in_array($ip,$lines)){ $fh = fopen($myFile, 'a') or die("can't open file"); $stringData = "$ip\r\n"; fwrite($fh, $stringData); fclose($fh); } $file = "ip.txt"; $users = count(file($file)); echo "We Have Had $users users Visit This Site"; ?> I need it so - - - if $users = 1000 then do command else do other command so it would look like this i just dont know how to code it <?php if ($users equals 1000 { echo "you are the 1000 User To Visit this Site"; } else { echo "Welcome to My Website"; } ?>
  11. Here is something I made a while back it puts user ip's into a text file on a new line and won't add the same ip twice Http://mytestsite.rack111.com/counter/usertrack.zip
  12. UPDATE *** ADDED NEW STYLE ------------------------------ Well yea i need more topics its a new forum so i need users to come and visit it But not sure how I am going to advertise it
  13. I created a Webmaster Forums Please Leave Comments on what you think::: http://epicbux.com/forums Any Suggestion Please Let Me Know
  14. Try this then replace this $Name = "name"; //senders name $email = "name@name.com"; //senders e-mail adress $recipient = $_REQUEST['email']; //recipient $reply = "Congratulations! Video access for " .$_POST['fname']." ".$_POST['lname'].""; with this $fname = $_POST['fname']; $lname = $_POST['lname']; $Name = "name"; //senders name $email = "name@name.com"; //senders e-mail adress $recipient = $_REQUEST['email']; //recipient $reply = "Congratulations! Video access for $fname $lname ";
  15. try replacing $reply = "Congratulations! Video access for " .$_POST['fname']." ".$_POST['lname'].""; with this $reply = "Congratulations! Video access for ' . $_POST['fname'] . ' ' . $_POST['lname'] . '"; I EDITED IT SORRY NOW TRY IT
  16. try replacing $reply = "Congratulations! Video access for " .$_POST['fname']." ".$_POST['lname'].""; with this $reply = "Congratulations! Video access for ' . $_POST['fname']. ' ' . $_POST['lname'] . '";
  17. That code tells php display any errors in the code no matter what the error is it just displays it
  18. ini_set ("display_errors", "1"); error_reporting(E_ALL); This code makes your page display all errors that go on in your website just use copy and paste this <?php ini_set ("display_errors", "1"); error_reporting(E_ALL); function spamcheck($field) { //filter_var() sanitizes the e-mail //address using FILTER_SANITIZE_EMAIL $field=filter_var($field, FILTER_SANITIZE_EMAIL); //filter_var() validates the e-mail //address using FILTER_VALIDATE_EMAIL if(filter_var($field, FILTER_VALIDATE_EMAIL)) { return TRUE; } else { return FALSE; } } if (isset($_REQUEST['email'])) {//if "email" is filled out, proceed //check if the email address is invalid $mailcheck = spamcheck($_REQUEST['email']); if ($mailcheck==FALSE) { echo "Invalid input"; } else {//send email $Name = "name"; //senders name $email = "name@name.com"; //senders e-mail adress $recipient = $_REQUEST['email']; //recipient $reply = "Congratulations! Video access for " .$_POST['fname']." ".$_POST['lname'].""; $mail_body = "content "; //mail body $subject = "Video Access"; //subject $headers = "From: ". $Name . " <" . $email . ">\r\nbcc: susiem@multiprobe.com\r\n"; //optional headerfields $headers .= "BCC: name2@name2.com\r\n"; mail($recipient, $subject, $mail_body, $reply, $headers); //mail command echo "<font size='3'><font color='#c61317'><strong>Thank you.</font></strong> Please check your email for the access link.</font>"; } } else {//if "email" is not filled out, display the form echo "<form method='post' action='videoAccess.php'> First Name: <input name='fname' type='text' /><br /> Last Name: <input name='lname' type='text' /><br /> Email: <input name='email' type='text' /><br /><br /> Subject: <strong>Subject</strong><br /><br /> <input type='submit' /> </form>"; } ?>
  19. :| Now i get this error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''desc') VALUES ('Test', 'Test', 'test')' at line 1
  20. can you change the code for me because i tried and it doesnt work
  21. I get this error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'desc) VALUES ('TEST', 'TEST', 'TEST')' at line 1 TEST TEST TEST is the values i inputted into the form Heres The Code <?php include('header.php'); if (isset($_POST['action'])) { include('info.php'); $host = "$host1"; $user = "$user1"; $pass = "$pass1"; $data = "$data1"; mysql_connect("$host", "$user", "$pass") or die(mysql_error()); mysql_select_db("$data") or die(mysql_error()); $name = mysql_real_escape_string($_POST['name']); $email = mysql_real_escape_string($_POST['email']); $desc = mysql_real_escape_string($_POST['desc']); mysql_query("INSERT INTO requests (name, email, desc) VALUES ('$name', '$email', '$desc')") or die(mysql_error()); echo "<h1>Thank you For Submitting a Request</h1>"; } else {
  22. are the subscribing users registered? if so u can give each registered user a "member_id" in the mysql database and then just check if their member_id is the table so when the subscribe it adds their *email & member_id to the table then checks if the member_id is already there if it is display page or if it isnt display display the mailing list subscription box
  23. Its supposed to check if $memberid is in there and check if $memberid matches member_id and if they match do not display that survey id This is They Query i have so far but it doesnt do what i want it to do $query = "select survey.id, survey.title, survey.adlink from survey left join completed_surveys on ( survey.id = completed_surveys.survey_id ) WHERE completed_surveys.survey_id IS NULL AND completed_surveys.member_id=$memberid"; and heres the whole code <?php mysql_connect("localhost", "sex1800_admin", "12921993") or die(mysql_error()); //add you password mysql_select_db("sex1800_loginbux") or die(mysql_error()); $memberid = (is_numeric($_GET['id'])) ? $_GET['id'] : 0; $query = "select survey.id, survey.title, survey.adlink from survey left join completed_surveys on ( survey.id = completed_surveys.survey_id ) WHERE completed_surveys.survey_id IS NULL AND completed_surveys.member_id=$memberid"; $result = mysql_query($query) or die(mysql_error()); ?> Number Of Surveys Available = <?php echo mysql_num_rows($result); ?> <?php while($row = mysql_fetch_array($result)){ echo "<tr><td><a href=\"survey.php?id={$row['id']}\">{$row['title']}</a></td></tr>"; } ?>
  24. This is with only 1 survey completed (by this user) b9521aad02a2687525db14f43f8662ea Member Id b9521aad02a2687525db14f43f8662ea end of test <-- in this its reading all the member_id in completed_survey its supposed to check if $memberid is in there and check if $memberid matches member_id and if they match do not display that survey id
×
×
  • 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.