Jump to content

monk.e.boy

Members
  • Posts

    430
  • Joined

  • Last visited

    Never

Contact Methods

  • Website URL
    http://teethgrinder.co.uk/

Profile Information

  • Gender
    Not Telling

monk.e.boy's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. <?php $ch = curl_init("http://www.example.com/"); $fp = fopen("example_homepage.txt", "w"); curl_setopt($ch, CURLOPT_FILE, $fp); curl_setopt($ch, CURLOPT_HEADER, 0); curl_exec($ch); curl_close($ch); fclose($fp); ?> This is the example in the PHP help docs. : monk.e.boy
  2. You need a table for each item you are thinking of saving data about. So tables will be something like: members (id,name,email,etc) fish (id,name,fk_fish_type) fish_type (id,type) caught (fk_fish,fk_member,datetime,weight) fk_ means a foreign key to a table. It links the tables together. So table caught links the weight and date to a member and to a fish. So JOINing these you get: John,marlin,5kg,12-12-2007 I think fish type may be too much. I was thinking that you may need fresh water and sea fish. But ignore this if it is too much. So you need to think of some simple tables like the above and create them in MySQL. Don't worry if you make mistakes, we all do. MySQL is very nice and will let you add/delete/change tables at any time. Check out the database tutorials on this site. Keep asking questions monk.e.boy
  3. Try to add the login/logout bread crumb your self, if you have any problems, post your code here. You need to add a line similar to this: <?php if( $logged_in ) echo '<a href="logout.php">log out</a>'; else echo 'Hello guest, <a href="login.php">log in</a>'; ?> monk.e.boy
  4. Try downloading the free program SQLog, this will let you connect to your database and test out your SQL commands. When you have them running OK, you can past the SQL into your PHP program. You need to do this else you will have these problems every time you try to change any of your SQL. <?php $query1="insert into member (Name,Password,Email) values ('".$_POST['name']."','".$_POST['password']."','".$_POST['email']."')"; echo $query1; ?> I don't know if MySQL column names are case sensitive? I've never seen anyone use capitals in them before... monk.e.boy
  5. <html> <head> </head> <body> <?php echo 'hello'; ?> </body> </html> Like that. So maybe dreamweaver will allow you to do this? I'm not sure. Next is getting a connection to your database up and running. Are you using MySQL? Have you tested your login script on your server? monk.e.boy
  6. <?php include "connect.phtml"; $db="delranfire_org"; print_r( $_POST ); if(isset($_POST['select'])) { $query1="insert into member('name','password','email')values('$name','$password','$email')"; mysql_query($query1) or die("Error in query:$query. " .mysql_error()); } ?> Where does $name $password and $email come from? Also add: print_r( $_POST ); monk.e.boy
  7. Please read this for your site safety: http://en.wikipedia.org/wiki/Sql_injection Are you passing this SQL string to the database and looking at the results? <?php $sql = "SELECT f_name, l_name FROM auth_users WHERE username = '".$_POST["username"]."' AND password = PASSWORD('".$_POST["password"]."')"; $query = mysql_query( $sql, $connection ); if( $row = mysql_fetch_array( $query ) ) { echo 'Welcome '. $row['f_name'] .' '. $row['l_name']; } ?> monk.e.boy
  8. why is 'spider--man' and error? Why not forget regex and just look for illegal characters, if '-' is illegal, then trow out 'spider-man' if '-' is legal then 'po---------ooo' is legal. is 'jooooooooohn' legal? how about 'jo------oooooo----n'? I think your logic is a bit wonky. monk.e.boy
  9. You can't and for good reason, some evil spammer would do this and I'd lose all control of *my* browser. You need to re-think how you are going to display this info. Take a look at ebay.com, they manage to display lists of millions of items by splitting them up into 20 per page and using product hierarchies. Again, this is a user interface design problem, not a PHP problem. You need to ask a web site designer. monk.e.boy
  10. post the lines of code that are causing errors. It sounds like you need to do: if( isset( $_POST['my_variable'] ) ) { $var = $_POST['my_variable']; // etc... } because they are displaying all errors and warnings. A default install of PHP does not display all warnings. monk.e.boy
  11. Firefox and IE render stuff on the CLIENT SIDE. PHP runs on the server. So, firefox and IE have not idea what PHP (if any) is running. Your problem is with how IE renders HTML. I expect you have a problem in your HTML and CSS. IE is written by people who want your money. Firefox is written by people who want to give you access to as much of the internet as possible. Firefox is free as in freedom. monk.e.boy
  12. preg_match('/(.+?)<i>.+?<\/i>(.+)/s', $subject, $regs) You need to grab group one (everything before the < i >) and group two (everything after the </ i >) and + them together. Then
  13. cURL will do the page downloading bit and regex will do the text stuff. monk.e.boy
  14. So maybe dump the image to disk then display it in a normal HTML page? Or is this what you're doing anyway? Sounds like another PHP bug ;-) monk.e.boy
  15. http://bkswindell.dyndns.org:8091/dev/project/trunk/php/test4.php?strings=888? Very odd. My guess would be the GD has a bug in it. Try doing the same stuff but with .bmps and save it as a bmp as well. jpg and png have different types of compression which may be throwing a weird bug? monk.e.boy
×
×
  • 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.