wildteen88
Staff Alumni-
Posts
10,480 -
Joined
-
Last visited
Never
Everything posted by wildteen88
-
I believe your new site that has PHP5 has a setting called [b]register_long_arrays[/b] turned off in the php.ini and so your [b]$HTTP_*_VAR[/b]'s are not being populated/recognised. In order for your script to work correctly take of the HTTP and _VAR bits in your variable names like so: $HTTP_POST_VAR become $_POST $HTTP_GET_VAR becomes $_GET $HTTP_SERVER_VAR becomes $_SERVER You should use the much new superglobal arrays instead, which $_POST, $_GET, $_COOKIE, $_SESSION, $_SERVER etc.
-
Thanx for thew replies everone. [!--quoteo(post=376390:date=May 23 2006, 05:36 PM:name=jcombs_31)--][div class=\'quotetop\']QUOTE(jcombs_31 @ May 23 2006, 05:36 PM) [snapback]376390[/snapback][/div][div class=\'quotemain\'][!--quotec--] just looks blurry now, i prefer the original. [/quote] Aftert playing with the filters I managed to sharpen the edges. Its more crisper now.
-
The output occured around line 22 in [b]header.php[/b] and the error was triggered in [b]main.php[/b] on line 4. If you could post lines 15 - 25 from header.php here and lines 1 - 6 from main.php here too we'll be able to help you alot more. You are getting that error message becuase there is output before the use of the session_start() was called. You cannot output any html/text/whitespace before the use of session_start.
-
This function allows developers to preserve xHTML compliance when PHP generates URLs. [code]<a href="http://www.site.com/page.php?arg1=foo&arg2=bar">Foobar</a>[/code] If you didn't tell PHP to use & amp; (with out the space) in the url as the seperator your page will fail to validate as xHTML compliance with the w3C HTML Validator. Hope that clears up what that setting does.
-
You'll want to use preg_replace_callback instead if you want to call a function when using regular expressions like so: [code]<?php function highlight_php($matches) { $php = highlight_string($matches[0], true); //strip out the phptags $php = preg_replace("#(\[php\]|\[/php\])#i", "", $php); return $php; } $str = "[php]<?php echo \"hello world\"; ?>[/php]"; $match = "#\[php\](.*?)\[\/php\]#is"; $php = preg_replace_callback($match, 'highlight_php', $str); echo $php; ?>[/code]
-
Check that the php_mysql.dll extension is enabled in the php.ini file and that a mysql configuration section appears when you run the phpinfo() function in a php script.
-
PHP variable always defaults to siteurl???
wildteen88 replied to graysqwrl's topic in PHP Coding Help
How is the $url variable being set? As by looks of things you are setting $url as your url and not the users url. Can we see more code too. -
PHP: Warning, Unable to load Dynamic Library
wildteen88 replied to cajh06's topic in PHP Coding Help
Have you copied libmysql.dll to C:\WINDOWS folder. If you havn't do so as libmysql.dll is required in order for your mysql extension to function correctly. -
You might want to setup a cron job which calls update.php every 10minutes automatically in the background.
-
Php & phpmyadmin trouble
wildteen88 replied to cold_lazerus's topic in PHP Installation and Configuration
To install phpMyAdmin it is case of extracting the files out of the zip file to your web root folder. It shouldn't cause any problems with how youe .php files are treated. phpMyAdmin is compatible with MySQL3, 4 and 5. -
VARCHAR(255) will do for storing a hyperlink, it can store a maximun of 255 characters now to get the hyperlink out of the database I'd use this: [code]<?php //connect to database here $sql = "SELECT hyperlink_col FROM table_name"; $result = mysql_query($sql); while($row = myql_fetch_array($result)) { echo "<a href=\"" . $row['hyperlink_col'] . \">Link</a>"; } ?>[/code] Note, make sure you change hyperlink_col with the actual column name that stores the hyperlink and change table_name with the actuall name of the table you use that stores the hyperlink column in.
-
*SOLVED* preg_replace and case sensitivity!!!!!!!!
wildteen88 replied to thehigherentity's topic in PHP Coding Help
Yes the i is a pattern modifier. You might want to read up on [a href=\"http://uk.php.net/manual/en/reference.pcre.pattern.modifiers.php\" target=\"_blank\"]Pattern Modifiers here[/a] also one operator you might want to use is the [b]s[/b] operator too becuase your [ size][/size] tags might span 2 or more lines otherwise the PCRE engine wont include any newline characters. -
rather than use negiyive margins reduce the height of your .arttop class by 2 or 3 pixels as I think you have set the height too high or something and so you get that 2 or 3 pixs white line.
-
php.net manual on your site
wildteen88 replied to successlieswithme's topic in PHPFreaks.com Website Feedback
Yeah you can download the manual from php.net and then integrated the manual into your sites template. -
*SOLVED* Configure PHP with MySQL
wildteen88 replied to calcio22's topic in PHP Installation and Configuration
You need to configure PHP to use the mysql extension once you have done that you should be able to use any mysql_* functions. To configure PHP to use the mysql extension read my post [a href=\"http://www.phpfreaks.com/forums/index.php?showtopic=87276\" target=\"_blank\"]here[/a]. Note you will need to substitute any instance of C:\WINDOWS with C:\WinNT instead aswell as any instace of C:\PHP with C:\Program Files\Apache\PHP -
Change this:[code]$message = " First Name: $firstname Last Name: $lastname Age:" $message .= "implode(', ',$_POST['sex']); Operating System:" $message .= "implode(', ',$_POST['operatingsystem']); Server Side:" $message .= "implode(', ',$_POST['serverside']); Database Type: $databasetype"; $message .= "implode(', ',$_POST['database']); Email Address: $emailaddress Verify Email: $verifyemail Computer Knowledge: $computerknowledge Language Knowledge: $languageknowledge"; $message .= "implode(', ',$_POST['deadline']); Time Limit: $timelimit Project Relation: $projectrelation Description: $description ";[/code]to:[code]$message = " First Name: $firstname Last Name: $lastname Age:" . implode(', ',$_POST['sex']) . " Operating System:" . implode(', ',$_POST['operatingsystem']) . " Server Side:" . implode(', ',$_POST['serverside']) . " Database Type: $databasetype"; $message .= implode(', ',$_POST['database']) . " Email Address: $emailaddress Verify Email: $verifyemail Computer Knowledge: $computerknowledge Language Knowledge: $languageknowledge"; $message .= implode(', ',$_POST['deadline']) . " Time Limit: $timelimit Project Relation: $projectrelation Description: $description";[/code]
-
I was bored so I though umm. I have play with photoshop and decided to modernise IPB crazyman avator abit: [img src=\"http://www.phpfreaks.com/forums/style_avatars/IPB_Community_Pack/Crazyman.jpg\" border=\"0\" alt=\"IPB Image\" /] Original [img src=\"http://www.phpfreaks.com/forums/uploads/av-17232.jpg\" border=\"0\" alt=\"IPB Image\" /] Modernised Whats your thoughts?
-
Umm, How on earth are we supposed to know how to help you! You havn't told us what you are trying to do and what your current problem is. So if you could reply with more infomation we'll be able to help you lot more.
-
I have self-taught myself too. It doesn't cost any $$$ when learning PHP unless you pay for a book or go on a training course. With the basics of PHP in your head you should be able to create something simple. Like an email form or a very simple shoutbox/guestbook. Thats how I learnt PHP. The best place to go is ofcouse [a href=\"http://www.php.net\" target=\"_blank\"]http://www.php.net[/a] in order to ubderstand how to use/understand a function, or variable etc.
-
If you want to remove line breaks/carrage returns then use this: [code]$var = "This has carriage \r\nreturns in it \r . . . . \n . . . "; $var = str_replace(array("\r", "\n"), "", $var); echo $var;[/code] \r\n - for windows \r - for mac \n - linux/unix
-
The use header instead! Like so:[code] case "forums": header("Location: ./forums/index.php"); break;[/code] By still ob_start, and ob_end_flush apply. Read about [a href=\"http://uk.php.net/manual/en/function.ob-start.php\" target=\"_blank\"]ob_start here[/a] and [a href=\"http://uk.php.net/manual/en/function.ob-end-flush.php\" target=\"_blank\"]ob_end_flush here[/a] Basically it allows to turn output buffering on. While output buffering is active no output is sent from the script (other than headers), instead the output is stored in an internal buffer. And so this needed in your case as you have output before the use of session_start() or header() for that matter. Without ob_start you will continue to get headers already sent error message.
-
If it register_globals is [b]off[/b] then you use $_SERVER['PHP_SELF'] But if register_globals is [b]on[/b] you'll use $PHP_SELF Prehaps I didn't explain it very well in my last post? PHP5 has register_globals turned off by defualt, well it should be unless you or your webhost has turned it on. I see you are using [b]<?=$_SERVER['PHP_SELF']?>[/b] I would chnage that to [b]<?php echo $_SERVER['PHP_SELF']; ?>[/b] instead as not all servers are configured to use the <?= ?> tags.
-
Yes what you need to do is simply create/find a [b]favicon.ico[/b] file that you like and then upload that to your website root directory now when you go to any webpage you should see your favicon in the address bar.
-
You should use this query: [code]SET PASSWORD FOR 'some_user'@'some_host' = OLD_PASSWORD('mypass');[/code] Make sure that you change where it says [b]some_user[/b] is changed to your actuall mysql username and [b]some_host[/b] is changed to [b]localhost[/b]. Then type in your actual password where it says [b]mypass[/b] That should sort out your problem. If it doesn't then there isn't anything else you can do AFAIK. In order for this problem to be sorted out you will need to get in contact with your host to sort the problem out. What I find strange is that you can use phpMyAdmin but you cant use IPB!