Jump to content

Noctagon

Members
  • Posts

    28
  • Joined

  • Last visited

    Never

Everything posted by Noctagon

  1. HI all, not sure if this is the right spot to ask this question but here goes. I have a password protected directory. I plan on using an excel macro to open a web browser to a particular web page within the password protected directory. I am just wondering if there is a way, just like when ftping, to specify in the url for the page the variables (username and password) so the user doesnt have to enter them. thanks
  2. Hello everyone, I am looking for advice or suggestions on options for a system I am looking for. I am looking to have a whole stack of small audio files (probably mp3 format) on a server. I then need a system that creates an order of files to be joined (server side) then saved as a 1 merged file. As an example: Some code would take user input from a form and then generate a string that corresponds to files to be joined and in what order (File4, File23, File17, File7, etc). Then something server side would merge the files and save (as a new single file) the new file. Then, if at all possible, and I don't like my chances but you never know, that single merged file to be re-writen with another file merged to it on another audio track such that it complimented the existing file instead of being attached to the end of it. I look forward to any and all feedback and or suggestions. Cheers, Noc
  3. From what i can conjure up it would look something like this???? $sql = mysql_query ("SELECT * FROM `projects` ORDER BY `col4` LIMIT 20"); echo "<table>"; goto here (not sure how to syntax it ) echo "<tr>"; set i = 1 while ($r = mysql_fetch_array($sql)){ echo "<td><a href=\"{$r['col3']}\"><img src=\"{$r['col1']}\" width=\"150\" height=\"150\" border=\"0\" longdesc=\"{$r['col2']}\" />[/url]</td>"; i = i+1 if i = 6 { echo"</tr>"; goto the goto here spot } } echo "</tr>"; echo "</table>"; Any one with some useful ammendments ???
  4. Thanks, that does the trick.......ONLY 1 more thing to do now This gives me results that run vertically down the page, I did adjust the code so that for each 'while' it just adds a new cell not a new row. You guessed it...now it goes horizontally but off my page to the right, lol. How would i make it add a new row at every six cycles through the 'while'. So I would effectively have something like: $sql = mysql_query ("SELECT * FROM `projects` ORDER BY `col4` LIMIT 20"); echo "<table>"; echo "<tr>"; while ($r = mysql_fetch_array($sql)){ echo "<td><a href=\"{$r['col3']}\"><img src=\"{$r['col1']}\" width=\"150\" height=\"150\" border=\"0\" longdesc=\"{$r['col2']}\" /></a></td>"; -------> Now if 6 cells have been added to the row then start a new row <----------- } echo "</tr>"; echo "</table>";
  5. Hmm, I put a quotation mark at the end of the long line I get an error which says: Parse error: syntax error, unexpected '{', expecting ',' or ';' in /home/mysite/public_html/projects.php on line 15 where line 15 is --> echo "<tr><td><a href="{$r['col3']}"><img src="{$r['col1']}" width="150" height="150" border="0" longdesc="{$r['col2']}" /></a></td></tr>"
  6. Based on the code provided I guess I am looking for something like this (just not sure how to syntax it): $sql = mysql_query ("SELECT * FROM `projects` ORDER BY col4 LIMIT 20"); echo "<table>"; while ($r = mysql_fetch_array($sql)){ <td><a href="[col3]"><img src="[col1]" width="150" height="150" border="0" longdesc="[col2]" /></a></td> } echo "</table>"; Thanks
  7. Yes mysql Yes db connected Yes for number 3 I am attempting to make the hyperlink associate to the pic so you click the picture to activate the hyperlink. Also the alt text will be associated to the pic too.....not in a cell next to it. When I use your code i get an error like this: Parse error: syntax error, unexpected '<' in /home/mysite/public_html/projects.php on line 15 --> line 15 is: <td>$r['col1']</td> // Picture Thanks.
  8. Hello Everyone. I am looking for some assistance to generate a query/code to help me manage my various projects. The code needs to do the following once I have connected to my database (consider this step already complete): Get the following info out of the active database from the "projects" table. In the projects table I have 4 columns (well, 5 if you count my primary auto inc key). I need to extract col1 (this is in the form of http://www.mydomain.com/projects/1), col2 (this is a description of the project), col3 (this is also a hyperlink) with a limit of 20 and ordered by col4 (which is in the form of a date) Present the result of the query in a html table where each new cell represents 1 of the maximum 20 instances. So the first cell of the table will have a pic in it sourced from col1, the alt text for the pic will be from col2 and col3 will be a hyperlink associated to the pic. I really hope this makes sense. Please ask any questions for clarity. I really appreciate any help that can be given. Thanks in advance.
  9. Hi all how do I format a variable. I have a variable ($vari) and it equals 123456 but I want it to display 123,456 when I echo the variable. Thanks :)
  10. Hi all, I think I need to explain a little more  :) I am TRYING to build a site where users can login......getting that bit done :) Once a user is logged in there will be a page that has a button on it.....when the button is clicked a little counter next to the button will increment by 1 for each click in real time.....this will be user specific.....so 10 users could be logged onto the site and each clicking there own button and being displayed only their clicks I will then be using the clicks value with PHP. Any assistance would be greatly appreciated as other suggestions have appeared to me to be not able to cope with users. Thank you :)
  11. OK, now I have the email being sent but it gets rejected with: Subject: Delivery Status Notification (Failure)       The following message to <blah@blah.com> was undeliverable. The reason for the problem: 5.1.0 - Unknown address error 550-'Administrative prohibition' What could be causing this?
  12. Hi mb81, I am not sure.....All I put in php.ini was smtp = mail.iinet.net.au how do I check if it is set up correctly.......through my mail client when I send emails I do not have the box ticked which says server requires authentication.
  13. Hi all I am using this tutorial for a members system. http://www.phpfreaks.com/tutorials/40/3.php It seems to be working fine all the way up to when this part of the code executes... [code]    mail($email_address, $subject, $message,         "From: MyDomain Webmaster<admin@mydomain.com>\n         X-Mailer: PHP/" . phpversion());     echo 'Your membership information has been mailed to your email address!     Please check it and follow the directions!'; [/code] It tries to send the email, it echos out the 'Your membership....message' and then I get an email which says: [quote]Subject: Delivery Status Notification (Failure)       The following message to <email@signupemailaddy.com> was undeliverable. The reason for the problem: 5.1.0 - Unknown address error 550-'Administrative prohibition'[/quote] NB: I did substitute the email for this post :) Any ideas on what might be causing this error. I am running the script from localhost and have gone into the php.inin file and changed the mail settings to my outgoing smtp server. Thanks, Noctagon :)
  14. That looks like the same code to me :) I actually omited something any way...this is the code I was using: [code]$query = 'SELECT SUM(votes) FROM vote_table where user_id="1"'; $result = mysql_query($query) or die('Query failed: ' . mysql_error()); while ($tvotes = mysql_fetch_array($result)) { if ($tvotes['vote_table'] < 1000) { $votecolour = '<b><font color=black>Black</font></b>'; } else { if ($tvotes['vote_table'] < 5000 and $tvotes['vote_table'] >= 1000) { $votecolour = '<b><font color=blue>Blue</font></b>'; } else { $votecolour = '<b><font color=red>Red</font></b>';[/code]
  15. Hi all, I must be still missing something, when I run this code I end up with 'array' I thought the while fixes this. Total noob so go easy on me ;) Thanks in advance for your help BTW, My aim is to sum the values in the votes column of table vote_table where the user_id value =1 Then if the value is within a certain value range then run the appropriate if line. [code] $query = 'SELECT votes FROM vote_table where user_id="1"'; $result = mysql_query($query) or die('Query failed: ' . mysql_error()); while ($tvotes = mysql_fetch_array($result)) { if ($tvotes['vote_table'] < 1000) { $votecolour = '<b><font color=black>Black</font></b>'; } else { if ($tvotes['vote_table'] < 5000 and $tvotes['vote_table'] >= 1000) { $votecolour = '<b><font color=blue>Blue</font></b>'; } else { $votecolour = '<b><font color=red>Red</font></b>';[/code]
  16. I am trying to run a query that will look at a specific table and then tally up the values in a certain field. Cant figure out how to do this. Any pointers would be greatly appreciated. Thanks :)
  17. Thankyou so much for your reply......exactly what I required........nice metaphor too as I am a magician ;)
  18. Hi all, I am pretty new to this stuff still and have done a bit of searching but can't make sense out of stuff yet. I have code as follows: [code] $query = 'SELECT totals FROM alpha where UserID="1"'; $result = mysql_query($query) or die('Query failed: ' . mysql_error()); echo "$result";[/code] I want it to look in the table called alpha at the column called totals and return me the entry where on the same row under the userid column the value is 1 I keep getting a resource id # result....... How do I adjust things. Thanks :)
  19. Hi all, probably just a noob with syntax error again.  Can anyone spot what is wrong in my attempt to set up an if statement based on the value of a variable. Thanks :) [code] if ($nompen > 0) { $numcolor = "#FF0000"; } else { $numcolor = "#333333"; }[/code] I am trying to use it here to specify font colour based on value of $nompen which I can echo and it is giving a number :) [code] <td><a href="nompen.php">nompen </a><b>(<font color=<?php $numcolor?>><?php echo $nompen?></font>)</b></td>[/code]
  20. I am not sure how way off I am here, but here goes :) I have a button in a form and when I click it I want the value of the variable $count to increase by 1. Any assistance would be greatly appreciated. Thanks :) [code]<input type="button" name="$but1" value="1"> .......................................................... if (isset($but1)) $count = $count + 1;[/code]
  21. [quote author=obsidian link=topic=109490.msg441403#msg441403 date=1159231752] if you're wanting it in the typical SQL DATETIME format (YYYY-MM-DD HH:MM:SS), just use this: [code] <?php $ts = date('Y-m-d h:i:s'); ?> [/code] [/quote] Thanks, that worked perfectly :)
  22. I am attempting to set up a variable so that it equals the current date and time so that I can send that to the database when an item is added so i know when it was added. How do I do this? Thanks :)
  23. Thanks for the speedy reply.......doh.....I said to myself that double equals sign will never get me ;) Cheers
  24. Hi All, I am totally new to this stuff so thanks in advance for your patience :) I am trying to run a simple if statement and it is not working as plan.  Perhaps someone could tell me why :) I have a drop box weaved into my code as follows [code]<select size="1" name="nomtacyn"> <option selected>No</option> <option>Yes</option> </select>[/code] the form action is to run this [code]<?php   $nomtacyn = $_POST['nomtacyn'];   $DOCUMENT_ROOT = $_SERVER['DOCUMENT_ROOT']; ?> <html> <head> </head> <body> <?php if ($nomtacyn = No) { echo "Your have selected No"; } else { Echo "You have selected yes"; } ?> </body> </html>[/code] Thanks :)
×
×
  • 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.