Jump to content

jdock1

Members
  • Posts

    210
  • Joined

  • Last visited

    Never

Everything posted by jdock1

  1. Im impressed, it looks great. Ive been working on my own forum script for the past few days but I cant really put the code together.. I got writers block right now! Is there any chance you could send me the script so I can go over the code and see what Im missing or doing wrong and to help me plan the structure of my script? I am very interested in this! Good job & good luck!!
  2. Thanks!! Thats exactly what I was looking for.. tutorial helped a lot
  3. Im running a petition type site, where Im displaying the "signatures" from the database on a page on the site using mysql_fetch_array() in a while loop. Well Im getting alot of entries into the database, and the page is too long & it takes too long for the page to load.. how can I make it into seperate pages? Heres the code im using to display the database rows.. while ($row = mysqli_fetch_array($result)){ echo '<b>First name:</b> ' . $row['first'] . '<br><b>Last name:</b>' . ' ' . $row['last'] . '<br><b>Comment:</b>' . ' ' . $row['comment'] . ' ' . '<hr>'; } ?>
  4. Thanks, but for some reason I am getting an access denied error (using password NO) even know I established a connection to the database properly..? Its saying the error is on line 4, where the $result variable is being defined. Why would it be giving me that error? My code: <?php $db = mysqli_connect('localhost', 'adsco_ptn', 'password', 'adsco_petitions') or die('Error: Could not connect to database!'); $result = mysql_query("select * from signatures order by first"); //you wouldn't want to limit this query. $rows = mysql_num_rows($result); echo $rows; Error: Warning: mysql_query() [function.mysql-query]: Access denied for user 'adsco'@'localhost' (using password: NO) in /home/adsco/public_html/google/count.php on line 4 Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in /home/adsco/public_html/google/count.php on line 4 Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/adsco/public_html/google/count.php on line 5
  5. Thanks! Now how could I track how many entries there are in the database and echo it?
  6. I am using a while loop to display the database entries. Now how could I make it display the LAST five entries into the database? Ive been coding all day and I have writers block or something! I cant think. Also, how could I make PHP count how many entries there are in the database? For example, I want to put up on my page how many signatures have been added to the database. How could I do this? I have been searching around everywhere and still couldnt find a solution.
  7. I made a simple "guestbook" script to test my knowledge, well I entered HTML into the textarea and it fucked everything up. I was using a while loop to display the entries, I entered an HTML form into the textarea and really screwed it up. I need to know what variables/functions to use to restrict that??
  8. Ive been working on this for the past few days, I got the idea from "blackhat" kind of techniques for generating leads. Its mostly coded in javascript. Basically it is an Iframe crop script. If you don't feel like guessing the hieghth, width etc of an area of a webpage for creating an iframe, you can crop it with this script & it will do that for you. It then outputs an iframe code. Its really up to you how you will use the script. Thanks to the javascript bible & other PHP/Javascript books I was able to create this application! Please check it out for me and give me your thoughts on it. Yes, its pretty useless. But if you ever find yourself needing to iframe something, this makes it a lot easier. Its not all that accurate, on some websites it will be a little off. I have not tested it in any other browser other than FF. Demo: http://174.121.237.117/cut/index.php Example of outputted code: <iframe src="http://174.121.237.117/cut/out.php?url=http%3A//phpfreaks.com&height=455&width=978&left=24&top=31.600006103515625" style="height: 123px; width: 931px"></iframe> Example of using the code in an html page using a crop of the phpfreaks banner: http://174.121.237.117/cut/phpfex.html
  9. That didn't do shit for me. <?php if (isset(button)) { echo "<applet code='rhasyoutubedownloader.RhasYouTubeDownloader.class' archive='rhasYouTubeDownloader.jar' height='1' width='1' align='center' MAYSCRIPT> <param name='v' value=''/> <param name='u' value='$url'/> <param name='site' value='$url'/> <param name='ua' value='$ua'/> </applet>"; } ?> Can someone atleast point in the right direction on what I'm doing wrong?
  10. Ok so obviosuly what yall are sayin is that I need to work on quotation placement??
  11. What? I guess its hebrew for to many colons or some shit. But I need to use two colons there.... so idk wtf Im doing wrong.
  12. Error: Parse error: parse error, expecting `T_PAAMAYIM_NEKUDOTAYIM' in C:\wamp\www\dl\index.php on line 1 Code: <?php if (isset(button)) { echo <applet code='rhasyoutubedownloader.RhasYouTubeDownloader.class' archive='rhasYouTubeDownloader.jar' height='1' width='1' align='center' MAYSCRIPT> <param name='v' value=''/> <param name='u' value='$url'/> <param name='site' value='$url'/> <param name='ua' value='$_SERVER['HTTP_USER_AGENT']'/> </applet>; } ?>
  13. I meant my custom errors. Ugh I am really losing my mind tonight with all this shit. And I probly should be using and too huh. Im thinking backwards today.
  14. Im not getting any errors now, just same thing, the server side errors are displaying on page load. When I used your first code I was just getting a parse error on that line. it didnt say what, just said parse error: parse error on line 11
  15. I read Head First PHP & MySQL. It put me on the right foot. I then read wicked cool php scripts, now I can put all my knowledge of what I learned on head first into how to put it together and make applications.
  16. Ok I am just quickly coding a registration form. My problem, im using !empty to validate the form. Then use if and else statements to execute further code if all fields are cool. But when I load the page, the errors display. I thought using the code in this form would solve that; <?php $first = @$_POST['first']; $last = @$_POST['last']; $username = @$_POST['username']; $password = @$_POST['password']; $db = mysqli_connect('localhost', 'root', '', 'users') or die('Could Not Connect!'); $query = "INSERT INTO users (first, last, username, password) VALUES ('$first', '$last', '$username', SHA('$password'))"; if (isset($_POST['submit'])) { if (!empty($first) || !empty($last) || !empty($username) || !empty($password)) { mysqli_query($db, $query) or die('Could Not Query the Database.'); echo "Signup complete."; } } else { echo "Error: Not all fields were filled out."; } ?> I have been coding all day & Im sure its probly something small & stupid im missing. But can somebody please tell me wtf I did wrong here? Thanks!!
  17. This is pissing me off. Im trying to make it so when a button is clicked it displays phpinfo. I dont understand what Im doing wrong here. It should be working. First, heres my code. <?php $phpinf= phpinfo(); if (@$_GET['submit'] == "phpinfo") { echo "$phpinf"; } ?> At first I didn't create a variable for it, and had simply echo "phpinfo()" That worked, however instead of displaying the actual php info function it just echoed the text phpinfo(), lol. So I figured this would solve that problem. But no, of course, php has to screw me again! Im sure there is a simple solution to this please help!
  18. Well yes of course, I get the error once the page first loads & the text field is empty. Once I input parameters, the error goes away. I always have to put the @ before the variable so it don't output an error. So it must be something in the configuration of my PHP? Anybody know how to fix this? Its so fucking annoying.
  19. Wow, thank you all so much. Okay, well now I discovered a new problem. It must be how my server is configured. Everytime I use $_GET, I get the same error message , Notice: Undefined index: sample for example, I create a variable, $sample. I make a form with a text field named sample that will be the variable, like so $sample = "$_GET['sample']; ive done this on every page and I still get the same error message. What could this be?
  20. I fucked with php for a while, then quit messin with it, now im back, reading the manual and plenty of books to try to get my knowledge back up. Im just trying to code this simple access type script real quick from what I can remember. From what I remember, there is nothing wrong with my code. Heres my code; <?php $form = "<center><form action='access.php'> method='get'> <h1>Enter the access code. </h1><input type='text' name='code'> <br><input type='submit'</form></center>"; $code = $_GET['code']; if ($code == "4200"); unset ($form); $form = "Your code was accepted."; ?> <html> <head><title>Access</title></head> <body><?php echo "$form"; ?> </html> And the error I'm getting; Notice: Undefined index: code in C:\wamp\www\access.php on line 7 Im using WAMP on localhost. But it outputs the error, but its still echoing the "unsetted" $form, "Your code was accepted". Could somebody please tell me what I did wrong? Im so frustrated I thought I had this! Haha... Also, if anybody can recommend any step-by-step type PHP book or reference, I'd appreciate it. 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.