wildteen88
Staff Alumni-
Posts
10,480 -
Joined
-
Last visited
Never
Everything posted by wildteen88
-
What do you want your script do? Please explain more.
-
Yes you can in the httpd.conf. However can you access your router if you stop Apache? If you still can't access your router after Apache has stopped then either your router is borked or your routers address is not 192.168.0.1 (this the most likely scenario) Is your router attached to your PC? What yppe of router is it (Wired or Wireless). Can you post the model and make of your router. If you tell me this then I can search for the manual for that router to understand how it works. I still standby what I said last time though. This has got to be your computers LAN address. Your computers LAN address will not be the same as your routers address.
-
Your else is in the wrong the place. It should got directly after the if statement: if (isset ($cities[$destination])) { $distance = $cities[$destination]; $time = round(($distance / 60), 2); $walktime = round(($distance / 5), 2); print "The distance between Chicago and <i> $destination</i> is $distance miles."; print "<br>Driving at 60 miles per hour it would take $time hours."; print "<br>Walking at 5 miles per hour it would take $walktime hours."; } else { print "Sorry, do not have destination information for $destination."; }
-
Can you please post the necessary lines, I'd recommend posting lines 60 - 75 You maybe closing the if statement prematurely.
-
Unless header.php is included after you set the $title varable in the call center page then header.php will set the title to <title>Intranet - Call Centre</title> If header.php is set before then header.php will not retrieve the new updated title variable. PHP does not backtrack.
-
Ooh! I see now. Try: <?php $lines = file('welcome.txt'); foreach($lines as $line) { // check the line starts with a number 1 if(substr($line, 0, 1) == '1') { $line = substr($line, 1, strlen($line)); //replace the space(s) or tab(s) into 1 space only $line = preg_replace('/(\ +|\t+)/', ' ', trim($line)); //get the per word $words = explode(' ', $line); echo '<p><b>Heading Code:</b>' . $words[0] . '<br />'; echo '<b>Udac Code:</b>' . $words[1] . '<br />'; echo '<b>Udac Rate:</b>' . $words[2] . '<br />'; // intelligently display remaining datas. Not need to do: /* @list($udac[1], ...etc ..., $udac[50])= split('[/,]', $words[4]); echo '<p><b>extraudac1:</b> ' . @$i . @$udac[$i] . '<br />'; ... etc ... echo '<b>extraudacrate25:</b> ' . $udac[50] . '</p>'; */ // just use a simple explode and a foreach statement $i = 1; // sperarate each peice of data from comma delimited list foreach(explode(',', end($words)) as $data_bit) { $bit = explode('/', $data_bit); echo '<b>extraudac'.$i.':</b> ' . $bit[0] . '<br />'; echo '<b>extraudacrate'.$i.'</b>: ' . $bit[1] . '<br />'; $i++; } echo '</p>'; } } ?>
-
Prepend $_SERVER['DOCUMENT_ROOT'] to your includes: include $_SERVER['DOCUMENT_ROOT'] . 'header.php';
-
OP wants a html line break not a newline. str_replace("[break]", "<br />", $string);
-
Huh! So where's my code? Now I'm confused! What on earth is the following supposed to do: list($udac[1], $udac[2], $udac[3], $udac[4], $udac[5], $udac[6], $udac[7], $udac[8], $udac[9], $udac[10], $udac[11], $udac[12], $udac[13], $udac[14], $udac[15], $udac[16], $udac[17], $udac[18], $udac[19], $udac[20], $udac[21], $udac[22], $udac[23], $udac[24], $udac[25], $udac[26], $udac[27], $udac[28], $udac[29], $udac[30], $udac[31], $udac[32], $udac[33], $udac[34], $udac[35], $udac[36], $udac[37], $udac[38], $udac[39], $udac[40], $udac[41], $udac[42], $udac[43], $udac[44], $udac[45], $udac[46], $udac[47], $udac[48], $udac[49], $udac[50])= split('[/,]', $words[4]); We're back to square one now. Please post the exact data in welcome.txt (only a few lines will suffice) and then tell me what output you want.
-
can i see anywhere if apache has been assigned router IP? By having a look in Apaches configuration file which is called httpd.conf level one i do not remember the model. The make and model is usually printed on the base of the router itself and the manual. logically i know that it would have 127.0.0.1 127.0.0.1 is a loop back address. This ip is used by your computer.
-
You'll need to use urlencode to pass special characters over the url. Now this will cause your nice clean urls to become messy, eg: %3Fh%3D%A31000-pounds Now I rremember you from last time, as I got you to change your query so it retrieves the story from the headline field rather than the id field in the database. What I recommend you to do instead is create another field and call this new field urlAlias. Now in this field you store a modified/simplified version of the actual headline which will not store any special characters. This will allow for your urls to stay clean and simple. You'll need to modify your existing code to to fetch/receive the urlAlis rather than the headline for displaying/retrieving the headline in the url.
-
I did have a tutorial bookmark for using the file upload extension but I appear to of lost it. However have a read of this article which also explains it.
-
This is the problem with letting Dreamweaver take control. I have tested the provided code snippets and none of them return any syntax errors. I assumed the errors was at the following address in the following code, but that returns an image <?php @readfile('http://www.kearneyfire.org/gallery/main.php?g2_view=imageblock.External&g2_blocks=randomImage&g2_show=none'); ?> Are you sure you got the right page. The error should display the full path to script which is causing the error.
-
I'd change rhodesa code to: $file = 'data/customers.DAT'; $new_data = ''; foreach(file($file) as $Key => $Val) { $parts = explode("|", trim($Val)); $status = trim($parts[8]); $parts[8] = 'New String'; // concate each line to $new_data string. $new_data .= implode('|', $parts) . PHP_EOL; } echo '<b>Data to be written to customers.DATA:<b><pre>' . $new_data . '</pre>'; // we can then clear the contents of the customers.DAT file and rewrite the new contents: // open the file for writing (this will clear the contents of customers.DAT) $fh = fopen($file,'w'); // write new data to customers.DAT fwrite($fh, $new_data); // close file fclose($fh);
-
Hold on. How on earth did you manage to install Apache to your routers ip address. I just tried setting my Apache installation to my routers IP address and Apache fails to load. Anyway If Apache was listening on 192.168.0.1 then surely your computer wont be able to connect to the internet as no IP address was assigned by your router. What is the make and model of your router? Seems strange to me.
-
Can you post the code you're using now and the output you get when it is run. I guess you have merged the two pieces of code provided together in some way which is causing your output problem.
-
Apache should not affect your router. You are most probably going to your computers LAN address (eg 192.168.2.2), which would of been assigned by your router. Your router will have its own IP Address, normally it is something like 192.168.2.1 or 192.168.0.1 the correct address will be mentioned in yours routers manual.
-
VARCHAR has a max character length of 255 characters. SO obviously this will not suite your needs. When storing large quantities of text within a database use TEXT or LONGTEXT
-
use urlencode when adding an ampersand into the url, eg: $url = 'mysite.com?var=hello&welcome'; echo urlencode($url); when you retrieve the var url variable, use urldecode, eg: echo urldecode($_GET['var']);
-
No, usually that means there is a problem with your query. To see why your query is failing, add or die(mysql_error()) at the end of the mysql_query call, eg: $result=mysql_query ("SELECT * from upsetsbids ORDER BY HearingID ") or die(mysql_error());
-
have a look at your servers error log. the reason for the 500 internal server errors is all ways logged in the servers error log.
-
Yup everything seems to be working. However do restart your computer too just be sure everything is working as it should be. As a general rule of thumb I always avoid the PHP installer (especially if PHP is being installed with Apache). I find it can cause more problems, a good old fashioned manual install is always best.
-
I guess you installed PHP using the installer. Go to php.net and download the zip binaries package instead. Once downloaded extract the files in the zip to C:\Program Files\PHP overwriting existing files and folders. The php installer comes with limited files where as the zipped binaries comes with all files. Also did you enable the display_startup_errors setting within the php.ini too? With this setting enabled PHP will report back any errors when Apache is being (re)started. Make sure Apache is restarted afterwards in order for the new files to be loaded.
-
After testing I realised it wasn't working properly. I have just spent the last 30minutes trying to understand why it wasn't working properly and it was because of a silly mistake on my part: <?php $query = "SELECT * FROM sections s, products p WHERE p.pSection=s.sectionID ORDER BY sectionOrder ASC"; $result = mysql_query($query); echo '<table border="1" cellpadding="5" cellspacing="2">'."\n"; $prev_section = null; while($row = mysql_fetch_assoc($sql_query_result)) { if($prev_section != $row['sectionName']) { $prev_section = $row['sectionName']; echo '<tr><td><h1>' . $row['sectionName'] . '</h1><br />' . $row['sectionDescription'] ."</td></tr>\n"; } echo '<tr><td style="padding-left:30px;">' . $row['pName'] ."</td></tr>\n"; } echo "</table>"; ?>
-
Try the following: $query = "SELECT * FROM sections s, products p WHERE p.pSection=s.sectionID ORDER BY sectionOrder ASC"; $result = mysql_query($query); $prev_section = null; $sectionHeading = false; echo '<table border="1" cellpadding="5" cellspacing="2">'; while($row = mysql_fetch_assoc($result)) { if($prev_section != $row['sectionName']) { $prev_section = $row['sectionName']; $sectionHeading = false; } if(!$sectionHeading) { echo '<tr><td><h1>' . $row['sectionName'] . '</h1><br />' . $row['sectionDescription'] .'</td></tr>'; $sectionHeading = true; } else { echo '<tr><td style="paddding-left:30px;">' . $row['pName'] .'</td></tr>'; } } It is untested so it may not work.