Jump to content

keeB

Staff Alumni
  • Posts

    1,075
  • Joined

  • Last visited

Everything posted by keeB

  1. You have a value, but no name to reference it as.. [=
  2. you are aware that.. [code] $x = "abc123"; print $x; print "$x"; print " " . $x . " "; [/code] take note of the second example... there's no reason to escape the string if you're using print.
  3. What you'll want to do is a simple thought process.. think of it this way. - Grab the number of 'Watched Jobs' the user has. - Grab the users's membership status. - Once both of those are defined, then allow insertion only if the number of Watched Jobs is less than what the membership status allows ( should not be hardcoded, but should be in a variable somewhere, to make it more expandable )
  4. [!--quoteo(post=354092:date=Mar 12 2006, 06:00 AM:name=txmedic03)--][div class=\'quotetop\']QUOTE(txmedic03 @ Mar 12 2006, 06:00 AM) [snapback]354092[/snapback][/div][div class=\'quotemain\'][!--quotec--] No, keeB, no one said it was ever going to be anything more than text. It may be just technical data or something. Either way would work, but you must not assume anything... [/quote] follow that link to see what it is.. and even if it weren't that, if it were technical data, there would be no harm in encapsulating it as a .php instead of .txt.. I can't think of a reason not to.
  5. There's plenty of PHP tutorials on this site's main page [a href=\"http://www.phpfreaks.com\" target=\"_blank\"]PHPFreaks[/a] Good luck reading them over, and.. if you have any more specific questions, don't hesitate to come back and ask!
  6. you can always [code]<input type="hidden" name="" value="">[/code] which will be processed with POST or GET.. [= hope that helped!
  7. [!--quoteo(post=354023:date=Mar 11 2006, 10:03 PM:name=russia5)--][div class=\'quotetop\']QUOTE(russia5 @ Mar 11 2006, 10:03 PM) [snapback]354023[/snapback][/div][div class=\'quotemain\'][!--quotec--] Hello, I have folders on my site that no matter what permissions I give them in the Cpanel, I still can not remove them. I was told, that using php, you could make a file restrictive to other than the normal ugo that you find in the CPanel. How do you give these folders these permissions and how do I remove these permissions so I can remove the folders/files that are presently on my site. (this is assuming that my information is accurate of course) [/quote] do you have ftp access?
  8. [!--quoteo(post=354052:date=Mar 12 2006, 01:21 AM:name=sgb162)--][div class=\'quotetop\']QUOTE(sgb162 @ Mar 12 2006, 01:21 AM) [snapback]354052[/snapback][/div][div class=\'quotemain\'][!--quotec--] If you're trying to ignore all capital letters, [^A-Z] should do it just fine.. [/quote] no silly he's trying to allow 'a-z A-Z 1-9 . a-z A-Z 1-9 @ a-z A-Z 1-9 . a-z A-Z 1-9' and underscores anyway, there is no other way that i know of bud.. but a great regex it was [=
  9. [code]// This line connects to the database. include_once("config.php"); global $connection; $country_id = $_GET[country_id]; [i].....[/i] $result = mysql_query($query,$connection); [/code] the problem is there. $connection wont have a value because it seem's you're (re)declaring it to have no value. if inside of config.php you have [i]$connection = mysql_connect();[/i] then $connection will be a usable variable WITHOUT the global declaration... I hope this helps.
  10. A small note.. If at all possible you should probably change that to .php extension just to enhance functionality if you ever need to. Better to do it now that later, right?
  11. [!--quoteo(post=353660:date=Mar 10 2006, 05:11 PM:name=newmedia)--][div class=\'quotetop\']QUOTE(newmedia @ Mar 10 2006, 05:11 PM) [snapback]353660[/snapback][/div][div class=\'quotemain\'][!--quotec--] Is there any way of changing the way a MySQL record is displayed (using css) depending on its row $id ? i tried to add the stylesheet href ($style) to each row in the databasese and incorporate that in the pages header : <link rel="stylesheet" type="text/css" href="../assets/<?php echo "$style" ?id=$id" ?>"> I'm thinking this didnt work for loads of resons. I'm no expert as you might have gathered. ..so just to clarify, I need my dynamic form to display the data differently, depending on the row id / session id . Any suggestions Tim [/quote] This shouldn't be a problem, really.. If you really want to use this approach, then I would go something like.. [code] <link rel="stylesheet" type="text/css" href="../assets/<?=$userid;?>.css">[/code] If the userid variable contained 1482, the output would look like.. [code] <link rel="stylesheet" type="text/css" href="../assets/1482.css">[/code] Just make sure the CSS file is there, and it will work [=
  12. [!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]IF hardware.PartNum and newhardware.PartNum = same THEN IF hardware.PriceEx1 not= newhardware.PriceEx1 THEN hardware.PriceEx1=newhardware.PriceEx1 IF hardware.Weight=NULL THEN hardware.Weight=newhardware.Weight IF hardware.URL=NULL THEN hardware.URL=newhardware.URL IF hardware.Height=NULL THEN hardware.Weight=newhardware.Weight Delete that row / record from newhardware ELSE IF hardwareinactive.PartNum and newhardware.PartNum = same THEN Update Whole Lot into hardwareinactive Delete that row / record from newhardware ELSE newhardware.hasimage='NEWPRODUCT' END IF [/quote] That's known as Pseudo-Code.. The flaw in this design, is the design of your SQL statements. I would have laid your database out in a very different way, I think.. Think of a database like this. All parts, 1 table, with different statusid's ( relational to the status table where you can expand different status id's and track what they mean ).. Think status 10 = new parts, status 200 = hidden hardware.. so for new parts, in a theoretical table you could say.. [code]select * from hardware where statusid = 10[/code] I hope this steers you in a good direction.
  13. [!--quoteo(post=353641:date=Mar 10 2006, 03:49 PM:name=dirty_student)--][div class=\'quotetop\']QUOTE(dirty_student @ Mar 10 2006, 03:49 PM) [snapback]353641[/snapback][/div][div class=\'quotemain\'][!--quotec--] hi every1 i need help!!!! I am creating a student management system in dreamweaver using php mysql for university and have ran into a problem. I have a log in page where a username and password is entered from the student table and then the user is taken to the next page which is where i would like to display the users name from the database but dunno how??? suggestions??? probably easy but got no clue!! cheers steve [/quote] Consider this hypothetical users table.. [code] <?php $q = "select firstName, lastName from users where login = $_POST['login']"; $result = mysql_query($q,$conn); // $conn is the connection pointer $username = mysql_fetch_row($result); ?> [/code] That would make $username[0] = user's first name, and $username[1] = user's last name..
  14. change.. [code]<?php //echo gethostbyaddr($_SERVER['REMOTE_ADDR']); $db = mysql_connect("localhost", "root", "ramki"); $test=mysql_select_db("streamware");[/code] to.. [code]<?php //echo gethostbyaddr($_SERVER['REMOTE_ADDR']); $db = mysql_connect("localhost", "root", "ramki") or die("unable to connect"); $test=mysql_select_db("streamware") or die ("unable to select db");[/code] and remove the rest :)
  15. [code]include_once('../../lib/func.php'); include_once('../../config.php');[/code] you gotta realize.. each '../' is like going back one folder.. not starting from the beginning :)
  16. [!--quoteo(post=353522:date=Mar 10 2006, 05:31 AM:name=Humpty)--][div class=\'quotetop\']QUOTE(Humpty @ Mar 10 2006, 05:31 AM) [snapback]353522[/snapback][/div][div class=\'quotemain\'][!--quotec--] [b](appologies for 2 posts...was accident)[/b] G'day again all powerfull PHPers, I am about to make a very long piece of code, (coz my SQL sucks), that will involve a hand full of loops and a few SELECTs and INSERTs. I come from a land of VB where if I needed to such things I would have a progress bar or other indication that all is well. Is there something similar that I can do in PHP? ..so far pages I've done wait till everything is done before the page is dispalyed to the user. This is trageted at people who I KNOW will think it froze and start clicking and closing impatiently. Any suggestions? [/quote] The only way something like this could be done would be using Ajax, I think. however... how about you explain what you want to do and we can help come up with an alternative or a better approach so you dont have such long page rendering time?
  17. [!--quoteo(post=353319:date=Mar 9 2006, 06:07 PM:name=Luke Brown)--][div class=\'quotetop\']QUOTE(Luke Brown @ Mar 9 2006, 06:07 PM) [snapback]353319[/snapback][/div][div class=\'quotemain\'][!--quotec--] I am not sure what to actually do from here, is ther a way i can make it so it just searched for the username and not try an process it if it has a "." in it. [/quote] Your query to the database can include like that.. take this theoretical statement.. [code] select * from users where login not in ( select * from users where login like '%.%' ) [/code] Hope that helped.. ;)
  18. keeB

    login

    [!--quoteo(post=353330:date=Mar 9 2006, 06:48 PM:name=Twentyoneth)--][div class=\'quotetop\']QUOTE(Twentyoneth @ Mar 9 2006, 06:48 PM) [snapback]353330[/snapback][/div][div class=\'quotemain\'][!--quotec--] I need login help, I want to make an admin login on my site, where if the admin is logged in, it will show you special admin links, but I dont know how to go about it... if ($admin == 1) { include "adminlinks.php"; } else { include "mainlinks.php"; } The problem is, I dont know how to make admin == 1 for just me, and not when I'm signed in, everyone else will see the admin links as well....any help? [/quote] You should really look into the guide on the main page about making a log in system.. ;d
  19. [a href=\"http://us2.php.net/manual/en/function.strstr.php\" target=\"_blank\"]http://us2.php.net/manual/en/function.strstr.php[/a] :)
  20. [!--quoteo(post=352984:date=Mar 8 2006, 09:02 PM:name=anticore)--][div class=\'quotetop\']QUOTE(anticore @ Mar 8 2006, 09:02 PM) [snapback]352984[/snapback][/div][div class=\'quotemain\'][!--quotec--] image 1-4 are for inputing the locations of the images. the listing part of this will only show the thumbnail followed by the owner/name clicking on it will bring up a description followed by 4 pictures. should i just upload the images to the table? would that be complicated? [/quote] So 1 thumbnail, 4 pictures? You see the problem with this right? You'll never be able to expand nicely, if, say, you want 5 pictues, and it's actually LESS work to make it expansive. Take this layout for example... table thumbnails table images if you make thumbnails and images relational.. meaning they both have 1 field which can associate each other with one another.. then you can have multiple images per thumbnail. make sense? Take this hypothetical query: [code]select * from thumbnails tn inner join images i on i.thumbnailid = tn.id where tn.id = 2[/code] I hope that makes a bit of sense, I can elaborate more if needed ;)
  21. Just looking code over, what's the MYSQL_NUM for? also, can you give the error, please?
  22. [!--quoteo(post=353005:date=Mar 8 2006, 09:28 PM:name=omahakid)--][div class=\'quotetop\']QUOTE(omahakid @ Mar 8 2006, 09:28 PM) [snapback]353005[/snapback][/div][div class=\'quotemain\'][!--quotec--] Thanks for your help. [/quote] Of course, anytime!! :D
  23. [code] [b]Basic SQL Contruct[/b] select t.topic from topics t inner join meetings m on m.meetid = t.meetid where m.meetid = 1 [/code] This will get you all topics for meeting #1. Write a function which then loops through the results, and echo's each row.. or put's it in an array (reusable) Good luck ;)
  24. [!--quoteo(post=352988:date=Mar 8 2006, 09:06 PM:name=demon_athens)--][div class=\'quotetop\']QUOTE(demon_athens @ Mar 8 2006, 09:06 PM) [snapback]352988[/snapback][/div][div class=\'quotemain\'][!--quotec--] Lets make it spesific then... " How can I find a string and replace it with another given string in a variable?" better? [/quote] Ouch. Attitude. Well let me explain. Regular expressions can help you find the string ESPECIALLY IF IT IS DYNAMIC, I.E. you dont know what will be between [i]src="<here>"[/i] once you find that location OR the data reference [i]"<here>"[/i] you can easily replace the data with what you need it to be, and, using the same method, check to see IF it is already an absolute link. The reason I am not just giving you code is you can easily copy and paste it and not learn anything.. I am not trying to be a teacher, but what happens if you need this help again? That's why I gave you 2 topics to go read on..
  25. Ok, you took the right approach, and you're definately there. Now it's just a matter of finesse. Basically you have redundant data right? And you want to format your output so it's like Meeting 1; Topics: list of topics; Location: You already have the meetingId in the table, so I am not really understanding what the problem is? Eventhough you have redundant data in your output.. doing a simple query can just get you the topics for a given meeting and write a function that returns it as an array, print all of them in a row.. make sense?
×
×
  • 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.