wildteen88
Staff Alumni-
Posts
10,480 -
Joined
-
Last visited
Never
Everything posted by wildteen88
-
PHP Windows Installer package problem
wildteen88 replied to dad's topic in PHP Installation and Configuration
When installing PHP on windows never use the installer. I have found the installer causes more problems then needs be. Always download the zipped binaries package instead, once downloaded extract the contents of the zip to C:\php and PHP is installed!. All that is left is for you to install and configure your preferred HTTP server (eg Apache, IIS etc). I always recommend Apache myself (I just don't get on with IIS). Once Apache is installed all the configuration you need to do is add the following to Apaches httpd.conf: LoadModule php5_module "C:/PHP/php5apache2_2.dll" PHPIniDir "C:/PHP" AddType application/x-httpd-php .php Save the httpd.conf and restart Apache. Apache should now be configured with PHP and away you go. You dont need to install linux at all to learn PHP (or HTML/CSS). However I would recommend you to look into Ubuntu if you plan on giving Linux a shot. However I do recommend you to download what is called a Live CD before installing any Linux Distro. Live CD's allow you to completely test an OS without installing anything on your computer. -
I have fixed the syntax errors <?php $url = 'https://www.paypal.com/cgi-bin/webscr'; $postdata = ''; foreach($_POST as $i => $v) { $postdata .= $i.urlencode($v).'&'; $postdata .= 'cmd_notify-validate'; } $web = parse_url($url); if ($web['scheme'] == 'https') { $web['port'] = 443; $ssl = 'ssl//'; } else { $web['port'] = 80; $ssl = ''; } $fp = @fsockopen($ssl.$web['host'], $web['port'], $errnum, $errstr, 30); if (!$fp) { echo $errnum.': '.$errstr; } else { fputs($fp, "POST ".$web['path']." HTTP/1.1\r\n"); fputs($fp, "Host: ".$web['host']."\r\n"); fputs($fp, "Content-type: application/x-www-form-urlencodedrn"); fputs($fp, "Content-length: ".strlen($postdata)."\r\n"); fputs($fp, "Connection: closernrn"); fputs($fp, $postdata . "\r\n\r\n"); while(!feof($fp)) { $info[] = @fgets($fp, 1024); } fclose($fp); $info = implode(',', $info); if (eregi('VERIFIED', $info)) { // yes valid, f.e. change payment status } else { // invalid, log error or something } } ?>
-
Umm, did you read my post? I asked you to post your whole script here.
-
@mark103 read my post above.
-
The problem is you're trying to rename a file which you do not have permission to do. This can be sorted by setting the correct write permissions to the file/directory you're trying to rename.
-
Nothing wrong with that, there may be a syntax error before that line. Also Where have you got this script from? You obviously haven't coded it yourself. You may be better of posting the whole script here for use to review for you. Currently we seem to be going line by line fixing individual errors. I strongly suggest you also learn the basics of PHP too.
-
$_SERVER['REQUEST_URI'] returns everything after your domain, so if your url is http://localhost/wheremysiteis/ then $_SERVER['REQUEST_URI'] will return "/wheremysiteis/" What are you trying to do with $_SERVER['REQUEST_URI'] variable? See if it ends in a forward slash?
-
"php if" statement within a "php if" statement?
wildteen88 replied to jacchops's topic in PHP Coding Help
I'd suggests you use an array for this rather than individual variables, so taking your example: <?php $images = array(); // image 1 $images[0]['src'] = 'Mona_Lisa.jpg'; $images[0]['title'] = 'Mona Lisa'; // image 2 $images[1]['src'] = 'image2.jpg'; $images[1]['title'] = 'Image 2 title'; // image 3 $images[2]['src'] = 'image3.jpg'; $images[2]['title'] = 'Image 3 title'; // etc ?> Now in to display the images just do: echo '<table>'; if(is_array($images)) { // cut the $image array into sets of 3 $rows = array_chunk($images, 3); // loop through the $rows array foreach($row as $col) { echo '<tr>'; foreach($col as $image) { echo '<td>'.$image['title'].'</td>'; echo '<td><img src="'.$image['src'].'" /></td>'; } echo '</tr>'; } } echo '</table>'; -
Yes it is an alias to &&
-
Not if you used $_SERVER['REQUEST_URI']. However you could just check to see $_SERVER['QUERY_STRING'] actually holds anything before adding it on to $page
-
$_FILE is a superglobal variable (just like $_GET, $_POST, $_SESSION etc). You do not need to anything in order for superglobal variables to work within a function. Can you post your form here too
-
[SOLVED] PHP5.2.6 on Apache 2.2 Errors
wildteen88 replied to maxudaskin's topic in PHP Installation and Configuration
Why are you enabling so many extensions? Some extensions rely on external libraries in order to function correctly, this will be explained in the PHP manual for whatever extension you wish to use. You should also check that the extension you wish to use actually exists in the PHP ext/ folder too, and that is of the same build version as the version of PHP installed. -
Problem I see is you're passing your content_image_insert function 10 parameters on this line: $result = content_image_insert('events','title','content','eventdate','photo','alternate',$content_title, $content,$date,$picture,'alternate'); Where as here: function content_image_insert($percent,$new_width,$new_height,$width,$height) { You're defining the function, but it only accepts 5 parameters.
-
[SOLVED] Lets help the new guy with div / content
wildteen88 replied to Trunks's topic in PHP Coding Help
You'd use include for that (like you already have done for menu.php) -
You use mod_rewrite for that. Example RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule /(.*) index.php?mode=$1 [NC,L]
-
Change your css for #maincontent and #mainlefttext to #maincontent { background-color: #CAD49F; margin: 0px; padding: 0px; border-left: 6px solid #6E5256; border-right: 6px solid #6E5256; } #mainLeftText { width: 350px; float: left; padding: 20px 0px 0px 10px; margin: 0; } Note, changes only tested in firefox
-
Remove the bodytext and sidebartext divs, then move: <div class="clear"></div> Up two lines so its before the closing tag for your bodybg div.
-
MySQL does not understand & use AND instead.
-
You also need to make sure display_errors is enabled too. error_reporting and display_errors can be set both within the php.ini and/or during runtime (within your PHP script)
-
You could just use $_SERVER['QUERY_STRING'] eg $page = $_SERVER['PHP_SELF'].'?'.$_SERVER['QUERY_STRING'] Alternatively you could just a single var called $_SERVER['REQUEST_URI']
-
This is most probably a charset issue.
-
I'm assuming you're using MySQL as your database? Not sure what you mean by flags, but if you're querying two tables you can use JOINS which is much more efficient then having two queries. Before setting up your table look into Database Normalisation. Once you've setup your tables look in to MySQL JOINS so you can query multiple tables at one.
-
Problem with Username Login PHP
wildteen88 replied to nba1985's topic in PHP Installation and Configuration
How does the user access view_profile.php? Your code will only work if your url is: http://yoursite.com/view_profile.php?get_username=USERNAME_HERE $_GET returns variables from the url. -
Deny to anyone without a certain cookie
wildteen88 replied to aximbigfan's topic in Apache HTTP Server
Apache cannot access cookies set by your site, its job is only to serve files requested by the user. You'll have to use a server side language (such as PHP, Perl etc) or client side language (such as Javascript) to access your cookie. However using cookie to check for authorisation is not very secure. Cookies are stored locally on a users computer as plain text. There is nothing stopping a user from editing a cookies value. You may be better of looking into using mod_auth to protect pages/directories on your site.