wildteen88
Staff Alumni-
Posts
10,480 -
Joined
-
Last visited
Never
Everything posted by wildteen88
-
I think its part of flash. As I get this in other browser too. You might be able to stop it from doing this with a bit of ActionScript but I'm not sure.
-
Why you say that? FYI PHPMyAdmin is a web based client which allows you to manage your MySQ: databases/tables. It is free an opensouce however requires your server to have PHP setup. I use phpMyAdmin a lot. If you want a windows GUI, I've not seen many good free ones. However the good ones I have seen cost and can be expensive. I use MySQL Query Browser and MySQL Administrator from time to time but not alot, which are both free and are available from MySQL.com
-
Did you change it to int? Also make sure the NULL column is set to 'null 'and not 'not null'. if its 'not null' it put in a defualt value.
-
Dont use TIMESTAMP as the datatype but use INT to store your timestamp, and set the length to 20. For some reason either phpmyadmin/mysql converts the timestamp into date/time form and doesnt keep the timestamp as numbers.
-
onChange=\"alert('Hi')\" is in the wrong place, it shoud be in the select tag: [code]<SELECT ID=\"CONTID\" NAME=\"CONTSEL\" SIZE=\"$SIZE\" onChange=\"alert('Hi')\">[/code]
-
You most probably got a setting called magic_quotes_gpc turned on which will automatically escape quotes.
-
Form help - stop user pressing back and changing submitted values
wildteen88 replied to master82's topic in PHP Coding Help
[quote author=jcbarr link=topic=102055.msg404493#msg404493 date=1153999846] You can also have the window that the form is in open in a new window and turn off the toolbar so that the back button is not visible. That is an HTML fix, but it can help. Also like he said, when they answer the question check to see if there is an entry in the database already, if there is have it output an error and forward them on to the next question. [/quote] This will not work, as the page can still go back by right clicking and selecting Back from the menu, or by simply hitting the backspace key. -
The following: [code][email protected] table for picture[/code] isnt a valid MySQL command, seems to be placed in the wrong place. The code: [code]PRIMARY KEY ('id'), UNIQUE KEY 'imagename' ('imagename')[/code] Sets up a the id field to be a primary key. Each table should at least have a primary key. The next line sets the imagename field to be unique. It stops you from adding duplicate images into the database, for example if you have an image called holiday.jpg already in the database you cannot have another image called holiday.jpg This bit of code: [code]TYPE=MyISAM AUTO_INCREMENT=9 ;[/code] Sets the engine for the table, and tells mysql where to start to auto incrementing from, in this case 9. This is an SQL comment: [code]-- -- Dumping data for table 'rate' -- [/code] A comment is code that does't get excuted - just like the HTML comment tags (<!-- comment here -->), but without the triangular brackets. This inserts the data into their respective fileds for the rate table: [code]INSERT INTO 'rate' VALUES (1, '1.jpg', 15, 20, 75, 2); INSERT INTO 'rate' VALUES (2, '2.jpg', 3, 5, 60, 0); INSERT INTO 'rate' VALUES (3, '3.jpg', 3, 5, 60, 1); INSERT INTO 'rate' VALUES (4, '4.jpg', 0, 0, 0, 0); INSERT INTO 'rate' VALUES (5, '5.jpg', 13, 15, 87, 3); INSERT INTO 'rate' VALUES (6, '6.jpg', 3, 5, 60, 1); INSERT INTO 'rate' VALUES (7, '7.jpg', 7, 10, 70, 2); INSERT INTO 'rate' VALUES (8, '8.jpg', 4, 5, 80, 1);[/code] So for this line: [code]INSERT INTO 'rate' VALUES (1, '1.jpg', 15, 20, 75, 2);[/code] It'll insert number 1 into the id field, 1.jpg into the imagename field 15 into the userrate field 20 into the maxrate field 75 into the ratepercent field 2 into the views field of the rate table. It'll do that for each INSERT INTO clause. I havn't gone into much detail, but just skimmed the surface, I would recommend you to go through the SQL Tutorials over at [url=http://www.w3schools.com/sql/sql_intro.asp]w3schools.com[/url] in order to understand the SQL syntax better. Also prehaps go through the tutoials over at [url=http://www.php-mysql-tutorial.com/]php-mysql-tutorial.com/[/url] in order to learn how to use PHP and MySQL together.
-
This is from PHP. By defualt PHPs max execution time of a script is 30secs which more than enough for a script. However in your case it appears your SQL query is taking a lot of processing time, prehaps due to too many overheads or sommit. To solve this, find and edit your php.ini file. Find the following line within the php.ini: [code]max_execution_time = 30 ; Maximum execution time of each script, in seconds[/code] Change 30 to 60. Save the php.ini. Now you'll need to restart Apache in order for the updated php setting to take affect. If that fails to work go for 120. I wouldn't advise you to go over 120 secounds. As a script shouldn't need to take 2mins or more to execute.
-
All those errors are caused by the first. It appears your php.ini has been setup to save your session data to C:\temp which currently doesnt exist. See if create a folder called temp within the root of your C: drive resolves this. Note once you have created the folder restart your server. Also whilst looking at your code provided you cannot use session_start() after any output to the browser, such as text/html. Unless you have output bufferining enabled within the php.ini. I would move session_start above the HTML.
-
Form help - stop user pressing back and changing submitted values
wildteen88 replied to master82's topic in PHP Coding Help
Theres no real way of stopping the user hitting the back button, but what you'll probably want to do is check whether the user has already inserted something into the database already. You'll probably want to the log users IP address when they complete each question, however this is not a bulletproof workaround, espcially uf the user has a dynamic ip address, which could change on every page reguest/couple of minutes etc. -
Access denied for user 'ODBC'@'localhost'
wildteen88 replied to vbnullchar's topic in PHP Coding Help
I probably should of said this earlier but you can create a constructor for PHP4. In order to do so you'll have to create a function with the same name as your class so rather than doing: [code]function __construct () {[/code] To declare your constructor, you do this for PHP4: [code]function cMysql() {[/code] Now PHP4 will automatically run the cMySQL function when you create a new instance of your class. However I'm not sure about a PHP4 equivalent to a destructor. -
Access denied for user 'ODBC'@'localhost'
wildteen88 replied to vbnullchar's topic in PHP Coding Help
Class runs fine for me on PHP5. However PHP4 doesnt support the __constuct or __destruct functions. This is only supported by PHP5. -
Well you can use those, but PHP has dedicated functions for connecting to mysql. But in order to use them you'll need to compile/enable the mysql extension. If you want to use ODCB, or any of the other DBC drivers you dont use the mysql functions, but the functions for the DBC driver. For a list of MySQL DBC drivers you can see them on [url=http://dev.mysql.com/downloads/]this[/url] page, under the Drivers and Connectors heading.
-
This becuase PHP5 doesnt come with built in support for MySQL as PHP4 does. Instead you'll need to enable the mysql extension. Please read this [url=http://www.phpfreaks.com/forums/index.php/topic,95378.0.html]tread[/url]
-
Well its not a driver but an extension, For PHP4 its bultin, but for PHP5 its is php_mysql.dll, however php_mysql.dll requires a file called libmysql.dll in order for the mysql extension to function. In order to use the mysql functions you'll need to enable the mysql extension for PHP5. If you are on Windows and have PHP5, [url=http://www.phpfreaks.com/forums/index.php/topic,95378.0.html]this thread[/url] might be able to help you. However with other OS's you'll need to compile PHP with the mysql extension.
-
Installing SMF Forums on my site and I need some MySQL help.
wildteen88 replied to Ryuko K's topic in Third Party Scripts
For ther servername it should work fine as localhost. However the MySQL username and password should have been passed down from your host, when you ordered your hosting account. I would recommend you to contact your host for this information. -
By any chance are you using variables like $PHP_SELF, $DOCUMENT_ROOT etc? I thinks its becuase a setting called register_globals has been turned off. You'll have to use the superglobal arrays in order access your form variables/server variables, such as $_POST, for POST'd data, $_GET for variables in the URL, $_SERVER for server variables, $_SESSION for session vars, $_COOKIE for cookie vars etc. So if you are using the server variable $PHP_SELF you'll need to use $_SERVER['PHP_SELF'] in order use that variable.
-
Yes, you'll be better of with regualar expressions, they are alot more powerful than str_replace, but they are little bit more complicated when you start. Have a look at [url=http://www.phpfreaks.com/forums/index.php/topic,101566.msg402102.html#msg402102]this post[/url] of a simple BBCode parser with regualar expressions.
-
Just style the row tag!: [code=php:0]echo '<tr style="color:#000000; font-size:10px;"> <td>' . $rows['lastname'] . ' ' . $rows['firstname'] . '</td> <td>' . $rows['company'] . '</td> <td>' . $rows['email'] . '</td> <td>' . $rows['homephone'] . '</td> </tr>';[/code] That'll now affect all the text within that row. It'll change the text to black and resixe the font to 10px.
-
Another difference between single and double quotes, is variables will not be parsed within single quotes, they will be treated as normal text. For example you have a variable called $foo which holds a string - bar. So when you go to echo it out with single quotes: [code]$foo = 'bar'; echo 'Hey I went to the $foo';[/code] You'll get this result: [i]Hey I went to the $foo[/i] As you can see $foo hasnt been repleaced with its value when using single quotes. However if you use double quotes it'll parse the variable: [code]$foo = 'bar'; echo "Hey I went to the $foo";[/code] Which will now give you this result: [i]Hey I went to the bar[/i]
-
Is that the full error message? Could you post the entire error message in full here in order to help you properly.
-
its becuase you have a trailing slash within your rewrite rule: [code]RewriteRule ^([^/]*)/$ /index.php?q=$1 [L][/code] Remove the slash before the $ sign, That should sort it.
-
You are using single quotes around the newline characters. PHP will treat \n or \r as-is, it will not treat them as newline/carraige return characters. You'll want to use double quotes like so: [code]$text = "This has \n new line \r chars, \n and stuff"; $text = str_replace(array("\r", "\n"), '', $text); echo '<pre>' . $text . '</pre>';[/code]