Jump to content

algidDes702

Members
  • Posts

    28
  • Joined

  • Last visited

About algidDes702

  • Birthday 05/10/1990

Contact Methods

  • Website URL
    http://www.algidiousdesign.com

Profile Information

  • Gender
    Male
  • Location
    Las Vegas, NV

algidDes702's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I am failing to see the problem? Is it still there, if so explain it some more. If its not please mark your post as 'solved'
  2. with other form input tags, the value attribute would usually place the content within that field. With the textbox however, this is not the case. You would place your content inside the tags like this: //yours echo "<tr><td></td><td><textarea rows=\"10\" cols=\"50\" name=\"homepage\" value=\'$homepag\'></textarea></td></tr><br>\n"; //mine echo "<tr><td></td><td><textarea rows=\"10\" cols=\"50\" name=\"homepage\">$homepag</textarea></td></tr><br>\n"; the content to be edited will get placed inside the text box. The content that is showing up before the text area is due to your echo"$homepage<br><br>\n"; remove that and i would think everything should work fine. As far as your method of getting the data, there are other ways to access and get data from a database but an understanding of object oriented programming (OOP) would be needed as PHP's library has objects and classes set up to do just that. Here is an example: http://php.net/manual/en/book.pdo.php If OOP is hard to understand or you havent worked with it before then i would say stick with your current method. algid
  3. my apologies for the improper syntax there. The correct way to use textarea is as a tag, such as: <input type="text" name="textName"/> <!--This is the single line entry --> <textarea name="textareaName" rows="10" cols="10"><!-- Your variable that pulls in your 3 paragraphs would go here--> </textarea> both of those above can be used within the form tags and will pull in the data using $_GET or $_POST variables. Here is a link to the documentation for textarea: http://www.w3schools.com/tags/tag_textarea.asp and for input type text: http://www.w3schools.com/tags/att_input_type.asp I work with a lot of mixed HTML and PHP, but started off with HTML and CSS. CSS is waayy more reliable than working with table attributes and i really try to stay away from using tables, i stick with using DIV tags instead. of course depending on the use case. Heres a quick tutorial on CSS as well in case you are interested: http://www.w3schools.com/css/ hope this helps out! algid
  4. Looks fine to me as well in chrome and firefox, however i have had major rendering frustrations in my past using tables and their standard attributes. I usually stick with CSS and have a little bit more control over exactly how 'bottom-aligned' i guess you could say, i wanted my images, divs, whatever.
  5. I would agree with mrMarcus, there is not much difference between placing it directly outside your loop and it being in the loop, the placing in html would be the same.
  6. Okay i somewhat understand what you are asking. If im not mistaken, you have a ticker symbol and you want to use that to get the current price of the symbol. The link you provided is a .csv file. PHP has a function called fgetcsv() which you can use to parse the information. The returned value is an array, usually parsed by field. <?php $conn = mysql_connect("xxx","xxx","xxx"); $db = mysql_select_db("xxx",$conn); $getPrice = file('http://quote.yahoo.com/d/quotes.csv?s=AAPL&f=l1&e=.csv'); //opens the file and gets the contents and puts it in an array // the $getPrice array now contains your price, you will place it where ever you need by using $getPrice[0] $sql="INSERT INTO portfolio (symbol) VALUES ('$_POST[symbol]')"; if (!mysql_query($sql,$conn)) { die('Error: ' . mysql_error()); } echo "1 record added"; mysql_close($conn); ?> hope this helped your question algid
  7. Hey there, for future reference, be sure to place your code inside of [ code ][ /code ] (with no spaces on the inside of the tags) tags so its easy to read. As for your example, why dont you change the the input type to 'textarea' instead of just 'text' ? You can then use either CSS to style in the appropriate height and width or you can use a format like this: <textarea rows="2" cols="20"> to get the proper height and width you need. Hope that helped algid
  8. good luck its a super small issue, step away from your code and come back. You're going to slam your head against your desk when you discover the issue here haha
  9. Before you try submitting them into the database just echo or print them out to the page so you can make sure the data is getting assigned to those variables. That error message tells me that the data that is submitted isnt reaching your query. So after the if statement just do something like this: echo $name."<br/>".$email."<br/>".$question; Make sure the data is getting printed. You can also check the URL since you are using GET. thanks algidDes
  10. Youre form was submitted using the GET method. So to get your variables that are submitted you would do something like this: if(isset($_GET['submit'])){ $name = $_GET['name']; $email = $_GET['email']; $question = $_GET['question']; //your code to insert variables into db can go here or after the if statement } hope this helped
  11. Something like this? html code: <div class="headerCont"> <div class="columns column1"> column 1 </div> <div class="columns column2"> column 2 </div> <div class="columns column3"> column 3 </div> <div class="clear"></div> </div> css code: <style type="text/css"> .headerCont { width:1000px; height:250px; text-align:center; margin-left:auto; margin-right:auto; } .columns { height:250px; float:left; } .column1 { width:60%; background-color:#6FC; } .column2 { width:20%; background-color:#CC0; } .column3 { width:20%; background-color:#0F0; } .clear { clear:both; } </style> To get this to happen you have to use float and clear. When you float a div or element it looses its strict height and width that pushed surrounding elements into position, however if you clear the floats as in my .clear class then the elements gain their strict height and widths back. thanks algidDes523
  12. maybe something like this?? $keywords = array("web design","oldham web design","php new"); $textToSearch = "This the string you want to search that might include web design, oldham web design, or php new"; foreach ($keywords as $search){ $pattern = "/$search/"; $matches = preg_match_all($pattern, $textToSearch); $numberOfMatches = count($matches); echo $numberOfMatches.PHP_EOL; } i believe that should work for what you asked, buuttt i havent exactly had my coffee this morning so dont hold your breath! That should be a start though. thanks algidDes523
  13. Does your database have a 'date' or 'timestamp' column to query along with your other fields? eg: $sql = 'SELECT * FROM user_references WHERE employment_id=\''.$rowe['id'].'\' AND user_id=\''.$user_id.'\' AND status=\'active\'' ORDER BY date ; it was difficult for me to follow your quotes and concatenations. Here is a good guide to follow if this didnt help, but it will order your query results by however you like using the existing fields in your database. http://dev.mysql.com/doc/refman/5.0/en/order-by-optimization.html thanks algidDes523
  14. When you have an empty action in a form, ie: <form method="post" action=""> it is a self serving form so the url would not change unless you made the method "GET" instead of post. "GET" puts the variables into your URL. However if you are using these forms for MySQL queries, putting the queries in the URL leaves the application open for SQL injections which can be malicious. Use echo, print, or print_r is using arrays to make sure the data being entered is what you want to be used in the database query. for example i might do this for your code: if (isset($_POST['type1'])) { echo "This was type1:" . $_POST['type1']; echo "UPDATE table SET status = 1 WHERE id = $rid"; //this will print just the database query to make sure $rid is what you want it to be //mysql_query("UPDATE tabke SET status = 1 WHERE id = $rid", $c2) or die(mysql_error()); } if (isset($_POST['type2'])) { echo "This was type1:" . $_POST['type2']; echo "UPDATE table SET status = 1 WHERE id = $rid"; //this will print just the database query to make sure $rid is what you want it to be //mysql_query("UPDATE table SET status = 1 WHERE id = $rid", $c2) or die(mysql_error()); } if (isset($_POST['type3'])) { echo "This was type1:" . $_POST['type3']; echo "UPDATE table SET status = 1 WHERE id = $rid"; //this will print just the database query to make sure $rid is what you want it to be //mysql_query("UPDATE table SET status = 1 WHERE id = $rid", $c2) or die(mysql_error()); } ?> your code that we have is slightly uncomplete to know exactly what you are doing, we dont know where $rid is coming from. Also you said the URL doesnt change but how your forms are set up, your URL shouldnt change UNLESS your function call within the onclick "this.form.submit()" is suppose to alter the URL when hitting submit on any of the three forms. algidDes523
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.