PHP - Need To Style A Script But Have No Clue How
Howdy ya'll . . .
I am a new member here. My background with html & css is all self-taught, but I have no knowledge of PHP so I am here looking for some expert help with a problem I am having with a comments script that I have on some of the pages of my new website. So, because of my ignorance when it comes to PHP, please be gentle with me. LOL
So here is my problem:
I am using the comments script from Script Mills in the sidebar of my website.
I have overcome the first big obstacle - got it installed and working.
I posted a test comment and it worked, but I do not like the way the posted comment shows on the page.
I have searched all the script folders for a style sheet and can't find one. So my question is: how does one go about styling/changing the way the output of a script like this posts to the page?
If you need to see what I am talking about, the page http://pickmysmoker....smoker_1280.php and if it will help to understand what I am trying to do, feel free to post anything to the comment and see how it posts.
In particular, I would like to move the comments further down in the sidebar and utilize more of the sidebar area so that the comments take up more of the width.
I hope my question makes sense and there is someone here that can offer me some help/advice/guidenance in getting this squared away.
Thanks in advance . . .
Similar TutorialsThis wont work for some reason and its begining to get to me, any chance of some help? Code: [Select] <?php /* Calculator */ if($submit) { echo $numa / $numb / $numb2; { } else { ?> <form method="POST" action="<?php $_SERVER['PHP_SELF']; ?>"> <p>number 1: </p> <p> <input type="text" name="numa" size="10"> </p> <p>number 2: </p> <p> <input type="text" name="numb" size="10"> </p> <p>number 3: </p> <p> <input type="text" name="numb2" size="10"> </p> <p> <input type="submit" value="Calculate output!" name="submit"> </p> </form> <?php } ?> I've got: Quote /A/index.html /A/1/index.listing /A/2/index.listing /A/3/index.listing In index.html, I've got the following PHP code: Quote <?php $files = glob('./*/*.listing'); foreach ($files as $file) { include $file; } ?> As you can see, what PHP code does is include()'s all the index.listing files. I then create a clone of the A directory and alter the HTML in the .listing files so can tell the difference between A & B when they render: Quote /B/index.html /B/1/index.listing /B/2/index.listing /B/3/index.listing The issue I am having is "/B/index.html" is ()including the .listing files from the /A/*/ directory, when it should be including them from the /B/*/ directory. I can't understand why this is happening and hoping someone could shed some light on the issue? onkeydown="this.style.fontStyle='normal';"How can I add color: #000; to this? Thanks,
Background:
Question:
My experience: Code Examples:
function getInfo(ProductNumber){ $.ajax({ url:'Ajax-PHP-Page.php?ProductNumber='+ProductNumber, success: function(html) { document.getElementById("my_div").value = ''; document.getElementById("my_div").value = html; } }); }
function getInfo(ProductNumber) { if (window.XMLHttpRequest) { // code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp = new XMLHttpRequest(); } else { // code for IE6, IE5 xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange = function() { if (this.readyState == 4 && this.status == 200) { document.getElementById("my_div").value = this.responseText; } }; xmlhttp.open("GET","Ajax-PHP-Page.php?ProductNumber="+ProductNumber,true); xmlhttp.send(); } Thank you!! Edited May 5, 2020 by StevenOliverHi everyone! I've been working on a php script to replace links that contain a query with direct links to the files they would redirect to. I'm having trouble echoing $year in my script. Listed below is the script, just below ,$result = mysql_query("SELECT * FROM $dbname WHERE class LIKE '%$search%'") or die(mysql_error());, in the script I try to echo $year. It doesn't show up in the table on the webpage. Everything else works fine. Any help wold be appreciated greatly. Thanks in advance. <?php include 'config2.php'; $search=$_GET["search"]; // Connect to server and select database. mysql_connect($dbhost, $dbuser, $dbpass)or die("cannot connect"); mysql_select_db("vetman")or die("cannot select DB"); $result = mysql_query("SELECT * FROM $dbname WHERE class LIKE '%$search%'") or die(mysql_error()); // store the record of the "" table into $row //$current = ''; echo "<table align=center border=1>"; echo "<br>"; echo "<tr>"; echo "<td align=center>"; ?> <div style="float: center;"><a><h1><?php echo $year; ?></h1></a></div> <?php echo "</td>"; echo "</tr>"; echo "</table>"; // keeps getting the next row until there are no more to get if($result && mysql_num_rows($result) > 0) { $i = 0; $max_columns = 2; echo "<table align=center>"; echo "<br>"; while($row = mysql_fetch_array($result)) { // make the variables easy to deal with extract($row); // open row if counter is zero if($i == 0) echo "<tr>"; echo "<td align=center>"; ?> <div style="float: left;"> <div><img src="<?php echo $image1; ?>"></div> </div> <?php echo "</td>"; // increment counter - if counter = max columns, reset counter and close row if(++$i == $max_columns) { echo "</tr>"; $i=0; } // end if } // end while } // end if results // clean up table - makes your code valid! if($i > 0) { for($j=$i; $j<$max_columns;$j++) echo "<td> </td>"; echo '</tr>'; } mysql_close(); ?> </table> Hi i have this upload script which works fine it uploads image to a specified folder and sends the the details to the database. but now i am trying to instead make a modify script which is Update set so i tried to change insert to update but didnt work can someone help me out please this my insert image script which works fine but want to change to modify instead Code: [Select] <?php mysql_connect("localhost", "root", "") or die(mysql_error()) ; mysql_select_db("upload") or die(mysql_error()) ; // my file the name of the input area on the form type is the extension of the file //echo $_FILES["myfile"]["type"]; //myfile is the name of the input area on the form $name = $_FILES["image"] ["name"]; // name of the file $type = $_FILES["image"]["type"]; //type of the file $size = $_FILES["image"]["size"]; //the size of the file $temp = $_FILES["image"]["tmp_name"];//temporary file location when click upload it temporary stores on the computer and gives it a temporary name $error =array(); // this an empty array where you can then call on all of the error messages $allowed_exts = array('jpg', 'jpeg', 'png', 'gif'); // array with the following extension name values $image_type = array('image/jpg', 'image/jpeg', 'image/png', 'image/gif'); // array with the following image type values $location = 'images/'; //location of the file or directory where the file will be stored $appendic_name = "news".$name;//this append the word [news] before the name so the image would be news[nameofimage].gif // substr counts the number of carachters and then you the specify how how many you letters you want to cut off from the beginning of the word example drivers.jpg it would cut off dri, and would display vers.jpg //echo $extension = substr($name, 3); //using both substr and strpos, strpos it will delete anything before the dot in this case it finds the dot on the $name file deletes and + 1 says read after the last letter you delete because you want to display the letters after the dot. if remove the +1 it will display .gif which what we want is just gif $extension = strtolower(substr($name, strpos ($name, '.') +1));//strlower turn the extension non capital in case extension is capital example JPG will strtolower will make jpg // another way of doing is with explode // $image_ext strtolower(end(explode('.',$name))); will explode from where you want in this case from the dot adn end will display from the end after the explode $myfile = $_POST["myfile"]; if (isset($image)) // if you choose a file name do the if bellow { // if extension is not equal to any of the variables in the array $allowed_exts error appears if(in_array($extension, $allowed_exts) === false ) { $error[] = 'Extension not allowed! gif, jpg, jpeg, png only<br />'; // if no errror read next if line } // if file type is not equal to any of the variables in array $image_type error appears if(in_array($type, $image_type) === false) { $error[] = 'Type of file not allowed! only images allowed<br />'; } // if file bigger than the number bellow error message if($size > 2097152) { $error[] = 'File size must be under 2MB!'; } // check if folder exist in the server if(!file_exists ($location)) { $error[] = 'No directory ' . $location. ' on the server Please create a folder ' .$location; } } // if no error found do the move upload function if (empty($error)){ if (move_uploaded_file($temp, $location .$appendic_name)) { // insert data into database first are the field name teh values are the variables you want to insert into those fields appendic is the new name of the image mysql_query("INSERT INTO image (myfile ,image) VALUES ('$myfile', '$appendic_name')") ; exit(); } } else { foreach ($error as $error) { echo $error; } } //echo $type; ?> Hi there, I have the following code: <?php include 'config.php'; include 'opendb.php'; $query = "SELECT shop_name, street_name, town, postcode, contact_number, web_address, user_email FROM user_info"; $result = mysql_query($query); while($row = mysql_fetch_row($result)) { $shop_name = $row[0]; $street_name = $row[1]; $town = $row[2]; $postcode = $row[3]; $contact_number = $row[4]; $web_address = $row[5]; $user_email = $row[6]; echo "<h5>Name:</h5>$shop_name <br>" . "<h5>Address</h5>$street_name <br>" . "$town <br>" . "$postcode <br>" . "<h5>Contact Details</h5>Phone Number:$contact_number <br>" . "Web Address: $web_address <br>" . "Email : $user_email <br><br>"; } include 'closedb.php'; ?> But i want to make the echo return in a box which is created by the div in the css? How do i do this? Please Help!!! Well I tried adding a border to my online users box... But there are some problems.. echo "<div style="width:200px;height:100px;border:2px outset blue>$users</div>"; the ; and " in the css stuff up the php - so I get errors like this Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in /home/scswc188/public_html/index.php on line 23 Is there a way to do this? any tutorials? Thanks hey guys im really just after a bit of help/information on 2 things (hope its in the right forum).
1. basically I'm wanting to make payments from one account to another online...like paypal does...im wondering what I would need to do to be able to do this if anyone can shine some light please?
2.as seen on google you type in a query in the search bar and it generates sentences/keywords from a database
example:
so if product "chair" was in the database
whilst typing "ch" it would show "chair" for a possible match
I know it would in tale sql & json but im after a good tutorial/script of some sort.
if anyone can help with some information/sites it would be much appreciated.
Thank you
I'm trying to use this script known as SimpleImage.php that can be found here <a href="http://www.white-hat-web-design.co.uk/articles/php-image-resizing.php">link</a> I'm trying to include what is on the bottom of the page to my existing script can anyone help me I've tried several ways but its not working. Code: [Select] <?php session_start(); error_reporting(E_ALL); ini_set('display_errors','On'); //error_reporting(E_ALL); // image upload folder $image_folder = 'images/classified/'; // fieldnames in form $all_file_fields = array('image1', 'image2' ,'image3', 'image4'); // allowed filetypes $file_types = array('jpg','gif','png'); // max filesize 5mb $max_size = 5000000; //echo'<pre>';print_r($_FILES);exit; $time = time(); $count = 1; foreach($all_file_fields as $fieldname){ if($_FILES[$fieldname]['name'] != ''){ $type = substr($_FILES[$fieldname]['name'], -3, 3); // check filetype if(in_array(strtolower($type), $file_types)){ //check filesize if($_FILES[$fieldname]['size']>$max_size){ $error = "File too big. Max filesize is ".$max_size." MB"; }else{ // new filename $filename = str_replace(' ','',$myusername).'_'.$time.'_'.$count.'.'.$type; // move/upload file $target_path = $image_folder.basename($filename); move_uploaded_file($_FILES[$fieldname]['tmp_name'], $target_path); //save array with filenames $images[$count] = $image_folder.$filename; $count = $count+1; }//end if }else{ $error = "Please use jpg, gif, png files"; }//end if }//end if }//end foreach if($error != ''){ echo $error; }else{ /* -------------------------------------------------------------------------------------------------- SAVE TO DATABASE ------------------------------------------------------------------------------------ -------------------------------------------------------------------------------------------------- */ ?> Hello, I stored a fsockopen function in a separate "called.php" file, in order to run it as another thread when it needs. The called script should return results to the "master.php" script. I'm able to run the script to get the socket working, and I'm able to get results from the called script. I tried for hours but I can't do the twice both My master.php script (with socket working): Code: [Select] <?php $command = "(/mnt/opt/www/called.php $_SERVER[REMOTE_ADDR] &) > /dev/null"; $result = exec($command); echo ("result = $result\r\n"); ?> and my called.php script Code: [Select] #!/mnt/opt/usr/bin/php-cli -q <?php $device = $_SERVER['argv'][1]; $port = "8080"; $fp = fsockopen($device, $port, $errno, $errstr, 5); fwrite($fp, "test"); fclose($fp); echo ("normal end of the called.php script"); ?> In the master script, if I use Code: [Select] $command = "(/mnt/opt/www/called.php $_SERVER[REMOTE_ADDR] &) > /dev/null"; the socket works, but I have nothing in $result (note also that I don't anderstand why the ( ... &) are needed!?) and if I use Code: [Select] $command = "/mnt/opt/www/called.php $_SERVER[REMOTE_ADDR]"; I have the correct text "normal end of the called.php script" in $result but the socket connection is not performed (no errors in php logs) Could you help me to find a way to let's work the two features correctly together? Thank you. Hi, I use the following style for building my websites, I understand this is a fairly common style and was wondering if there is a name for it? Code: [Select] <?php include ('application.php'); include ('cms_config.php'); include ('templates/header.php'); switch ($_GET['action']) { case "home" : display_home(); break; case "services" : display_services(); break; case "testimonials" : display_testimonials(); break; case "contact" : display_contact(); break; default : display_home(); break; } include ('templates/footer.php'); // Function list // Display home page function display_home(){ $qid = mysql_query('SELECT * FROM testimonials ORDER BY RAND() LIMIT 0,1;'); include('templates/home.php'); } // Display services page function display_services(){ include('templates/services.php'); } // Display testimonials page function display_testimonials(){ $qid = mysql_query('SELECT * FROM Testimonials'); include('templates/testimonials.php'); } // Display home page function display_contact(){ include('templates/contact.php'); } ?> Hello! Quick question which I hope someone will be able to answer! How do I apply this style Code: [Select] <style type="text/css"> .text { font-family: Arial, Helvetica, sans-serif; color: #666; font-size: 12px; font-weight: normal; text-decoration: none; margin-right: 15px; } </style> to the code below, which will become text in an PHP generated HTML email Code: [Select] $message .= "Dear ".clean_string($Name).",\n\n"; $message .= "Thank you for your message.\n\n"; I beleive I need to use a css span class but can't get it to work! Thanks! I have an echo here, and not sure where about's I can put <br /> and want to be able to style it in the css (need to create a div class or something on it) Thank You Code: [Select] echo 'address="' . parseToXML($row['address']) . '" '; I basically would like to style the third and fourth echo, could i give it a ID then style it in css, how would i do this? any help is appreciated. my php code: Code: [Select] { $i = 0; echo '<div style="font-family:helvetica; font-size:15px; padding-left:15px; padding-top:20px;">'; while($row = mysql_fetch_array($result)) { // Loop through results $i++; echo '<img class="image1" src="'. $row['images'] .'" />'; //image echo "Displaying record $i<br>\n"; echo "<b>" . $row['id'] . "</b><br>\n"; // Where 'id' is the column/field title in the database echo "Location: ". $row['Location'] . "<br>\n"; // Where 'location' is the column/field title in the database echo "Property Type: ". $row['Property_type'] . "<br>\n"; // as above echo "Bedrooms: ". $row['Number_of_bedrooms'] . "<br>\n"; // .. echo "Purchase Type: ". $row['Purchase_type'] . "<br>\n"; // .. echo "Price: ". $row['Price_range'] . "<br>\n"; // .. } How can I style this drop-down list/box in IE, so it looks the same as how I have it in Chrome?
(see attached images)
Hi,
I am trying to align sections of my CSS layout side-by-side, but I am having problems with it.
I expect the left sidebar (#aside) with a 30% width to meet with the content section (#content) of the width of 70%. But, the changes I make are not translating as expected.
See attached screenshort of what is happening and the CSS code bellow:
#container { margin: 0 auto; width: 800px; background: #fff; } #header { background: #5a83c3; padding: 20px; } #header h1 { margin: 0; } #navigation { float: left; width: 100%; background: #d1dceb; border-top: 1px solid #fff; } #navigation ul { margin: 0; padding: 0; } #navigation ul li { list-style-type: none; display: inline; } #navigation li a { display: block; float: left; padding: 5px 10px; color: #fff; text-decoration: none; border-right: 1px solid #fff; } #navigation li a:hover { background: #383; } #content-container { float: right; width: 100%; background: #FFF url(layout-two-liquid-background.gif) repeat-y 68% 0; } #content { clear: right; float: right; width: 70%; padding: 10px 0; margin: 0 0 0 4%; display: inline; background: #dfe6ef; border-top: 1px solid #fff; border-left: 1px solid #fff; border-bottom: 1px solid #fff; } #content h2 { margin: 0; } #aside { float: left; width: 20%; padding: 10px 0; margin: 0 3% 0 0; display: inline; background: #d1dceb; border-top: 1px solid #fff; } #aside h3 { margin: 0; } #footer { clear: right; background: #d1dceb; text-align: right; padding: 20px; width: 68%; float: right; overflow: hidden; } #footer p.left { float: left; text-align: left; margin-left: 5px; } #footer p.right { float: right; text-align: right; margin-right: 5px; }Attached Files screenshort.png 90.3KB 0 downloads example : Code: [Select] <?php code; ?> how to change CSS (i guess this is the method) using php or javascript to organize text/code like <code></code> here ! i did a search and didnt found anything useful! |