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 (1/5)
0
Reputation
-
<?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
-
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
-
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
-
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
-
<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
-
<?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
-
trying to greet the user by first name and lastname when they log in??
monk.e.boy replied to cluce's topic in PHP Coding Help
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 -
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
-
how to select make/model from populated sql query list?
monk.e.boy replied to sayedsohail's topic in PHP Coding Help
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 -
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
-
[SOLVED] two different layouts in Firefox og Internet Explorer?
monk.e.boy replied to JJohnsenDK's topic in PHP Coding Help
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 -
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
-
cURL will do the page downloading bit and regex will do the text stuff. monk.e.boy
-
[SOLVED] image creation freezes under werid condition
monk.e.boy replied to bkswindell's topic in PHP Coding Help
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 -
[SOLVED] image creation freezes under werid condition
monk.e.boy replied to bkswindell's topic in PHP Coding Help
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